07-02-2014, 04:52 AM
The enemy troop is a whole group of enemies, be it 1 or 8. Are you looking for a way to make a switch be turned on if player ID 17 is attacked by any enemy from Troop #1 ?
Sorta like?
This code is clearly conjecture, but is this what you're striving for? You cannot just make it in the script call of the Troops section. More likely, you'd need to add this into the Game_Battler class as well as a simple addition to the Scene_Battle system.
Sorta like?
Code:
if $game_troop.id == 1 #There's no such ID right now.
for enemy in $game_troop.enemies
target = enemy.target
if target.is_a?(Game_Actor)
$game_switches[4] = true if target.id == 17
end
end
end
This code is clearly conjecture, but is this what you're striving for? You cannot just make it in the script call of the Troops section. More likely, you'd need to add this into the Game_Battler class as well as a simple addition to the Scene_Battle system.