[Solved] Sacrifice Skill

Status
Not open for further replies.

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
I... am so very sorry for all these threads asking for help with skills... hehe...~

Anyway, this one I think is... rather simple, compared to the others. All I would like help with is to figure out how to make a skill where a character can sacrifice his life for a specific character. Otherwise, I would know perfectly well how to do this with the <HP Cost: 100%> detail.

Here is a screenshot to explain a little better:
upload_2018-10-18_0-8-45.png

As you can see, I tried to input my own sort of formula for this, but I have quite obviously failed, or I would not be asking for help.

Any help would be appreciated, thank you~!

~ Dragon
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
312
Reaction score
122
First Language
english
Primarily Uses
RMMV
damage type: Restore HP
formula: b.actorId() === 1 ? b.revive(); X; b.addBuff(3, 3); a.die() : 0
remove all effects and those note tags
also change scope to "1 dead ally"

this will revive target + heal X (use b.mhp for a full heal) + give target defence buff for 3 turns + kill the user
if the target is anyone but actor 1 it will do nothing

("share life" option, using a.hp in place of X to give target the HP the caster currently has. Because using this skill when caster is almost dead to full revive someone else doesn't make much sense vitality wise)
 
Last edited:

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
It sounds like it should work in theory, but I'm afraid that it doesn't.

I've tried about a dozen variations as well, and nothing has quite... worked...

~ Dragon
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
Update~!!

So, it doesn't completely work, but I played around with it and the sacrifice element works entirely. However...

It doesn't do what I wanted: which is to only revive and heal one specific party member and not any other party member.

Example: I tested this on Niko. It worked. I tested it on another dead party member, Jax, and it... also worked. Not what I wanted.

Skill Screenshot:
upload_2018-10-18_12-8-23.png

Here is what I have in the notebox:

<Pre-Damage Eval>
if (origin.isActor()){
if (origin.actorId() === 1)
origin.revive();
}
</Pre-Damage Eval>

<Post-Damage Eval>
a.die() = O
</Post-Damage Eval>

~ Dragon
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
Another Update:

Skill now only applies to Niko, however, it doesn't heal him before it kills Atlas.

Screenshot:
upload_2018-10-18_12-58-1.png

Notebox:

<Pre-Damage Eval>
if (target.isActor()){
if (target.actorId() === 1){
if (target.skills().contains($dataSkills[45])){
target.revive();
target.gainHP(a.hp);
}
}
}
</Pre-Damage Eval>

<Post-Damage Eval>
if (target.isActor()){
if (target.actorId() === 1){
if (target.skills().contains($dataSkills[45])){
a.die() = O
}
}
}
</Post-Damage Eval>

~ Dragon
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
You can make sure it only works on Miko by using this notetag:

<Custom Select Condition>
if (target.name() === 'Prince Miko') {
condition = true;
} else {
condition = false;
}
</Custom Select Condition>

This only allows Prince Miko to be selected for the skill. Requires Yanfly's Selection Control.

For the actual effect, the skill database has the ability to have the Effects tab remove the Knockout state (which revives the target; be sure to add a formula for the revival heal). If you don't want the amount of HP displayed on the skill, you can also use:

<After Eval>
a.gainHp(-a.hp)
</After Eval>
 
Last edited:

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
Unfortunately, Junane, that seems to make my game crash for some reason...
upload_2018-10-19_12-49-1.png

~ Dragon
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
Can you reproduce this and press F8 so a console loads up then screenshot it?
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
So I tried replicating what I did, but I couldn't remember, so I did what I thought I had done... but then tested it... and it works, somewhat.

Except that it still doesn't heal Niko for the amount of damage that Atlas has when casting the ability.

Notebox:

<Custom Select Condition>
if (target.name() === 'Niko') {
condition = true;
} else {
condition = false;
}
</Custom Select Condition>

<Pre-Damage Eval>
b.revive()
</Pre-Damage Eval>

<After Eval>
a.gainHp(-a.hp)
</After Eval>

Screenshot Skill:
upload_2018-10-19_14-24-28.png

Battle Shots (Atlas had 166 Health as Per the Test):
upload_2018-10-19_14-25-45.png

~ Dragon
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
You do not need "b.revive()" if you have "Remove State: Knockout 100%" in the Effects tab of the skill, the latter of which works more reliably.

In your formula, "a.hp" is sufficient enough.
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
Thank you so much! It works perfect now~!

~ Dragon
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,014
Reaction score
4,247
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:
Trying to make it so my map is cleared of "random" events after the player leaves the map... to little success >.<
Had my first interaction with a legit homophobe concerning one of my games today. Tempting to engage, but pointless.
The BIGGEST immersion breaker for Sword Art Online is that Kirito keeps finding overpowered playstyles using "bad things nobody uses cuz its bad". Players WILL use bad gear BECAUSE it's bad.
When I said I'd make 20 games in 2020, I scared myself. Now it's mid-February, and I've made 6 games. So I got this. But, then again...do I got this?

Forum statistics

Threads
94,238
Messages
919,286
Members
123,944
Latest member
ally_dwight
Top