- Joined
- Jun 24, 2013
- Messages
- 140
- Reaction score
- 10
- First Language
- English
- Primarily Uses
- RMVXA
I'm using a script which makes enemies attack you if they are stronger than you (based on their level).
It works fine when there is only one party member, but let's say you are level 10 and you recruit someone who is level 3. There are enemies that will not attack you if you are alone (because you are level 10 and they are, say, level 7), but I want to make it so they will attack my companion if they are weak.
In the script, @epassive = false if @enemy.enemy_id == 14 && $game_party.leader.level < 8 means that any enemy with ID 14 will attack you if you are lower than level 8. This works fine.
I added this line to the script: @epassive = false if @enemy.enemy_id == 14 && $game_party.members[1].level < 8 so that if my companion is lower than level 8 then the enemy attacks. This also works fine but only when I have a companion. If I venture out alone I get a NoMethodError message, presumably because the party member doesn't exist.
Is there an easy solution to this so that the enemy will attack only if one or more party members are below the specified level?
This is part of the Falcao ABS script, to which I added Hime's enemy levels script, which allows you to assign enemy levels to events on the map. Falcoa's ABS supports followers and therefore should allow enemies to aggro them if they are too weak, but I don't know enough about scripting to do this. Hopefully there's a simple thing I can do with the above commands to make this work.
Thanks for any help.
It works fine when there is only one party member, but let's say you are level 10 and you recruit someone who is level 3. There are enemies that will not attack you if you are alone (because you are level 10 and they are, say, level 7), but I want to make it so they will attack my companion if they are weak.
In the script, @epassive = false if @enemy.enemy_id == 14 && $game_party.leader.level < 8 means that any enemy with ID 14 will attack you if you are lower than level 8. This works fine.
I added this line to the script: @epassive = false if @enemy.enemy_id == 14 && $game_party.members[1].level < 8 so that if my companion is lower than level 8 then the enemy attacks. This also works fine but only when I have a companion. If I venture out alone I get a NoMethodError message, presumably because the party member doesn't exist.
Is there an easy solution to this so that the enemy will attack only if one or more party members are below the specified level?
This is part of the Falcao ABS script, to which I added Hime's enemy levels script, which allows you to assign enemy levels to events on the map. Falcoa's ABS supports followers and therefore should allow enemies to aggro them if they are too weak, but I don't know enough about scripting to do this. Hopefully there's a simple thing I can do with the above commands to make this work.
Thanks for any help.

