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,720
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,232
Reaction score
1,199
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,232
Reaction score
1,199
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,232
Reaction score
1,199
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,232
Reaction score
1,199
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,232
Reaction score
1,199
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 Profile Posts

I was listening to songs by Chuck E Cheese's voice actor (Jaret Reddick from Bowling for Soup) when the meds I was taking for my stomach virus apparently stopped working. I can't take my next dose until morning, but it's no use anyway. I'm officially sick again. Of course, I'll definitely take the next dose either way, but it's useless now.
New profile picture! This time, it's representative of my current project.
I suddenly feel like making a game for little kids: a pointless sandbox of cute animals, silly collectibles, and random mini games.
Anyone else just like, not bother to make games themed around specific holidays? I know I won't get them done in time for it to make sense.
time to enter the playtest dimension

Forum statistics

Threads
115,992
Messages
1,094,703
Members
151,286
Latest member
Heretoga
Top