scripting to decide behavior of enemies based on levels of party members

gsuk

Veteran
Veteran
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. :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top