Remove exact amount of enemy HP

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I have a piece of equipment which if a member of the active party has it equipped, removes enemy HP for the first 3 turns by inflicting a state on them with a negative HRG (same principle as e.g. poison).


However, as far as I can see both equipment and states only do this on a percentage basis.  I would like to be able to remove a precise number of hit points e.g. 50.


Is this possible?


Thanks.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
While tedious, you could use Troop Events to check whether any party member has the appropriate item equipped, and reduce enemy HP using the "Change Enemy HP" event command.  A "Base Troop Event" or "Common Troop Event" script (I think Hime has one for Ace) will relieve a lot of this tedium.  Alternately, this kind of behavior would not be all that hard to script.
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I'm using Yanfly's Base Troop Event to check if an actor in the battle party is equipped with this accessory.  What stumped me (and this is probably instantly overcome if only I could see how) was how to use the 'Change Enemy HP' for 3 turns.  The turn command doesn't seem to be set up that way.  That is why in the end I went for a state lasting 3 turns.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You could either use my Slip Damage Ex script or Yanfly's lunatic states so that your states can add/remove exact values


or if ur gonna use the troop events, well you can maybe set it to turn so that it runs once a turn then have a variable that counts how many turns it already is, once you get past 3 turns count, stop doing the Change Enemy HP command
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Engr. Adiktuzmiko I would prefer to use an eventing solution, rather than install another script just for this one thing.


However, I can't seem to get this working correctly.  It works fine the first turn.  HP is removed.  After that it stops.  I put in a test state and battle animation to make sure that the page was running, and they were present every turn, but no further HP was lost.  Here is how I did it.


One a page in Base Troop Event I set the variable to zero at the start of battle.


p1 equalizer damage.png


On a fresh page I put in the event.  A conditional branch checking that an actor in the battle party was equipped with the correct accessory. Then a nested conditional to check that the variable was equal to or less than 3.  (Actually, thinking about it that should be 2, but never mind for this.)  If it is, then change enemy HP.  Then add one to the variable.


This screen shot shows the event page with the testing state and animation.


p2 equalizer damage.png


Can you - or anyone else - see what I've done wrong in my setup?


Thanks.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Oh wait no... Turn means it only activates for one turn then it's deactivated if I remember right.. Try setting the span to battle so that it will trigger every time the condition is met though I'm not sure if that will limit the activation of that Turn conditioned page to once per turn
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
My understanding is that it is 'battle' which runs only once.  Turn should be every turn.  Here's a screenie of the tip.


event conditions.png
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
@Engr. Adiktuzmiko wrong


Span Battle: activates once per battle


Span Turn: activates once per turn


Span Moment: activates on every action where the condition is met.


@ksjp17 unfortunately I can't read your screenshots, they're too small even if I click on full size


The condition and span should be correct for executing every turn - which means there is a problem with the conditions that prevents it from executing after the first turn.


I suggest placing three show texts for testing to confirm where the problem is: one show text before the first condition (to see if the troop event is triggered), one show text between the conditions (to see if it is the first or second condition that fails) and the third show text below the second condition (to confirm wether or not the inner sequence is reached).
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Oh I see... haven't used troop events for a long time now. sorry
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Andar  Here is a larger version of the event commands.


p2 equalizer damage.png


I did as you suggested with text messages.  I put one above everything to test that the page was triggered.  One underneath the conditional checking the equipment, one underneath the conditional checking the value of the variable, one under the Change Enemy HP command and one under the add one to the variable.


All text messages showed for the right number of turns.  After that only the first two showed, showing that the variable count had reached a high enough number to prevent any further running of the change HP command.


However, HP was only removed on the first turn.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
maybe "change enemy HP" only reduces max hp or seomthing? How did you know HP was only removed on first turn anyway?
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Engr. Adiktuzmiko I'm using Yanfly's Enemy Info bars, so I can see the HP bar go down (blank shows) on the first turn, and then it stays there (because I'm guarding the whole time to ensure that the battle lasts long enough to check) without going down any more.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Can you try making a conditional such that if the counter is 2, it reduces HP by 100 instead of 50 and see if the bar goes down on the 2nd turn? If that works, then it means the command only works by reducing the value from the max hp... If it still don't work then it means the command is somehow bugged or something.


In case of 1), you can probably just use this snippet using a script call command instead

Code:
$game_troop.members.each {|mem| mem.hp -= 50}
 
Last edited by a moderator:
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Engr. Adiktuzmiko It must be that the command is only reducing MHP.


But the good news is that your script call works, and so I now have my solution.


Thank you very much for your time and trouble.


Closing as now solved.
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Thanks for re-opening, ksjp =)


Just wanted to clarify that Change Enemy HP does do what we all thought it does - reduce (or increase) an enemy's current HP (not max), as if they had taken damage or been healed.


I've used this command a lot of times for battle eventing (sometimes once per turn), and I've never seen any bugs where subsequent uses after the first would cause it to not work, which is what makes this topic so bizarre.  My best guess would be a possible visual bug with Yanfly's enemy HP bars, but I'm far from sure.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I don't think it's a visual bug.  I chose low HP enemies for the test, and did not check the box which would prevent death from this.  I kept on guarding so that the full 3 turns would happen.  With the original command the enemies were alive and well at the end, except for the 50 HP lost in the first turn.


Using the script call, the enemy HP bars went down each turn, and on the 3 turn (as predicted by their opening HP) they all died.
 

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,975
Members
137,563
Latest member
cexojow
Top