cubeking1

Villager
Member
Joined
Dec 19, 2013
Messages
17
Reaction score
3
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
44,133
Reaction score
15,532
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,779
Reaction score
1,628
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
17
Reaction score
3
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,779
Reaction score
1,628
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
17
Reaction score
3
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,779
Reaction score
1,628
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
17
Reaction score
3
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,779
Reaction score
1,628
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
17
Reaction score
3
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,779
Reaction score
1,628
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
17
Reaction score
3
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've been working on making a simple sprite frame system. And I'm really happy with the progress.
ZAyFw65.gif
Sketching on Milanote the new script of the system I plan to implement for VNMaker. This is making me learning Coffeescript through a crash-course I never thought I would ever take in my meager career as writer, but brings back fond memories when I was forced to learn RUBY for RPGMaker XP back in those years. Oh dear... :LZSooo:
For some reason, I found this is kinda stylist
ready to fall into another development hell...
Mega has been giving me a lot of problems as of late, so I think I'll need to switch to another cloud service. I'm considering Dropbox.

Forum statistics

Threads
117,132
Messages
1,104,825
Members
153,182
Latest member
Aburgonya
Top