How To Control An NPC In Battle?

Hi again.

One of the characters in my game behaves randomly in battle.  He is supposed to cast a random spell each turn, but I can't find a way to limit his actions to magic using the "Auto Battle" Special Flag.  He sometimes uses his magic, but mostly just attacks physically.

Nor can I find where to edit the default stuff for all battles  (shying away from java script during my demo period - too much to learn in just a few weeks along with the game system itself).

Can I somehow do this without java script, or must I learn that in short order?

Any help would be most appreciated!

Having internet troubles today - hard to get the forum to load.  So if I don't reply promptly to any help, that's why 🙁
autobattle uses the regular battle-AI, which is rather simple and only concerns itself with battle dealt.


For that reason, most people switch to a script or plugin if they need better control.


However, you can try the following options (don't know if they're viable in your game:


1) reduce physical damage by reducing ATK or physical damage rate or something like that - if the values for the regular attack are low enough, other skills will be used.


2) give the actor only the magic skills for battle, keep all others as menu only (won't work for attack unless you replace that with a script)


3) block all regular skill use and make a troop event that will force-action the skills of the NPC.
Thanks for the thoughts!

I'll give them a try and post what works best.

I like reducing his atk to zero - that's the simplest, and the system may just fall for it.  I forgot about troop events.  That sounds like the best answer, but I'll let you know...
<snip>


internet failure resulted in this as a partial copy of my post above


please ignore
Having intermittent success :headshake:

Did you mention a plug-in that may help with this?  I looked, but not much luck.

The idea I'm trying for was done in a single script (with auto battle set) on another maker, so I hope I can do it here.

The full story, in case the details help:

