Party Member Sacrifice

Status
Not open for further replies.

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Good day everyone,


I've been scouring the internet for a few, and haven't been able to turn up a plugin or method to do what I'm needing to do, so I wanted to request it here:


In a game I'm helping to make, we're in need of a plugin that would allow for a specific member of our party to always be protected from death by the other members of the party, if they're in the same battle. Alongside that, if it's possible, I would also want the ability to set it to a certain chance of protecting said member from non-lethal attacks, and then a definitive blocking of a lethal hit by another member of the party(whoever has the highest agility, or the ability to select what trait) in the battle.


Just for the sake of details, basically I would want it to be like this(simplistic scenario of member A being targeted three times with one other member):


---------------------------------------------------------------------------------------------------------------------------------------------------------------


Two members of a party get into a battle.


The enemy attacks Member A, and Member B has a, for example, 40% chance of blocking the non-lethal attack.


The block fails, and Member A gets hit.


The enemy attacks Member A again, and Member B has the same 40% chance of blocking the non-lethal attack.


The block succeeds, and Member B gets hit instead of member A.


The enemy attacks Member A again, this time it would be a lethal hit(say, a certain more powerful skill or something).


Because it's a lethal hit, Member B sacrifices(if he/she would die as well) him/herself to block the attack from hitting Member A.


If low enough of HP, Member B dies instead of Member A.


---------------------------------------------------------------------------------------------------------------------------------------------------------------


*In the event of multiple party members, the one with the most agility(or, as I noted before, perhaps the ability to choose what trait) would do the blocking.


I'm aware of the "Substitute" Flag, that is, in theory, supposed to do similar to this, but I cannot get it to work, and it's not exactly what I'm needing for the game.


I'm not sure if there's anything else I'm supposed to add or do, as I have just signed up for the website, but I'm hoping someone can help me out with this.
 
Last edited by a moderator:

matthew30903

Veteran
Veteran
Joined
Jun 29, 2014
Messages
83
Reaction score
31
First Language
English
Primarily Uses
I would recommend you look at Yanfly's Buffs & States Core plugin. This will allow you to set up a state that for member B that has a 40% chance of activating when member A gets hit. You will need to figure our the JavaScript for it, but this should be more than doable with Lunatic Mode. I recommend you take a look at Yanfly's Tips and Tricks videos and the readme as they have many examples to get you started.
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
I will look at both, but I don't believe those will be what I'm looking for(since the state of Substitute didn't work when it was fully active, and I'm not entirely sure what Lunatic Mode would help with in that regard).


What is Lunatic Mode though, out of curiosity?
 
Last edited by a moderator:

matthew30903

Veteran
Veteran
Joined
Jun 29, 2014
Messages
83
Reaction score
31
First Language
English
Primarily Uses
Lunatic Mode is a way to use JavaScript in the notetags. This allows you to do things that would normally require a separate plugin using minimal JavaScript knowledge. Most of Yanfly's plugins allow you to do things like this, Yanfly calls it Lunatic Mode.


With the buffs and states core you can set states to activate under certain conditions and set their effects using Lunatic Mode. For Example, poison states will only activate on that battler's turn, with Lunatic Mode you could have it activate every time someone moves.
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Interesting. I can look into that, but I still don't think it would allow me to do what I need to do.


Thank you though, for giving me the idea.
 

SEK

Veteran
Veteran
Joined
Mar 31, 2016
Messages
56
Reaction score
51
First Language
Italian
Primarily Uses
Would you like to decide which actor will be defended by actorId or by its position in party?


And do you want to set a specific percentage of success? or you want it to be calculated with the agi of the "bodyguard"?


You want to show a message when the actor is defended? If yes, what should it say?
 
Last edited by a moderator:

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Would you like to decide which actor will be defended by actorId or by its position in party?


And do you want to set a specific percentage of success? or you want it to be calculated with the agi of the "bodyguard"?


You want to show a message when the actor is defended? If yes, what should it say?


For the first question, I'd want to select a specific actor by his/her ID.


For the second: Basically I want it to be a definite success rate if an attack would be lethal to the specific person, and any non-lethal attacks I'd want to be able to set a percentage chance. In regards to who would defend the person, if it's a lethal attack, the highest agility would be the one to block it. If it's non-lethal, I'd want the chance determined by agility first, then health second. Basically, if the fastest person wouldn't die, he/she'd have a higher chance of defending the person. If he/she would die from the non-lethal attack, then the percentage chance would be higher with the one with the second highest agility, and so on and so forth. If it comes to a point that all of them would die from the non-lethal attack on the one person, it would go back to the highest agility having the highest chance. With all the changes of the chance, I want to be able to determine what the chance percentages would be, since we'll have to figure out what works best for our game. I simply want to be able to have the chance change based on those determining factors(agility and health).


