$target_preset_robots = array(); if (isset($target_playerinfo['player_robots'])) { $target_preset_robots = $target_playerinfo['player_robots']; } $target_playerinfo['player_robots'] = array(); //echo '<pre>$this_battleinfo = '."\n".print_r($this_battleinfo, true).'</pre>'."\n"; //echo '<pre>$this_playerinfo = '."\n".print_r($this_playerinfo, true).'</pre>'."\n"; //echo '<pre>$this_preset_robots = '."\n".print_r($this_preset_robots, true).'</pre>'."\n"; //echo '<pre>$target_playerinfo = '."\n".print_r($target_playerinfo, true).'</pre>'."\n"; //echo '<pre>$target_preset_robots = '."\n".print_r($target_preset_robots, true).'</pre>'."\n"; // Load the object data for this field from the session $this_field = new rpg_field($this_fieldinfo); //echo '<pre>$this_fieldinfo = '."\n".print_r($this_fieldinfo, true).'</pre>'."\n"; //echo '<pre>$this_field->export_array() = '."\n".print_r($this_field->export_array(), true).'</pre>'."\n"; // Add the player info to the battle $this_battle->add_player($this_playerinfo); $this_battle->add_player($target_playerinfo); //echo '<pre>$this_playerinfo('.$this_player_id.') = '."\n".print_r($this_playerinfo, true).'</pre>'."\n"; //echo '<pre>$target_playerinfo('.$target_player_id.') = '."\n".print_r($target_playerinfo, true).'</pre>'."\n"; // Load the player objects from the battle $this_player = $this_battle->get_player($this_player_id); $target_player = $this_battle->get_player($target_player_id); //echo '<pre>$this_player->export_array() = '."\n".print_r($this_player->export_array(), true).'</pre>'."\n"; //echo '<pre>$target_player->export_array() = '."\n".print_r($target_player->export_array(), true).'</pre>'."\n"; // Break apart and filter this player's robots, adding to player and battle $this_player_robots_strings = strstr($this_player_robots, ',') ? explode(',', $this_player_robots) : array($this_player_robots); foreach ($this_player_robots_strings as $temp_key => $temp_string) { // Break apart the string into robot ID and token list($temp_id, $temp_token) = explode('_', $temp_string); // Define the basic lookup array for this robot $temp_robotinfo = array('robot_id' => $temp_id, 'robot_token' => $temp_token);