The NPC is a is a Frenchman (his character was inspired by the Frenchmen in Monty Python and The Holy Grail and 10 year old stereotypes. I have nothing against the French! (Except for the fact that they are humans - In a world where a Cow is my main character, humans are not popular).

Frenchmen are reputed to be fierce in battle, but this one seems relatively useless. All he appearss to do is just yell random insults at the enemies in Battle.  At low levels he just yells insults in battles. Each insult has an animation it plays. There is no damage when he is at lower levels, but as the VFX slowly begin getting more complex, his insults begin to do damage.

He is meant to evolve from annoying to the most powerful character in the game.

Making this work correctly is pretty much a key feature of the game.  So you see why I am a bit persistent on this one.
 
Having intermittent success :headshake:

Did you mention a plug-in that may help with this?  I looked, but not much luck.

The idea I'm trying for was done in a single script (with auto battle set) on another maker, so I hope I can do it here.

The full story, in case the details help:

The NPC is a is a Frenchman (his character was inspired by the Frenchmen in Monty Python and The Holy Grail and 10 year old stereotypes. I have nothing against the French! (Except for the fact that they are humans - In a world where a Cow is my main character, humans are not popular).

Frenchmen are reputed to be fierce in battle, but this one seems relatively useless. All he appearss to do is just yell random insults at the enemies in Battle.  At low levels he just yells insults in battles. Each insult has an animation it plays. There is no damage when he is at lower levels, but as the VFX slowly begin getting more complex, his insults begin to do damage.

He is meant to evolve from annoying to the most powerful character in the game.

Making this work correctly is pretty much a key feature of the game.  So you see why I am a bit persistent on this one.
Perhaps Yanfly's Battle AI Core plugin could help here. It should make the AI much more advanced or at least give you the potential to make it so.
Perhaps Yanfly's Battle AI Core plugin could help here. It should make the AI much more advanced or at least give you the potential to make it so.
Thanks for the lead!

I'll look for it and update with results...

EDIT -

At first glance it looks like it does little for NPC's - but will have a second and third glance after I make my coffee!  Coffee is even a vital item in my game - just like in real life  😎

And -

<snip>

internet failure resulted in this as a partial copy of my post above

please ignore
Actually, it was very helpful!

It allowed me to bypass the time limit for double posting  🤣
Having internet troubles today - hard to get the forum to load.  So if I don't reply promptly to any help, that's why 🙁
Wasn't your internet, forum's host was attacked by a DDOS, not against RM but it affected.
Wasn't your internet, forum's host was attacked by a DDOS, not against RM but it affected.
Seems like it still is
Wasn't your internet, forum's host was attacked by a DDOS, not against RM but it affected.
Thanks for that.  I even mentioned connection problems in the first post of this thread, so it's good to know it wasn't just me.

And yes, it is persisting today, but not as badly.
Hi. I came to say I have this problem too. Here's my solution but not the perfect way. Please don't aspect much from this.

 

Since I have no idea about coding, I head to using plugin that can change normal attack to a skill when equip the specific weapon. Like "Weapon Skill" ( the one of Kadokawa plugin that can found in dlc folder ) or YEP_WeaponUnleash .

After you instralled the plugin, make a weapon that will use skill that call event ( try set the skill like the default Attack one, the name of skill and target, dmg, etc., or else It maybe not work ). Then make event that random varities and set 'force action' using skill to each condition branch of varities. This way the NPC will attack and use skill randomly but only using on the 1st target ( the enemy or ally that in to top of the list ). 

 

It don't work perfectly but at least it's something nearest the thing I want that I can make.

 

Hope this can help you get any idea.
Hi. I came to say I have this problem too. Here's my solution but not the perfect way. Please don't aspect much from this.

 

Since I have no idea about coding, I head to using plugin that can change normal attack to a skill when equip the specific weapon. Like "Weapon Skill" ( the one of Kadokawa plugin that can found in dlc folder ) or YEP_WeaponUnleash .After you instralled the plugin, make a weapon that will use skill that call event ( try set the skill like the default Attack one, the name of skill and target, dmg, etc., or else It maybe not work ). Then make event that random varities and set 'force action' using skill to each condition branch of varities. This way the NPC will attack and use skill randomly but only using on the 1st target ( the enemy or ally that in to top of the list ). 

 

It don't work perfectly but at least it's something nearest the thing I want that I can make.

 

Hope this can help you get any idea.
Thanks!

I'll give it a try.  It's my last day of vacation so starting tomorrow my time for this will be limited  🙁
The solution lies entirely in the TRAITS section of your Actor TAB: Add a NEW TRAIT, Go to Skill Tab, Seal Skill: Attack!

If this doesn't work, IMMEDIATELY SEEK MEDICAL ATTENTION.
The solution lies entirely in the TRAITS section of your Actor TAB: Add a NEW TRAIT, Go to Skill Tab, Seal Skill: Attack!

If this doesn't work, IMMEDIATELY SEEK MEDICAL ATTENTION.
Nope.

Too simple.

Too straight-forward.

Don't like it.

Don't you have a more complicated solution?

Actually - Thanks!  I tried that and was looking at skill type - which does not have Attack listed - and never tried the option right below it.  Me feel stupid now  :blush:   That looks like just what I was seeking 👍  
Oh. Is that work?

I've tried sealing Attack before and end up that NPC does nothing in the turn.

Maybe I should try again.
The solution lies entirely in the TRAITS section of your Actor TAB: Add a NEW TRAIT, Go to Skill Tab, Seal Skill: Attack!

If this doesn't work, IMMEDIATELY SEEK MEDICAL ATTENTION.

Oh. Is that work?

I've tried sealing Attack before and end up that NPC does nothing in the turn.

Maybe I should try again.

I NEED MEDICAL ATTENTION!

I jumped the gun marking this solved.  Apologies to all.

Sealing attack does, indeed, freeze the NPC in battle. 

But in a brand new file I got an npc character to only use magic with this technique.  About to experiment more.

It may actually be the order the traits are listed being more important - like making sure to seal attack at a specific point in the list  (before or after giving the skill).

I'll try a few variants in my current game and see if I can make happen in that what worked in a brand new file.  I may have to re-start this if I can only make it work in a new file.  Fortunately, copy/paste works with 2 instances of the software open!
Yeah you have to give them several attack options before you seal. If you Copy your data and paste it into the new project you will have to double check everything, but you shouldn't lose a whole bunch of work or time by copying your data & required files (custom sounds & graphics).
Yeah you have to give them several attack options before you seal. If you Copy your data and paste it into the new project you will have to double check everything, but you shouldn't lose a whole bunch of work or time by copying your data & required files (custom sounds & graphics).
Thanks for the further clarification.

I tried so many things that I am not sure what could be interfering at this point.  There were a lot of things trying to make this happen and I may have missed deleting one which is causing a conflict  🙁

I'll figure it out noe that I know it works!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-control-an-npc-in-battle.54148/