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

1638170340913.png
Crossover Inn is getting very crowded, and I love it
Climbing to the top #mapping
1638160732198.png
I've started the first steps of the final few maps that I need to make for B:ms. I haven't been able to say that in a really, really long time. It'd probably be a good idea to blog about this or something.
Question for the Mods: What am I supposed to do when I can't make a synopsis 350 words long? (for project recruitment thread) @Shaz @mlogan
The game is meant to be more on the simple side in order to be achievable so I'm a bit stuck...

Forum statistics

Threads
117,043
Messages
1,104,080
Members
152,987
Latest member
mrsmatmoney
Top