miyanke

Veteran
Veteran
Joined
Dec 2, 2015
Messages
73
Reaction score
12
First Language
Spanish
Primarily Uses
RMMZ
Hi everyone I need ideas to create a state in wich if the character is dead the other dead allies become alive.

This idea come from the hability "conservation of life" (CoL) from Bravely Default game and is explained as "When K.O.'d, revive all allies and fully restore HP."

Any help? I needed to script something in the CoL State as "If a.HP is 0 then (if b is dead) add HP to b" (being b as all allies in battle)


Thank you in advance
 
Last edited by a moderator:

miyanke

Veteran
Veteran
Joined
Dec 2, 2015
Messages
73
Reaction score
12
First Language
Spanish
Primarily Uses
RMMZ
I found YEP- Autolife and it's code:


<Category: Bypass Death Removal>

<Custom Deselect Effect>
// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
// Play the auto-life animation on target.
target.startAnimation(49);
// Set the amount of HP recovered to 10%.
var rate = 0.10;
// Calculate the HP healed.
var heal = Math.floor(target.mhp * rate);
// Remove the Auto-Life state.
target.removeState(stateId);
// Heal the target.
target.gainHp(heal);
// Make the damage popup show for the heal.
target.startDamagePopup();
// Clear the target's results.
target.clearResult();
}
</Custom Deselect Effect>


Is there anyway to change the objective target of the healing to all the group except the user instead of the user?
 

jasonb205

Villager
Member
Joined
Jul 25, 2012
Messages
5
Reaction score
1
First Language
English
Primarily Uses
<Category: Bypass Death Removal>


<Custom Deselect Effect>


// Check if the target's HP is 0 or is currently in the death state.


if (target.hp <= 0 || target.isDead()) {


// Play the auto-life animation on target.


user.startAnimation(49);


// Set the forced action for the user.


user.forceAction(108, ally);


// Prepare the battle engine for the forced action.


BattleManager.forceAction(user);


// Process the forced action.


BattleManager.processForcedAction();


// Remove the Auto-Life state.


user.removeState(31);


}


</Custom Deselect Effect>

This is what I have so far, with a skill healing someone else, i thought I would take a crack at it, although I have made little to no progress, if you already found a solution please share. Right now I only got it to heal one person and the user, i don't know what ally would be in this case though.


Okay, so after trial and error, I found what you wanted. The plugins involved are: YEP_BuffsStatesCore, YEP_X_StatesCategories, YEP_TargetCore and YEP_X_SelectionControl for good measure. I used Yanfly's Chain Lightning tip and trick video and the Autolife to make it.

<Category: Bypass Death Removal>


<Custom Deselect Effect>


// Check if the target's HP is 0 or is currently in the death state.


if (target.hp <= 0 || target.isDead()) {


// Set the forced action for the user.


user.forceAction(108, user);


// Prepare the battle engine for the forced action.


BattleManager.forceAction(user);


// Process the forced action.


BattleManager.processForcedAction();


// Remove the Auto-Life state.


user.removeState(31);


}


</Custom Deselect Effect>

Put this in your state, and put this in a skill 

<Single or Multiple Select>


<Custom Target Eval>


// Adds the selected target to the target list.


targets.push(target);


// Grab the group of alive foes as candidates.


var members = foes.aliveMembers();


// Remove the target from the group of candidates.


members.splice(members.indexOf(target), 1);


// This is the number of extra targets to select with Chain Lightning.


var extraTargets = 3;


// Loop the extra targets.


while (extraTargets--) {


// Grab a random foe from the alive foes.


var member = members[Math.floor(Math.random() * members.length)];


// Check to see if the member exists.


if (member) {


// Add the member to the group of targets.


targets.push(member);


// Remove the member as a viable candidate.


members.splice(members.indexOf(member), 1);


}


}


</Custom Target Eval>


<Actor or Enemy Select>

In effects, put Recover HP 100% and Remove State Knockout 100%


I put scope to all allies dead for good measure, made it work twice.
 

miyanke

Veteran
Veteran
Joined
Dec 2, 2015
Messages
73
Reaction score
12
First Language
Spanish
Primarily Uses
RMMZ
<Category: Bypass Death Removal>


<Custom Deselect Effect>


// Check if the target's HP is 0 or is currently in the death state.


if (target.hp <= 0 || target.isDead()) {


// Play the auto-life animation on target.


user.startAnimation(49);


// Set the forced action for the user.


user.forceAction(108, ally);


// Prepare the battle engine for the forced action.


BattleManager.forceAction(user);


// Process the forced action.


BattleManager.processForcedAction();


// Remove the Auto-Life state.


user.removeState(31);


}


</Custom Deselect Effect>

This is what I have so far, with a skill healing someone else, i thought I would take a crack at it, although I have made little to no progress, if you already found a solution please share. Right now I only got it to heal one person and the user, i don't know what ally would be in this case though.


Okay, so after trial and error, I found what you wanted. The plugins involved are: YEP_BuffsStatesCore, YEP_X_StatesCategories, YEP_TargetCore and YEP_X_SelectionControl for good measure. I used Yanfly's Chain Lightning tip and trick video and the Autolife to make it.

<Category: Bypass Death Removal>


<Custom Deselect Effect>


// Check if the target's HP is 0 or is currently in the death state.


if (target.hp <= 0 || target.isDead()) {


// Set the forced action for the user.


user.forceAction(108, user);


// Prepare the battle engine for the forced action.


BattleManager.forceAction(user);


// Process the forced action.


BattleManager.processForcedAction();


// Remove the Auto-Life state.


user.removeState(31);


}


</Custom Deselect Effect>

Put this in your state, and put this in a skill 

<Single or Multiple Select>


<Custom Target Eval>


// Adds the selected target to the target list.


targets.push(target);


// Grab the group of alive foes as candidates.


var members = foes.aliveMembers();


// Remove the target from the group of candidates.


members.splice(members.indexOf(target), 1);


// This is the number of extra targets to select with Chain Lightning.


var extraTargets = 3;


// Loop the extra targets.


while (extraTargets--) {


// Grab a random foe from the alive foes.


var member = members[Math.floor(Math.random() * members.length)];


// Check to see if the member exists.


if (member) {


// Add the member to the group of targets.


targets.push(member);


// Remove the member as a viable candidate.


members.splice(members.indexOf(member), 1);


}


}


</Custom Target Eval>


<Actor or Enemy Select>

In effects, put Recover HP 100% and Remove State Knockout 100%


I put scope to all allies dead for good measure, made it work twice.

It worked thank you.

I tried it in my game but it still doesn't work, when the state has to select the allies it breaks.

I will try to find what's the reason behind this to happen and find a solution.

Anyway, Thank you very so much.
 

jasonb205

Villager
Member
Joined
Jul 25, 2012
Messages
5
Reaction score
1
First Language
English
Primarily Uses
No problemm, I'm here if you need it sorted out.
 

Latest Threads

Latest Posts

Latest Profile Posts

May I make a suggestion for what language we should use for plugins?

IMG_1177.JPG
Have you opened all the advent calendar's yet? Don't forget to leave @Starbird_Resources and @WaywardMartian some love!
1638376821276.png
LOOK AT EM GOOOOOOOOOO!
Sorry for the spam with this, I'm just real happy with how this has gone :D
Custom sleep sequence done! :kaopride:
fuY8hyg.gif
The other day I posted a merchant airship tileset and said it was overflow from my Advent Calendar. @Avery said something like "that's one way to flex!" Well, this morning I woke up and realized THAT I MISCOUNTED AND AM SHORT BY ONE DAY. My face and palm are now perfectly fused together.

Forum statistics

Threads
117,104
Messages
1,104,619
Members
153,127
Latest member
Lilica0506
Top