- Joined
- Jan 5, 2016
- Messages
- 149
- Reaction score
- 88
- First Language
- English
- Primarily Uses
- RMVXA
I've been trying to figure this out for the better part of the last two hours, so I'm throwing in the towel and coming here.
Basically, I'm trying to write a snippet where an actor becomes affected by x state while an enemy is present. The first part of placing the conditional eval is easy since I'm just using Victor's Conditional States script which allows for evals at certain intervals to check whether a state should be applied or not.
The difficult part is that I can't seem to figure out how to search Game_Troop.members for specific enemy ids. In the setup method:
...It's pretty clear that each value is stored inside an array, @enemies, where each array within the array contains two values, the enemy index and the enemy id. I just don't know how to access the second one though (the index is irrelevant). It would be awesome to get an answer to my title question, but it would also be great to let me know how to access specific variables in an array like this one. Thanks!
Basically, I'm trying to write a snippet where an actor becomes affected by x state while an enemy is present. The first part of placing the conditional eval is easy since I'm just using Victor's Conditional States script which allows for evals at certain intervals to check whether a state should be applied or not.
The difficult part is that I can't seem to figure out how to search Game_Troop.members for specific enemy ids. In the setup method:
Code:
def setup(troop_id)
clear
@troop_id = troop_id
@enemies = []
troop.members.each do |member|
next unless $data_enemies[member.enemy_id]
enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
enemy.hide if member.hidden
enemy.screen_x = member.x
enemy.screen_y = member.y
@enemies.push(enemy)
end
init_screen_tone
make_unique_names
end
