cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
15
Reaction score
1
First Language
english
Primarily Uses
i was wondering if there is a way to make a skill cost the health of the other unit in the party?
for example
hero uses spell
mage loses hp due to cast
i also would like this to not kill the 2nd unit

note in my project the most characters that would be in the party is 2
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,721
Reaction score
15,304
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.

 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,250
Reaction score
1,209
First Language
English
Primarily Uses
RMMV
i was wondering if there is a way to make a skill cost the health of the other unit in the party?
Yes, you can use Yanfly's Skill Core.
i also would like this to not kill the 2nd unit
What does this mean? Does the HP cost change based on how many HP the mage has? Is the cost static but you can't cast the skill if it would kill the mage? Something else?
 

cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
15
Reaction score
1
First Language
english
Primarily Uses
Yes, you can use Yanfly's Skill Core.

What does this mean? Does the HP cost change based on how many HP the mage has? Is the cost static but you can't cast the skill if it would kill the mage? Something else?
i mean, if possible, to leave the other unit at 1 hp
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,250
Reaction score
1,209
First Language
English
Primarily Uses
RMMV
i mean, if possible, to leave the other unit at 1 hp
...that's still rather imprecise. Again, does the skill have a set cost, but paying that cost can't take the mage below 1? Does it always use all of his HP except 1? Can the skill be used when he has only 1 and he doesn't pay anything then?

We're doing code and math, you need to explain exactly what should happen :wink:
 

cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
15
Reaction score
1
First Language
english
Primarily Uses
...that's still rather imprecise. Again, does the skill have a set cost, but paying that cost can't take the mage below 1? Does it always use all of his HP except 1? Can the skill be used when he has only 1 and he doesn't pay anything then?

We're doing code and math, you need to explain exactly what should happen :wink:
ok


unit a using skill that cost 50 hp
unit b has 50 hp
after using skill unit b now has 1 hp
unit a can not use skill again unless unit b has 50 hp

unit a using skill that cost 25 hp
unit b has 50 hp
after using skill unit b now has 25 hp
unit a can cast skill again as unit b has 258 hp

this is what i mean thank you
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,250
Reaction score
1,209
First Language
English
Primarily Uses
RMMV
I wasn't sure from your posts whether you always have the same two actors in your party, nor whether only one of them can cast this. So this code is a little bit more complicated in order to be able to accommodate whatever combinations.

Install Yanfly's Skill Core.

In the note tag for the skill, put:
Code:
<Custom Cost Display>
50 Ally HP
</Custom Cost Display>

Change the wording to whatever you like, change the number to whatever you like so long as it matches all the other places below.

Code:
<Custom Requirement>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
value=ally.hp>=50;
</Custom Requirement>

<After Eval>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
ally.gainHp(0-Math.min(50, ally.hp-1));
</After Eval>

That should do it. I have not tested this, let me know if you have any problems.
 
Last edited:

cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
15
Reaction score
1
First Language
english
Primarily Uses
I wasn't sure from your posts whether you always have the same two actors in your party, nor whether only one of them can cast this. So this code is a little bit more complicated in order to be able to accommodate whatever combinations.

Install Yanfly's Skill Core.

In the note tag for the skill, put:
Code:
<Custom Cost Display>
50 Ally HP
</Custom Cost Display>

Change the wording to whatever you like, change the number to whatever you like so long as it matches all the other places below.

Code:
<Custom Requirement>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
value=ally.hp>=50;
</Custom Requirement>

<After Eval>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
ally.gainHp(0-Math.min(50, ally.hp-1));
</After Eval>

That should do it. I have not tested this, let me know if you have any problems.
ok thank you very much it mostly works.
it seems to calculate the hp cost per enemy hit by the skill, thus a 50 cost skill that hits 2 foes ends up costing 100.
but if this is to hard to fix i can just implement it as a 'cost effectiveness' mechanic since it seems interesting anyway
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,250
Reaction score
1,209
First Language
English
Primarily Uses
RMMV
it seems to calculate the hp cost per enemy hit by the skill, thus a 50 cost skill that hits 2 foes ends up costing 100.
Ah, you didn't say it was a skill with multiple hits. So there's a thing to try...I'm not positive how it works with multi-hit skills. If this doesn't work, then you wouldn't be able to do it without installing the Action Sequences plugins and programming the entire skill out.

Add:
Code:
<Before Eval>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
ally.hpDrained=false;
</Before Eval>

Then change the after to this:
Code:
<After Eval>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
if (!ally.hpDrained)
{
    ally.gainHp(0-Math.min(50, ally.hp-1));
    ally.hpDrained=true;
}
</After Eval>
 

cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
15
Reaction score
1
First Language
english
Primarily Uses
Ah, you didn't say it was a skill with multiple hits. So there's a thing to try...I'm not positive how it works with multi-hit skills. If this doesn't work, then you wouldn't be able to do it without installing the Action Sequences plugins and programming the entire skill out.

Add:
Code:
<Before Eval>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
ally.hpDrained=false;
</Before Eval>

Then change the after to this:
Code:
<After Eval>
var ally=$gameParty.leader()==user ? $gameParty.members()[1] : $gameParty.leader();
if (!ally.hpDrained)
{
    ally.gainHp(0-Math.min(50, ally.hp-1));
    ally.hpDrained=true;
}
</After Eval>
this instead makes the skill have a one time cost and from then on it never costs anything. my guess it's because the ally.hpDrained is stuck as true afterwords.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,250
Reaction score
1,209
First Language
English
Primarily Uses
RMMV
That is very weird. My uncertainty was whether the Before Eval would activate before each hit of the skill, and so make the whole thing useless...but I have no idea why it wouldn't work each time the skill was used.

Regardless, looks like you're either using the first version with the HP cost per hit, or reprogramming it through Action Sequences. If you stick with the first one, I'd recommend an appropriate change to the wording in the cost.
 

cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
15
Reaction score
1
First Language
english
Primarily Uses
That is very weird. My uncertainty was whether the Before Eval would activate before each hit of the skill, and so make the whole thing useless...but I have no idea why it wouldn't work each time the skill was used.

Regardless, looks like you're either using the first version with the HP cost per hit, or reprogramming it through Action Sequences. If you stick with the first one, I'd recommend an appropriate change to the wording in the cost.
yeah for now ill stick with the first one it makes an interesting system of cost vs speed.
 

Latest Threads

Latest Posts

Latest Profile Posts

thought I'd upgrade to mz from mv cause of the nice quality of life features but ****ing hell why couldn't they allow old plugins to work in it and secondly how come in over a year since it's release has there been no mz version of something so crucial as a non grid based movement plugin. I guess I'll stick with mv. (why wasnt mz just an update to mv anyway literally nothing substantial changed..)
Something might be coming...
Hallo.png
A new day for creating :)
2021 has been the runner-up for the worst year of my life. 2015 may take that title, but '21 is pushing it. Excuses really don't justify how much of a jerk I've been this year to a lot of people.

I'm sorry. I don't intend to be a jerk forever, but I'd rather back up my intent with actions, not words.

Forum statistics

Threads
116,020
Messages
1,094,982
Members
151,337
Latest member
Laura1999
Top