Force an attack when an enemy reaches a certain number of HP

Status
Not open for further replies.

Poupouille

Veteran
Veteran
Joined
Mar 1, 2017
Messages
162
Reaction score
26
First Language
Russian, french
Primarily Uses
RMMV
:kaohi:Hello

For a fight scene, I have an enemy with an unusually low life points. However, he's particularity is that he will be able to regenerate his life.:kaoangry:

I would like to set this:
If the enemy reaches, let's say, 33% of his life or less, he will trigger an attack that will allow him to regain a part of his life.
But he can trigger his attack only 4 times. For that, I configured the following thing: the boss has 4 points of magic and this attack uses 1 point of magic each time.

I configured the attack in the enemy settings so that it is triggered below 33% of life.

But the problem is that the attack doesn't always trigger: when the enemy has less than 33% of life, he can also trigger another attack (and the player can easily kill the enemy:().

I also set the attack in the Troop part with the option "force an action". This time, the attack is triggered automatically when the enemy has less than 33% of life, but in an unlimited way and not only 4 times.:(


Also, when the boss will not be able to use this attack, I would like to make a funny little text, of the style: "oh no, I do not have my magic potion anymore".


Do you know how to solve this?:kaopride:
 

RetroExcellent

Cute Kiwi
Veteran
Joined
Nov 1, 2018
Messages
121
Reaction score
300
First Language
English
Primarily Uses
RMMV
Perhaps you could use the force action, and add to a variable, once the variable is above 3, it will no longer trigger. I am not at home so cannot test this, but in theory it should work soundly.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Either approach that you tried can work; you just need to handle a few more details.

For the standard "Behavior" approach, what you need to do is keep using that condition (0-33% HP), but make sure you give the move a much higher Priority than all others. I think it needs to be at least 3 above (4 will definitely work; I think 3 will too). Any move with a Priority that is less than 3 below the highest Priority (among all moves whose conditions are met) can sometimes be selected. So for example, give the Heal a Priority of 10, and give all the other moves a Priority of 6 or less.

For the "Force Action" approach, what you need to do is first check the enemy's MP. Do this by (in that same Troop event) choosing "Control Variables", pick a variable, then choose "Game Data" in that dialog box, find the enemy in the first list, and choose MP in the second list. Then, do a Conditional Branch for "If the variable is greater than 0", and place the Force Action inside that Conditional Branch. Do nothing if the variable is not greater than 0.
 

Poupouille

Veteran
Veteran
Joined
Mar 1, 2017
Messages
162
Reaction score
26
First Language
Russian, french
Primarily Uses
RMMV
Hello guys

Perhaps you could use the force action, and add to a variable, once the variable is above 3, it will no longer trigger. I am not at home so cannot test this, but in theory it should work soundly.
I tried this, but it doesn't work. The attack is forced anyway.

For the standard "Behavior" approach, what you need to do is keep using that condition (0-33% HP), but make sure you give the move a much higher Priority than all others. I think it needs to be at least 3 above (4 will definitely work; I think 3 will too). Any move with a Priority that is less than 3 below the highest Priority (among all moves whose conditions are met) can sometimes be selected. So for example, give the Heal a Priority of 10, and give all the other moves a Priority of 6 or less.
It doesn't work too, because it gives the player time to kill the enemy before his turn. Actually, that would have been the simplest solution.

For the "Force Action" approach, what you need to do is first check the enemy's MP. Do this by (in that same Troop event) choosing "Control Variables", pick a variable, then choose "Game Data" in that dialog box, find the enemy in the first list, and choose MP in the second list. Then, do a Conditional Branch for "If the variable is greater than 0", and place the Force Action inside that Conditional Branch. Do nothing if the variable is not greater than 0.
I do as you tell, but it works only 1 time. I don't understand why.
Can you tell me if my settings are good?


 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
260
Reaction score
214
First Language
Swedish
Primarily Uses
Try setting the span to Turn. Battle only activates once per battle.
 

Poupouille

Veteran
Veteran
Joined
Mar 1, 2017
Messages
162
Reaction score
26
First Language
Russian, french
Primarily Uses
RMMV
Hello Weremole!

Try setting the span to Turn. Battle only activates once per battle.
It's work! :) but now how can I put a text "Oh, I have no more magic soup!", that the enemy will say once for the next turn (when his HP will be below 33%), and no more after?

I tried several possibilities, but either the text is repeated every turn, or it is not played. :(
 

Titanhex

Do-It-All
Veteran
Joined
Jan 3, 2013
Messages
577
Reaction score
216
First Language
English
Primarily Uses
N/A
Could you possibly send me the project or data so I can take a look at what you've done so far and what exactly you're trying to do?

It's smart to make a variable that counts how many times its been used. I think you can also do a switch to check if he's said his phrase yet. If he hasn't just turn the switch on and make him say it.
 

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
If that is not working you can use Yanfly A.I Core and for more details you can watch his tutorial video on it
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top