[XP] Battle Processing based on variable?

Please don't ask why I need this, i'm working on something secret. 😛
 

So, in RPG Maker XP, how am I able to start a battle with a troop based off a variable?

screenshot_13.png


I figure it would be a script call, but the XP scripts are in a mess compared to Ace so I wouldn't know what to look for.

Thanks for any help! 😉
Hi,

When you are looking for the equivalent of a specific event command, you can try to search for the name of that command within the "Interpreter" scripts. In the case of "Battle Processing" you would have found this for example:

Spoiler
#--------------------------------------------------------------------------# * Battle Processing#--------------------------------------------------------------------------def command_301  # If not invalid troops  if $data_troops[@parameters[0]] != nil    # Set battle abort flag    $game_temp.battle_abort = true    # Set battle calling flag    $game_temp.battle_calling = true    $game_temp.battle_troop_id = @parameters[0]    $game_temp.battle_can_escape = @parameters[1]    $game_temp.battle_can_lose = @parameters[2]    # Set callback    current_indent = @list[@index].indent    $game_temp.battle_proc = Proc.new { |n| @branch[current_indent] = n }  end  # Advance index  @index += 1  # End  return falseend
However, to initiate a battle you probably only need these lines:

$game_temp.battle_calling = true
$game_temp.battle_troop_id = <Troop Database ID>

$game_temp.battle_can_escape = true/false
$game_temp.battle_can_lose = true/false
Would it work if I called

$game_temp.battle_calling = true$game_temp.battle_troop_id = $game_variables[5]$game_temp.battle_can_escape = false$game_temp.battle_can_lose = falseEdit:

*victory music*

It worked! T'anks very much 🙂

Original thread: https://forums.rpgmakerweb.com/threads/xp-battle-processing-based-on-variable.43150/