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


It's a Spanish devlog don't get scared!.
Just read the forum rules just for kicks and rule 14 reminds me of this:
150.jpg
I'm in the process of converting all locks and intimidate/persuade dialogue options into D20 DC based success/fail (modified by player skill). Before, it required a certain flat amount you had to meet, but with rolls, it offers more freedom. For instance, you can repeatedly try to unlock a door instead of just not meeting the requirement to unlock it.
Since we get very close: If you want to enjoy the advent calendar as it is intended, wait til your date and the day in the URL line up, so you have the final day on actual christmas and not the day before... time zones ;3
1638170340913.png
Crossover Inn is getting very crowded, and I love it

Forum statistics

Threads
117,050
Messages
1,104,158
Members
153,014
Latest member
Nastyboydima
Top