Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Enemy Action Sets
Enemy Action Sets
Version: 1.2


The malevolent lich that you faced just placed a shell of healing upon one of its zombie minions after you sliced through its chest. But now that it is fully healed, the lich cast a spell and the same zombie who was healed is now bathed in the same arcane energies of restoration. Shouldn't the enemies you encounter pay attention to such details? One would think so.

Enemy Action Sets is a system that allows you, the game designer, to give an enemy a completely new and more specific set of combat routines to perform whilst engaged in battle.

So now that evil lich need not waste a healing spell on a minion until absolutely needed, or give an orc the insight to see that one of your heroes is close to death so it can bring forth its mighty mace to finish him off.

Much more is available, and now monsters are not as random as before.

  • Enemy can now target those with lowest or Highest HP
  • Able to use skills on targets with or without already existing status effects
  • Can now target specific actors by thier ID
  • An edit of RPG Advocate's Pointless Actions Fix
  • A built in error checker

Clck here to enjoy
Box.Com link.

There's too much to be posted here. The demo includes the instructions. But be mindful that there is a lot of features to control and options you may be able to craft.


This script actively rewrites the make_action method from Game_Enemy, and rewrites the exclude_pointless_actions method from the classic '05 script by RPG Advocat at his now-gone Phylomortis.Com website.

Other than that, it should be quite compatible with most traditional styled battlesystems.

Credits and Thanks

Obviously RPG Advocate for the basis of the Exclude Pointless Actions fix. And to Melana for discovery of the 'User/Caster' bug.

Terms and Conditions

Free for use, even within commercial games. However, due credit to both RPG Advocate and myself are required.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]

Reply }
in 2021 it's good to see a new RMXP demo with the old ghost battler ^,^

after choosing to attack, an error message occurred...

line 361: Name Error - uninitialized constant Game_Enemy::AutomatedActors

hope that helps!
Reply }
Yep I got the same error when I tried to cast a fireball.

Beside that this script sound really powerful and amazing.
I'm doing similar stuff with tons of event pages and ingame variables but this might be alot better.^^
Reply }
EEP!  Shocked I still had that AutomatedActors in there?  Any instance of AutomatedActors needs to be replaced EnemyActionSets.

But if you want it PURE....

To version 1.1

Now you should have absolutely no problem with this.  The incidents were in two methods related to targeting and crisis HP systems.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]

Reply }
There might be an configuration error in your given example from the script instructions.

When I copy the header from the configuration site above the EXAMPLE pattern it doesn't really fit.

#                  Rate Prio Trig Type Skil Targ Stat
#                  ==== ==== ==== ==== ==== ==== ====
#  MY_EXAMPLE = [ [   5,   0,   0, nil,   0     ],    # Random melee attack
#                 [   3,   0,   1, nil,   0     ],    # Basic Defend
#                 [   3,   0,   2,  33,   4,  3 ],    # Venom on no-state Actor
#                 [   1,   1,   1,   1,   1     ] ]   # Priority Heal on Enemy

It seems the trigger ID is missing so it should look like this:

#                   Rate Prio Trig Type Skil Targ Stat
  #                 ==== ==== ==== ==== ==== ==== ====
    MY_EXAMPLE = [ [   5,   0,   1,   0, nil,   0     ],    # Random melee attack
                   [   3,   0,   1,   1, nil,   0     ],    # Basic Defend
                   [   3,   0,   1,   2,  33,   4,  3 ],    # Venom on no-state Actor
                   [   1,   1,   1,   1,   1,   1     ] ]   # Priority Heal on Enemy

Please correct me If I'm wrong here^^
Reply }
BRAVO!!!!! Very cheery You CAUGHT ON!!!

You fully read the instructions and noticed the minor error within the instruction's example. You saw that the Trigger is set to '0', a value that always brings up that there is a Trigger Error warning display. And you noted that the action type needs to be from 0-4, and not nil.

Your analysis is perfect. Blushing + Cheery
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]

Reply }
Yes I'm reading all of it^^
I'm actually starting to use this system now so I try to understand all of it's features.

It seems there are still a few bugs:

Right now I'm trying to make an enemy which gives itself a buff, but only when the buff state expired.
So the configuration line looks like this.

 #                          Rate Prio Trig Type  Skil Targ Stat
 #                          ==== ==== ==== ====  ==== ==== ====
   GRAWLOK_PHASE_2 = [[       10,   0,   1,   2, 1493,   4, 161  ],  # Casting Buff   

The first thing I noticed is when I set the scope of the skill to "The User" the games crashes with this message:

[Image: rtwuYek.png]

When I set it to "One Ally" it works, but the enemy should only buff himself, not his minions.

The second thing is the fourth target option where the skill should only be used on targets without a specific state.
My enemy is always using his buffskill even when everyone is already buffed.
You can easily test that issue in the demo. The Basilisk will still use the Venom skill even when all actors are already poisened with it.
Reply }
To version 1.2


