Making a skill cost MaxHP through HP Consume Plugin

SamBargeron

TV Moon Horse
Veteran
Joined
Nov 5, 2012
Messages
39
Reaction score
13
First Language
English
I'm using RPG Maker MV and the HPConsumeSkill plugin by Sasuke KANNAZUKI.

I'm wanting to develop a skill which sacrifices the player's hp in order to perform a super powerful attack, such as "Self Destruct" from the Pokemon games.

The HP Consume plugin uses the following in a skill's notes.

<hp_cost: x>

Is there a way to make x equal either the character's max hp or current hp?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Why not make the skill say no cost in the editor, and in the damage formula use:

a.add_state(1); (insert your damage formula here)

That way it KO's the user, by adding the KO state. Same effect.

Also, if you want to prevent someone from using the skill say when they have say 1 HP, you could set a skill cost via the plug in to whatever your minimum cost is.
 

SamBargeron

TV Moon Horse
Veteran
Joined
Nov 5, 2012
Messages
39
Reaction score
13
First Language
English
I entered the following into the skill's damage field:

a.add_state(1); (a.mhp)

The actor did not die and the skill did zero damage.

Concerned that I misunderstood your post I entered the following:

a.add_state(1); a.mhp

The actor did not die and the skill did zero damage.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
First thing, a is the actor or user, so right now the formula would be doing damage to the actor (or user) of the skill only, which is probably not what you intended, and it would be a pretty useless skill. You probably meant b.mhp (a is user, b is target, so a.mhp just tells the actor to KO themselves and nothing more).

As for why zero though, no idea, as it should be doing damage with what you posted, unless you changed state 1. Check the thread how to make the most of custom formulas (I can't copy/paste on this comp, so all I can do is refer you to the thread), it will tell you more on how to add a state in the damage formula, but its probably something like a : is off or something. It's under an ACE thread, but the idea will be the same.

Edit: Try a.addState(1) instead. It looks like MV changed the command to remove the _. If that fails change it to b.addState(1), as someone on another thread said they had to use b for some odd reason? If both fail, Shaz started a thread for damage formula help in MV, someone might be able to figure out what went wrong.

As for the OP about the plug-in, I don't think that was ever set up to be done that way. Yanfly used to have an option to set up a suicide skill (a skill that removed all HP when used), but that is for ACE. Maybe he'll convert over his script to put it in MV soon?
 
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
add_state is the ruby code and does not work in MV which uses JS.

I'm not on my computer so cannot check but I think it's addState. However there is a pinned topic on damage formula in the main MV support forum. I suggest you have a quick look there to check what it should be.
 

SamBargeron

TV Moon Horse
Veteran
Joined
Nov 5, 2012
Messages
39
Reaction score
13
First Language
English
I tried the following in damage calculation:

a.addState(1); (a.mhp)

The result was that the enemy was dealt damage equal to the actor's MaxHP, and then knockout state was inflicted upon the actor once the skill was completed.

Thank you guys! I'll check out that pinned topic too. It sounds like a good one. ^_^
 

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

Latest Threads

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,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top