- Joined
- Feb 4, 2018
- Messages
- 52
- Reaction score
- 6
- First Language
- English
- Primarily Uses
- RMMV
Hi, sorry if this is the wrong place for this:
I'm using Himeworks Enemy Reinforcement at the moment to try and create a battle system where players fight enemy troops that reinforce as the enemies die. If one slime dies, for example, a skeleton or another slime or whatever will its place until all enemies are defeated. The way I'm trying to achieve this is by creating two troops- the original and the reinforcements- and using two variables:
[7]= Number of enemies alive in the main troop
[8]= Number of enemies alive in the reinforcing troop.
To determine the variables, I'm using these two bits of scripts, for the original and reinforcing troops respectively.
$game_variables[7] = $game_troop.alive_members.select{|mbr| mbr.id==2}.size
$game_variables[8] = $game_troop.alive_members.select{|mbr| mbr.id==2}.size
The line: $game_variables[7] = $game_troop.alive_members.select{|mbr| mbr.id==2}.size is followed by a conditional branch in the main troop's event page, which checks to see if the value of [7] is less than 4 (the max number I want the players fighting at once), AND if the number of troops in the reinforcements is greater than 0. If it IS less than four, and there ARE enemies in the reinforcement troop, then an enemy from the reinforcements is supposed to appear in the battle.
Right now, no reinforcements appear at all. I'm still new to this so if the answer is obvious forgive me, but any help would be appreciated. Thanks!
PS: I also have Himeworks Enemy Events and Enemy Event Reinforcements.
I'm using Himeworks Enemy Reinforcement at the moment to try and create a battle system where players fight enemy troops that reinforce as the enemies die. If one slime dies, for example, a skeleton or another slime or whatever will its place until all enemies are defeated. The way I'm trying to achieve this is by creating two troops- the original and the reinforcements- and using two variables:
[7]= Number of enemies alive in the main troop
[8]= Number of enemies alive in the reinforcing troop.
To determine the variables, I'm using these two bits of scripts, for the original and reinforcing troops respectively.
$game_variables[7] = $game_troop.alive_members.select{|mbr| mbr.id==2}.size
$game_variables[8] = $game_troop.alive_members.select{|mbr| mbr.id==2}.size
The line: $game_variables[7] = $game_troop.alive_members.select{|mbr| mbr.id==2}.size is followed by a conditional branch in the main troop's event page, which checks to see if the value of [7] is less than 4 (the max number I want the players fighting at once), AND if the number of troops in the reinforcements is greater than 0. If it IS less than four, and there ARE enemies in the reinforcement troop, then an enemy from the reinforcements is supposed to appear in the battle.
Right now, no reinforcements appear at all. I'm still new to this so if the answer is obvious forgive me, but any help would be appreciated. Thanks!
PS: I also have Himeworks Enemy Events and Enemy Event Reinforcements.