For the third, I'd like that option, yes. That would definitely be useful to us. I don't have a specific phrase for it though, we would likely have different ones for the different actors/characters.


Thank you for replying to this thread, and sorry for modifying it a bit from the original request. I needed to make sure it was what was needed.
 
Last edited by a moderator:

SEK

Veteran
Veteran
Joined
Mar 31, 2016
Messages
56
Reaction score
51
First Language
Italian
Primarily Uses
Ok, I think it's almost complete and needs to be tested, could you download it here (right click and save) and check if something's wrong?


I didn't have much time to test everything and I'm not sure if the percentage works like you wanted... which is correct?
 


1) we have actors A, B, C, D. "A" must be protected. C is faster and would not die so he tries to protect him with a 40% possibility. He doesn't succeeds and A gets hit.


2) we have actors A, B, C, D. "A" must be protected. C is faster and would not die so he tries to protect him with a 40% possibility. He doesn't succeeds. B has the second highest agi, tries to protect A, if he doesn't succeed, D will try.


I realized case (1) because in case (2) with a 40% possibility to succeed, seemed to easy to always protect A... maybe I didn't understand and you wanted version (2) LOL


let me know ^_^

Code:
 To set the message to be shown when an actor defends, write in its notetags
  "<bodyg:Text to be shown>" (without quotation marks)
  
- Plugin Commands:

• bodyg on   Activates the plugin
• bodyg off  Deactivates the plugin
 
• bodyg perc x      Success percentage becomes x (from 0 to 100).
• bodyg actor x     Actor x will be defended
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Ok, I think it's almost complete and needs to be tested, could you download it here (right click and save) and check if something's wrong?


I didn't have much time to test everything and I'm not sure if the percentage works like you wanted... which is correct?
 


1) we have actors A, B, C, D. "A" must be protected. C is faster and would not die so he tries to protect him with a 40% possibility. He doesn't succeeds and A gets hit.


2) we have actors A, B, C, D. "A" must be protected. C is faster and would not die so he tries to protect him with a 40% possibility. He doesn't succeeds. B has the second highest agi, tries to protect A, if he doesn't succeed, D will try.


I realized case (1) because in case (2) with a 40% possibility to succeed, seemed to easy to always protect A... maybe I didn't understand and you wanted version (2) LOL


let me know ^_^



To set the message to be shown when an actor defends, write in its notetags
"<bodyg:Text to be shown>" (without quotation marks)

- Plugin Commands:

• bodyg on Activates the plugin
• bodyg off Deactivates the plugin

• bodyg perc x Success percentage becomes x (from 0 to 100).
• bodyg actor x Actor x will be defended


The first case is correct, and I'll run a test of everything in just a few, and reply again if there's anything to note(issues and the like).
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Okay, there were some things of note:


One, there doesn't appear to be an option of a guaranteed blocking in the event of a lethal hit. That's a very crucial part of what we need for the game, so I wanted to make sure to bring that up again.


Two, would it be possible to have an option of having a chance of blocking and dealing some damage back to the enemy? I know I didn't mention that before, but I was wondering about that. I'd like that part to be optional though, if it can be implemented(we may not use that kind of feature, but it'd be good to have just in case).


Three, and this is just an aesthetic thing, is it possible to have the character that ends up blocking the attack move in front of the character he/she's protecting? If not, no big deal, just wondering.


Fourth, here's more of what I meant, that might have been why there was some confusion with the two cases you mentioned(the first case was correct for only two party members, but there's some more to it with multiple members). I also had some modifications to the original request:


--------------------------------------------------------------------------------


Actor A, B, C, D go into a battle with max health(100 each)


A is to be protected, a multiple percentages determined by the gamemaker:


-Guard chance(if a block is to happen)