Alas, Melana found a bug indeed.  The system that acquires the target by Status Effects recognized three specific scopes:  One Enemy, One Ally and One Ally (0HP).  It did not account for any others. So when the scope of a skill was set to the User/Caster, it drew no target which caused the issue in question. 

This has been fixed, now adding a feature to retrieve the user itself as a target if so defined.  But I went further and made the routine exit if the invalid scopes for All Allies and All Enemies were set.  The system that acquires the actual target is meant to return merely one and not a variety... thus said scopes would be invalid.  It is a preventative measure.

Now, as to the selection of an action...

Actions are selected based upon the 'Rating' of the action, and optionally given a boost by its 'Priority' if the action is based on the target's HP score.  If a spell is meant to poison the caster's enemies, the spell is cast as often as the rating dictates.  And if the spell is set by this system to target those that have not yet been poisoned, it will exclude those targets when it attempts to perform the skill.

However, the actions are 'nudged' towards the desired goal.  Rather than preventing other from being performed, actions that have a higher priority merely have a greater chance of being executed.  And while an action may with to target specific individuals based on their hit point or status effect state, the action has already been chosen prior towards the target-selection upgrade.

Before the system performs this 'nudge', the action is already chosen, it is defined and default targets are set.  This is to allow enemies not covered by the system to be able to perform.  So an action for an enemy like a Poisonous Snake to bite and transmit 'Venom' to a target will already be set before the system takes hold.

If the system nudges the snake to bite targets that have not been poisoned, the snake will go after any other target.  But one way or another, it is performing this Venomous Bite as often as its Rating so dictates.   And if it has already bitten everyone, it falls back upon the default target it selected prior.

The only thing I can think of doing is to upgrade the Priorities option which currently covers:
    0 = No Priorities
    1 = Party Crisis
    2 = Troop Crisis

Perhaps setting a '3' and '4' priority (Party/Troop State Crisis) could come into play.  Very annoying a feature to be sure ... from a coder's point of view.  Just as it reads each attack pattern line and checks if an actor/enemy has low HP, it would have to run a separate check to see if an actor/enemy is subject to a change in state.  And if said target was subject, then its rating would be increased as it would be for the other priority ratings.

This would not eliminate the Snake from biting a target already poisoned, but it would allow better control.

But this is a theoretical idea right now.

ow you should have absolutely no problem with this.  The incidents were in two methods related to targeting and crisis HP systems.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]

Reply }
Okay, that makes sense.
I thought the enemy is supposed to ignore the whole command if all targets already received the specific state.
Thank you for clarifying this.

I already made this buffing mechanic via battle-event so it's all fine now.
Reply }
I don't know if this is intended but in line 319 of the engine script the command to prevent the enemy from doing nothing, for example when he is out of mana, is commented-out.

#      next  if exclude_pointless_actions?(action)
Reply }

Possibly Related Threads…
Thread Author Replies Views Last Post
   DoubleX RMMV Action Input Timer DoubleX 0 1,555 09-06-2020, 06:32 AM
Last Post: DoubleX
   DoubleX RMMV Action Cost Compatibility DoubleX 5 6,938 05-20-2020, 04:39 AM
Last Post: DoubleX
   DoubleX RMMV Action Cost DoubleX 6 7,844 05-20-2020, 04:33 AM
Last Post: DoubleX
   Enemy Challenge for Experience DerVVulfman 0 1,935 11-25-2019, 12:30 AM
Last Post: DerVVulfman
   Leveled Enemy Lists DerVVulfman 0 2,014 09-13-2019, 04:06 AM
Last Post: DerVVulfman
   DoubleX RMMV Action Times DoubleX 2 4,016 01-29-2016, 01:23 AM
Last Post: DoubleX
   Enemy Melee Status Attacks DerVVulfman 3 6,203 10-15-2015, 07:22 PM
Last Post: Steel Beast 6Beets
   DerVV's Quickie Enemy Info Chance DerVVulfman 0 3,938 06-28-2015, 11:48 PM
Last Post: DerVVulfman
   [XP][XAS] XAS Enemy Kill Counter Narzew 0 3,688 03-28-2015, 05:44 PM
Last Post: Narzew
   Lycan Enemy Bars / MGC Mode7 Edit Patch DerVVulfman 0 4,335 06-12-2014, 04:05 AM
Last Post: DerVVulfman

Users browsing this thread: