I'm using a large party script that allows for more than four "heroes" in a party. The way I'm planning my battles and skills will require a lot of Forced Actions. Unfortunately, since a five person party is not a feature that came originally with RMXP, I am unable to do a forced action on the fifth battler.
Here is the code for Force Action:
I'm not very sure I understand fully how this works.. But what I'm thinking is this:
Firstly, I think this is the line that chooses which battler? I'm guessing that (@parameters[0], @parameters[1]) is referring to the Actor or Enemy chosen using the event command. How do I make it so that in the place of those parameters I can just call upon a certain actor in the party?
Also, I realize that because I'm using a script I can't use the other parts of the event commands to set what action and target I want. So I'm guessing it means I have to tamper with the other parameters as well.
I think I can see what each individual thing does, but have no knowledge of how to adapt it.
I would really appreciate if someone took the time to
1) Explain how to choose a certain actor, action, and target outside of the command system
2) Explain how to create a call-able script that will allow variety in creating forced actions for the fifth party member
Or simply just create a script that would allow the fifth party member to do forced actions
Apologies for my weak attempt at understanding the code, and thanks in advance for any help that is given!
Here is the code for Force Action:
Code:
#--------------------------------------------------------------------------
# * Force Action
#--------------------------------------------------------------------------
def command_339
# Ignore if not in battle
unless $game_temp.in_battle
return true
end
# Ignore if number of turns = 0
if $game_temp.battle_turn == 0
return true
end
# Process with iterator (For convenience, this process won't be repeated)
iterate_battler(@parameters[0], @parameters[1]) do |battler|
# If battler exists
if battler.exist?
# Set action
battler.current_action.kind = @parameters[2]
if battler.current_action.kind == 0
battler.current_action.basic = @parameters[3]
else
battler.current_action.skill_id = @parameters[3]
end
# Set action target
if @parameters[4] == -2
if battler.is_a?(Game_Enemy)
battler.current_action.decide_last_target_for_enemy
else
battler.current_action.decide_last_target_for_actor
end
elsif @parameters[4] == -1
if battler.is_a?(Game_Enemy)
battler.current_action.decide_random_target_for_enemy
else
battler.current_action.decide_random_target_for_actor
end
elsif @parameters[4] >= 0
battler.current_action.target_index = @parameters[4]
end
# Set force flag
battler.current_action.forcing = true
# If action is valid and [run now]
if battler.current_action.valid? and @parameters[5] == 1
# Set battler being forced into action
$game_temp.forcing_battler = battler
# Advance index
@index += 1
# End
return false
end
end
end
# Continue
return true
end
I'm not very sure I understand fully how this works.. But what I'm thinking is this:
Firstly, I think this is the line that chooses which battler? I'm guessing that (@parameters[0], @parameters[1]) is referring to the Actor or Enemy chosen using the event command. How do I make it so that in the place of those parameters I can just call upon a certain actor in the party?
Code:
iterate_battler(@parameters[0], @parameters[1]) do |battler|
Also, I realize that because I'm using a script I can't use the other parts of the event commands to set what action and target I want. So I'm guessing it means I have to tamper with the other parameters as well.
I think I can see what each individual thing does, but have no knowledge of how to adapt it.
I would really appreciate if someone took the time to
1) Explain how to choose a certain actor, action, and target outside of the command system
2) Explain how to create a call-able script that will allow variety in creating forced actions for the fifth party member
Or simply just create a script that would allow the fifth party member to do forced actions
Apologies for my weak attempt at understanding the code, and thanks in advance for any help that is given!