-Max chance of blocking in reference to a party of four actors with reference to only three of those members, since one is being guarded by the other three(with the script automatically adjusting each member's respective chance depending on how many members, the agility of each member, and the health of each member(agility increases the chance, lower health decreases the chance)), the variable(interval of change) of which determinable by the gamemaker(scale of 1-10).


>For example, if it was set to 60%, and there was Actor B and D left, if we assume they were max health, and B had higher agility, their chance could be 25%, and D could be 15%. If the number of members changed, it would distribute it appropriately, with one member having a higher chance if he has superior agility/health.


-Block Chance(optional, and if it's possible)


Guard chance: 40%


Max Chance: 60%


Block Chance: 30%


-A is attacked by the enemy.


>Guard chance is done, and the guard occurs.


>B has the highest agility, thus having the highest percentage chance of taking the damage instead of Actor A. C has the second highest, thus having the second highest percentage chance of taking the damage. D has the third highest agility, thus having the lowest percentage chance, in this scenario, of taking the damage.


>The "roll" is made, and C is determined to be the one to take the damage by the game.


>Block chance is done, and it fails.


>C takes the damage instead of A.


>C has 90 health now.


-A is attacked again by the enemy.


>Guard chance is done, and the block doesn't occur.


>Block chance isn't done, since nobody is guarding A.


-B is attacked by the enemy.


>Deals 10 damage, as B isn't to be guarded.


>B has 90 health now.


-A is attacked by the enemy.


>Guard chance is done, and the guard occurs.


>Since B and C have equal health still, B has more of a chance of guarding than C, no matter the circumstances. D has max health though, so it has a higher chance than usual.


>The "roll" is made, and D is determined to be the one to take the damage by the game.


>Block chance is done, and it fails.


>D takes the damage instead of A.


>D has 90 health now.


-A is attacked again by the enemy.


>Guard chance is done, and the guard occurs.


>Since they all have the same health, B once more has the highest chance, C has the second highest, and D has the third highest.


>The "roll" is made, and B is determined to be the one to take the damage by the game.


>Block chance is done, and it succeed.


>B takes no damage, and deals back part of the damage that would've been dealt to B.


>Since he would've taken 10 damage, the damage given back to the enemy could be 1-10.


>The enemy takes 7 damage from the random chance.


--------------------------------------------------------------------------------


With the interval change, I don't have a really good explanation for that, but the gist is that higher values allow for an easier time for those with less agility to have more of a chance to guard depending on their health, and the chances change more rapidly, while lower values make that harder to occur, and make the chances change less rapidly.


Hopefully that all makes sense. If you have anymore questions, please ask. I appreciate you taking the time to help me with this.
 
Last edited by a moderator:

SEK

Veteran
Veteran
Joined
Mar 31, 2016
Messages
56
Reaction score
51
First Language
Italian
Primarily Uses
One, there doesn't appear to be an option of a guaranteed blocking in the event of a lethal hit. That's a very crucial part of what we need for the game, so I wanted to make sure to bring that up again.
How did you try? if the attack the enemy makes is lethal, there's a 100% chance to block it... note: it won't work with forced actions.


However, let me know if this formula works fine and if I understood everything:
_______For the guard chance:__________________________________________


We have A, B, C, D. A must be protected.


-B has 36 agi, C has 54, D has 42--> total is 132 agi


  this means B has ~27% of total speed, C ~41%, D ~32%


-B has 92 hp, C has 40 hp, D has 30--> total is 162hp


  this means B has ~57% of total hp, C has ~25%, D has ~18%


- Total % for each actor is the average of the two percentages:


  B has (27+57)/2=42%, C has 33%, D has 25%.


So it will be decided who will defend:
Let me know what would you prefer:
(1-a) - B is chosen, no matter what.


(1-b) - check if B is chosen (a random number from 0 to 100 is taken and, if that number is <= 42, B is chosen)


                     else check if C is chosen.


                     else check if D is chosen.


                     else start again with B.


The chosen one will have his % proportionate to the max %


so, if it is 100% and max % is 60, 100% will become 60%, or, in this case, 42% will become 42/100*60 =~25%.


a random number from 0 to 100 is taken and, if that number is <= 25, B defends A, else A is hit.


If B would die if he gets hit, the second highest % will take the hit (C in this case), same happens if the second would die: the third (D) will take the hit...


unless the third would die too, in that case B will take the hit and die.
_______For the block chance:__________________________________________


if B defends A and "Block Chance" is activated (set as on or off by plugin command)


a random number from 0 to 100 is taken and, if that number is <=Block Chance Rate (for example 40%)


B won't be hit and the enemy will get hit and damaged by:


(2-a) - the same amount of damage that he would have done, weakened (or made stronger if the enemy is weak) by the monster's defense.


(2-b) - a random percentage from 1 to 100 of the amount of damage that he would have done, weakened (or made stronger if the enemy is weak) by the monster's defense.


Let me know what's wrong...


P.S.


I didn't understand what this variable should do

the variable(interval of change) of which determinable by the gamemaker(scale of 1-10).
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
How did you try? if the attack the enemy makes is lethal, there's a 100% chance to block it... note: it won't work with forced actions.


However, let me know if this formula works fine and if I understood everything:
_______For the guard chance:__________________________________________


We have A, B, C, D. A must be protected.


-B has 36 agi, C has 54, D has 42--> total is 132 agi


  this means B has ~27% of total speed, C ~41%, D ~32%


-B has 92 hp, C has 40 hp, D has 30--> total is 162hp


  this means B has ~57% of total hp, C has ~25%, D has ~18%


- Total % for each actor is the average of the two percentages:


  B has (27+57)/2=42%, C has 33%, D has 25%.


So it will be decided who will defend:
Let me know what would you prefer:
(1-a) - B is chosen, no matter what.


(1-b) - check if B is chosen (a random number from 0 to 100 is taken and, if that number is <= 42, B is chosen)


                     else check if C is chosen.


                     else check if D is chosen.


                     else start again with B.


The chosen one will have his % proportionate to the max %


so, if it is 100% and max % is 60, 100% will become 60%, or, in this case, 42% will become 42/100*60 =~25%.


a random number from 0 to 100 is taken and, if that number is <= 25, B defends A, else A is hit.


If B would die if he gets hit, the second highest % will take the hit (C in this case), same happens if the second would die: the third (D) will take the hit...


unless the third would die too, in that case B will take the hit and die.
_______For the block chance:__________________________________________


if B defends A and "Block Chance" is activated (set as on or off by plugin command)


a random number from 0 to 100 is taken and, if that number is <=Block Chance Rate (for example 40%)


B won't be hit and the enemy will get hit and damaged by:


(2-a) - the same amount of damage that he would have done, weakened (or made stronger if the enemy is weak) by the monster's defense.


(2-b) - a random percentage from 1 to 100 of the amount of damage that he would have done, weakened (or made stronger if the enemy is weak) by the monster's defense.


Let me know what's wrong...


P.S.


I didn't understand what this variable should do


I didn't see the lethal hit part in the description, and I didn't try it. Sorry about that(I'll check that once we get everything figured out). Also, what do you mean by forced actions?


Also, I would need it to be possible for A not be defended in any non-lethal scenario. The guard chance is simply a check to see if a guard will occur in the non-lethal scenario. That can be a percent set by the gamemaker.


After the guard chance, if it succeeds(thus, someone is going to guard, for example, Actor A), there's a check on who will be the one to guard. Your system for that is perfect. In regards to which one I prefer in that list, I would say "1-b", since I would assume that's how you would do a check like that in RPG Maker MV.


With the max %, you can disregard that in its entirety.


"If B would die if he gets hit, the second highest % will take the hit (C in this case), same happens if the second would die: the third (D) will take the hit...


unless the third would die too, in that case B will take the hit and die." - Perfect.


With the block chance, I prefer "2-b".


Also, don't worry about the other variable, you can disregard that as well.


One last note: I'm sure you know this, but I also need it to work with a party other than a party of 4, and to adjust accordingly.


If you have any more questions, please ask them. I appreciate you doing all this.
 
Last edited by a moderator:

SEK

Veteran
Veteran
Joined
Mar 31, 2016
Messages
56
Reaction score
51
First Language
Italian
Primarily Uses
The guard chance is simply a check to see if a guard will occur in the non-lethal scenario. That can be a percent set by the gamemaker.
I thought about it too, and there are two ways to realize it, I think you would like to have first method, but I'll ask anyhow:
(3-a) - Guard chance set to a %. example 50%. a random number is chosen from 0 to 100, if the number is <=50, guard will start and B, C or D will be chosen as said before.


(3-b) - No guard chance percent variable but the check is not a loop: check if B is chosen, else check if C is chosen, else check if D is chosen, else guard doesn't happen and A is            hit.


Don't worry about member number, I'm trying it with my SEK_AllMembersFight ;)  

With forced actions I mean forced attacks made by event command set from the game maker, however guess i solved it.
 


Right click here to save the current version


I didn't have time to test everything so could you see if something's wrong? (actually I didn't have time to write it either, I should have studied hahaha) 


P.S.


Sorry but I couldn't manage to add player moving in front of the other when defending...
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
I thought about it too, and there are two ways to realize it, I think you would like to have first method, but I'll ask anyhow:
(3-a) - Guard chance set to a %. example 50%. a random number is chosen from 0 to 100, if the number is <=50, guard will start and B, C or D will be chosen as said before.


(3-b) - No guard chance percent variable but the check is not a loop: check if B is chosen, else check if C is chosen, else check if D is chosen, else guard doesn't happen and A is            hit.


Don't worry about member number, I'm trying it with my SEK_AllMembersFight ;)  

With forced actions I mean forced attacks made by event command set from the game maker, however guess i solved it.
 


Right click here to save the current version


I didn't have time to test everything so could you see if something's wrong? (actually I didn't have time to write it either, I should have studied hahaha) 


P.S.


Sorry but I couldn't manage to add player moving in front of the other when defending...


Ah, alright(you made a correct assumption with the first one). Also, I'll test it momentarily.


About the moving in front of thing, that's no problem at all. I'm glad you looked into it.


I'll report back after I test it!
 
Last edited by a moderator:

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Alright, I've noticed a few things, but I'm still testing it:

  1. Hovering over the different parameters in the plugin manager doesn't show any description(but double clicking it does)

    Not sure if that's actually an issue or not. If it isn't, my bad.

[*]There's no way to set the guard chance.

[*]What is the success percentage? Is that the percentage to determine if the actor is going to be protected?

[*]The description of the Guard Chance says that if set to false, it's enabled. I'm confused by that.

[*]The <bodyg: [Text]> function doesn't work anymore.
 
Last edited by a moderator:

SEK

Veteran
Veteran
Joined
Mar 31, 2016
Messages
56
Reaction score
51
First Language
Italian
Primarily Uses
Alright, I've noticed a few things, but I'm still testing it:

  1. Hovering over the different parameters in the plugin manager doesn't show any description(but double clicking it does)

    Not sure if that's actually an issue or not. If it isn't, my bad.

[*]There's no way to set the guard chance.

[*]What is the success percentage? Is that the percentage to determine if the actor is going to be protected?

[*]The description of the Guard Chance says that if set to false, it's enabled. I'm confused by that.
Sorry, I forgot to add that to the description and those are mistakes i made because i had no time :/


1    - Parameters show their description when you open them to change their value


2-3 - Guard chance is succes percentage: if you prefer I'll change the name, however that's the guard                    percentage i described in (3-a) before.


4    - That's a copy paste error, sorry. if set to false, guard is disabled, except if the actor to defend would                die, in that case he will still be protected with a 100% chance
 
Last edited by a moderator:

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Sorry, I forgot to add that to the description and those are mistakes i made because i had no time :/


1    - Parameters show their description when you open them to change their value


2-3 - Guard chance is succes percentage: if you prefer I'll change the name, however that's the guard                    percentage i described in (3-a) before.


4    - That's a copy paste error, sorry. if set to false, guard is disabled, except if the actor to defend would                die, in that case he will still be protected with a 100% chance


With the first thing, alright. Sorry, I sometimes jump to call something an issue before I actually look into it more.


With the second and third thing, alright. Could you put it under the true/false Guard Chance and have it labelled "Guard Chance Rate"(for consistency with the Block Chance ones), and the description saying that the rate determines how likely it is for the character to be protected from a non-lethal attack? You can word it how you like, I just wanted that basic part in there(just so I don't forget, since I'm a bit forgetful.


With the fourth thing, alright.


With what I added above, I have one more thing to note:

  1. The <bodyg: [Text]> function doesn't appear to function whenever a block occurs, only when a normal guarding occurs.

I have another thing I'm trying to test, but for some reason the enemy will hit every actor but the one I'm protecting. Do you know how to get an enemy to only target, or favor attacking, one party member?
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
Two more things I noticed:

  1. For some reason, the leader of the party is also guarding other actors beyond the set actor, instead of being focused only on protecting the actor I set in the parameters(it seems to only be when the other party members' health are low, so I assume it means that the script is saying for all members to be protected from a lethal hit, when only the set actor needs to be).
  2. It seems that it never fails that the set actor is guarded, and it seems without fail it's always the leader of the party protects that actor(non-lethal and lethal alike), and, as I mentioned before, any other actor in the party. Even if the leader has less health than someone of equal agility.
 

Jcfraven

Villager
Member
Joined
Jun 19, 2016
Messages
26
Reaction score
4
First Language
English
Primarily Uses
I know there's probably no need to bump this, since there is someone working on it(thanks again, SEK!), but I wanted to make sure I could still see it and such, so I wanted to go ahead and do so.


If I'm not supposed to, I apologize.
 

SEK

Veteran
Veteran
Joined
Mar 31, 2016
Messages
56
Reaction score
51
First Language
Italian
Primarily Uses
Sorry, I'm really, really busy at work these days, I think I won't be able to dedicate much time to plugins...
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top