- Joined
- May 20, 2016
- Messages
- 2
- Reaction score
- 0
- First Language
- English
- Primarily Uses
Hello,
I have not signed up for one of these forums in a while, so I will try my best to explain my situation:
I am currently writing my own custom script for a battle system similar to a "Free Turn". In this system, every battler acts immediately when their turn comes around to them.
Every battler in the field (both ALLIES and ENEMIES) are arranged in an array based on their agility stat, and the system will iterate through that array, allowing the index to perform their turn one-by-one.
On with what I have.
In BattleManager I have this:
#--------------------------------------------------------------------------
# * New Method: get_battler_order
#--------------------------------------------------------------------------
def self.get_battler_order
action_battlers = []
all_battle_members = $game_party.members + $game_troop.members
all_battle_members.each do |battler|
action_battlers << battler
end
action_battlers.sort! {|x,y| y.agi <=> x.agi}
return action_battlers
end
As per the script above, I created an array that gathers ALL battlers present and then sorts them by their agility stat.
Next, in Scene_Battle I have:
#--------------------------------------------------------------------------
# * Overwrite: Battle Start
#--------------------------------------------------------------------------
def battle_start
BattleManager.battle_start
process_event
@battler_list = BattleManager.get_battler_order
get_next_action_battler
end
#--------------------------------------------------------------------------
# new method: get_next_action_battler
#--------------------------------------------------------------------------
def get_next_action_battler(index = 0)
if @battler_list[index].actor?
#PROCESS ALLY TURN
else
#PROCESS ENEMY TURN
end
end
I understand that eventually, after the turn has been processed, I will have to iterate through the array and continuously refer to that method to process each turn until the end of the array where it will go back to index 0.
But this is where I am stuck. There are so many methods and classes that I could choose from in the regular system, but I don't know where to start to process the battler's actions immediately, when to iterate through the array (increasing index) and when to recall that get_next_action_battler method again. I am not using anything in the database that increases attack times, etc. And I want to make it so that state removal conditions, for example, are processed at the beginning of a turn.
I'm just completely lost and I've been staring at my screen almost all day, haha.
If you need any more details, please feel free to reply.
I am not looking for anyone to make my script for me (although that would be awesome), I am simply looking for guidance.
Thanks so much!
I have not signed up for one of these forums in a while, so I will try my best to explain my situation:
I am currently writing my own custom script for a battle system similar to a "Free Turn". In this system, every battler acts immediately when their turn comes around to them.
Every battler in the field (both ALLIES and ENEMIES) are arranged in an array based on their agility stat, and the system will iterate through that array, allowing the index to perform their turn one-by-one.
On with what I have.
In BattleManager I have this:
#--------------------------------------------------------------------------
# * New Method: get_battler_order
#--------------------------------------------------------------------------
def self.get_battler_order
action_battlers = []
all_battle_members = $game_party.members + $game_troop.members
all_battle_members.each do |battler|
action_battlers << battler
end
action_battlers.sort! {|x,y| y.agi <=> x.agi}
return action_battlers
end
As per the script above, I created an array that gathers ALL battlers present and then sorts them by their agility stat.
Next, in Scene_Battle I have:
#--------------------------------------------------------------------------
# * Overwrite: Battle Start
#--------------------------------------------------------------------------
def battle_start
BattleManager.battle_start
process_event
@battler_list = BattleManager.get_battler_order
get_next_action_battler
end
#--------------------------------------------------------------------------
# new method: get_next_action_battler
#--------------------------------------------------------------------------
def get_next_action_battler(index = 0)
if @battler_list[index].actor?
#PROCESS ALLY TURN
else
#PROCESS ENEMY TURN
end
end
I understand that eventually, after the turn has been processed, I will have to iterate through the array and continuously refer to that method to process each turn until the end of the array where it will go back to index 0.
But this is where I am stuck. There are so many methods and classes that I could choose from in the regular system, but I don't know where to start to process the battler's actions immediately, when to iterate through the array (increasing index) and when to recall that get_next_action_battler method again. I am not using anything in the database that increases attack times, etc. And I want to make it so that state removal conditions, for example, are processed at the beginning of a turn.
I'm just completely lost and I've been staring at my screen almost all day, haha.
If you need any more details, please feel free to reply.
I am not looking for anyone to make my script for me (although that would be awesome), I am simply looking for guidance.
Thanks so much!

