opaattack

Villager
Member
Joined
Mar 18, 2021
Messages
13
Reaction score
2
First Language
English
Primarily Uses
RMVXA
I'm trying to make an enemy that heals his ally whenever she takes damage. However, just giving the enemy access to healing spells seems to result in him only healing himself. I've been looking for a solution for a while, and, while this seems to be a common problem, I haven't found a solution that works. Can anyone help?
 

TheTitan99

Veteran
Veteran
Joined
Nov 2, 2015
Messages
247
Reaction score
136
First Language
English
Primarily Uses
RMMV

This is my go-to VX Ace enemy AI script. Instructions are in the main post on how to use it, but the script can have enemies target their skills much, much smarter. You can have enemies use skills on targets with low hp, only use skills on targets that have certain states, or whatever. It's a geat script, I used it a lot before moving to MV, and can vouch that it works perfectly.
 

RCXGaming

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
602
Reaction score
1,332
First Language
English
Primarily Uses
RMVXA

This is my go-to VX Ace enemy AI script. Instructions are in the main post on how to use it, but the script can have enemies target their skills much, much smarter. You can have enemies use skills on targets with low hp, only use skills on targets that have certain states, or whatever. It's a geat script, I used it a lot before moving to MV, and can vouch that it works perfectly.

Yo, where was this script my entire life? I've needed smarter AI control for the longest time.

I came here to answer OP's question the best of my ability, funnily enough.
 

opaattack

Villager
Member
Joined
Mar 18, 2021
Messages
13
Reaction score
2
First Language
English
Primarily Uses
RMVXA

This is my go-to VX Ace enemy AI script. Instructions are in the main post on how to use it, but the script can have enemies target their skills much, much smarter. You can have enemies use skills on targets with low hp, only use skills on targets that have certain states, or whatever. It's a geat script, I used it a lot before moving to MV, and can vouch that it works perfectly.
Thank you very much for the suggestion! However, I can't seem to get it to work.
My attempt is pictured below. Did I misunderstand something?
ehealwhy.PNG
 

TheTitan99

Veteran
Veteran
Joined
Nov 2, 2015
Messages
247
Reaction score
136
First Language
English
Primarily Uses
RMMV
It's been several years since I last used this script, so I'm not the best at troubleshooting it.

I'd start by making sure it's not an issue with other scripts. I usually troubleshoot in new projects where only the script I am troubleshooting is added, and everything else is default. After getting it to work in the blank project, then I add it back to the main project.

With this script, I've always used the evaluations, 'cause I like to get AIs precisely what I want. So, something like this:

<target eval 5>
if b.hp == b.mhp
-1
else
1
end
</target eval>

This would only target enemies not at max HP.

I apologize that I may not be able to help much more. I use MV nowadays, and don't have access to my old VX Ace projects, so I can't copy and paste the code.
 

opaattack

Villager
Member
Joined
Mar 18, 2021
Messages
13
Reaction score
2
First Language
English
Primarily Uses
RMVXA
It's been several years since I last used this script, so I'm not the best at troubleshooting it.

I'd start by making sure it's not an issue with other scripts. I usually troubleshoot in new projects where only the script I am troubleshooting is added, and everything else is default. After getting it to work in the blank project, then I add it back to the main project.

With this script, I've always used the evaluations, 'cause I like to get AIs precisely what I want. So, something like this:

<target eval 5>
if b.hp == b.mhp
-1
else
1
end
</target eval>

This would only target enemies not at max HP.

I apologize that I may not be able to help much more. I use MV nowadays, and don't have access to my old VX Ace projects, so I can't copy and paste the code.
Thanks for trying to help! Using your code did actually seem to force the healer to heal, sadly he still only heals himself.
 

TheTitan99

Veteran
Veteran
Joined
Nov 2, 2015
Messages
247
Reaction score
136
First Language
English
Primarily Uses
RMMV
Hmm, what about adding an underscore, so it is now <target_eval 5> and </target_eval>? Times like this I really wish I still had access to the game that I had this script to work in, because I remember taking some time to get it to work, but it does work, I can guarantee it. My first boss was a healer who only healed creatures below max HP.

Also, this is only a targeting script, it has nothing to do with when they use the skill.
 

opaattack

Villager
Member
Joined
Mar 18, 2021
Messages
13
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Hmm, what about adding an underscore, so it is now <target_eval 5> and </target_eval>? Times like this I really wish I still had access to the game that I had this script to work in, because I remember taking some time to get it to work, but it does work, I can guarantee it. My first boss was a healer who only healed creatures below max HP.

Also, this is only a targeting script, it has nothing to do with when they use the skill.
Ah, thanks again for trying to help, sadly this still does not work.
 

rpgLord69

Veteran
Veteran
Joined
Oct 23, 2021
Messages
276
Reaction score
238
First Language
Finnish
Primarily Uses
RMMZ
Hmmm, can't you set up a troop event in the database, that triggers when enemy1 HP is below max, and then make a 'force action' event command to force your enemy2 to cast a heal spell on enemy1?
 

Latest Threads

Latest Posts

Latest Profile Posts

Hello! Can anyone help me? I followed making cooking tutorial for RPG Maker MV. But for some reason buff state that food gives doesn't work in overworld. It disappears. What am I supposed to do?
A shotgun is not a rifle. Huh.
SIGH its so hard to convince my friend that making a game for fun and making one to sell takes different planning. I don't care about weird bothersome ways of doing things in a game made for fun, but when you are planning to market it, there is some stuff that you just have to streamline or cut out.
It might be a little bit boring and tedious, but building that database of armor, items, weapons and skills are super important.

Forum statistics

Threads
124,399
Messages
1,163,336
Members
163,194
Latest member
SSSR
Top