cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
13
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,650
Reaction score
15,283
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,141
Reaction score
1,148
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
13
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,141
Reaction score
1,148
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
13
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,141
Reaction score
1,148
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
13
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,141
Reaction score
1,148
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
13
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,141
Reaction score
1,148
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
13
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

 …So I was looking at a question someone had asked and did some related experimentation. Apparently the Jump… movement route command works like the ultimate through. Including letting you move around outside the confines of the map entirely. o_O
Jump.png
Okay so today I heard the dumbest theory I have heard in a loooooooong while. It's so stupid I just have to share... Appearantly I have learned to draw 'hot chicks' so that 'real men' get physically excited by looking at it and I can then swoop in and 'turn' them.... Wow... Just... Amazing how some brains works...
What the writer wrote: "The curtain is blue."
The readers: "There must be a hidden meaning behind this, perhaps to convey the character emotions ...".
What the writer has in mind: "The curtain is frickin' blue".
Time to share something!
hmZFwQe.png

I made these a while ago for my game. I took reference from various huts in Africa.
Have a great night! :D
I really need to buy a new mouse. Mine's keeps double-clicking and makes me waste A LOT of time eventing

Forum statistics

Threads
115,844
Messages
1,093,365
Members
151,038
Latest member
ClaudeSpeeds
Top