Help with Increasing Party members stats during certain conditions

Aeternus

Hebitsukaiza
Veteran
Joined
Feb 28, 2014
Messages
92
Reaction score
17
First Language
Java
Primarily Uses
RMMV
Hi all I ran into a little problem, i researched for a possible way to start on it but it seems no ones either had problems with it before or it might just not be possible.

I need help with coming up with something like,
Character has Weapon equipped, Weapon has passive skill that does:
1. Increases Character's stats by X for each party member who is KOd.
these stats should only last while the party members are KOd and would return to normal according to the party members that are resurrected.
2. If the character's own HP is below a certain level lets say 50% for now, every other party member's stats should be reduced by X, and same as the above, if the Character's HP goes above 50% the party member's stats should return to normal.
3. last, if the character's HP is above lets say 90% the rest of the party will have increased stats by X.

Im unsure on how to do this im a supper noob at JS xD i thought i was getting the hang of it but i am now sure i need way more training in it haha but this is something id like to get some help on if possible for now so that i am not stuck in this part of the game making haha.

I am using most of Yanfly's plugins and DreamX random Weapon Prefix Suffix plugin.

thank you in advanced, you guys are always great!
 

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
89
Reaction score
39
First Language
English
For 1:
So, theoretically, I would have the weapon apply a passive state on equip. I would then have the Knockout state have a Custom Apply Effect and Custom Remove Effect. Each of these effects would do a loop to check through everyone in the party, see if they have the weapon's state affecting them, and...that's where I'm stuck. I don't know of a way to modify the effects of a state during the game. Maybe someone else will know of a script call to do that, or think of a better approach.

For 2 and 3:
The problem is that any passive state you have isn't going to be constantly refreshing to check the state of your health. So you'll need to have some code executing every time you take or heal damage to check your percentage of your health, whether you have the passive state, and act accordingly. You can do a bit of that in Yanfly's Damage Core, but that only applies to physical attack skills, so I'm not sure how you'd do it for magic damage, incidental damage, or healing, unless you go to the code/write your own plugin. There might be an existing plugin to call an event on all sources of damage and healing, but I couldn't find it with a cursory search.

So, basically...how important is it to you that this one weapon have all of this specific functionality in your game?
 

Pots Talos

Veteran
Veteran
Joined
Jun 28, 2012
Messages
108
Reaction score
91
First Language
English
Primarily Uses
RMMV
If you are using Yanflys action sequences you could create a common event that runs at the end of any skill. Inside this common event you could run any checks you like which could add or remove states depending on whatever conditions are met.

I use this in my game and it is very useful.
 

Aeternus

Hebitsukaiza
Veteran
Joined
Feb 28, 2014
Messages
92
Reaction score
17
First Language
Java
Primarily Uses
RMMV
For 1:
So, theoretically, I would have the weapon apply a passive state on equip. I would then have the Knockout state have a Custom Apply Effect and Custom Remove Effect. Each of these effects would do a loop to check through everyone in the party, see if they have the weapon's state affecting them, and...that's where I'm stuck. I don't know of a way to modify the effects of a state during the game. Maybe someone else will know of a script call to do that, or think of a better approach.

For 2 and 3:
The problem is that any passive state you have isn't going to be constantly refreshing to check the state of your health. So you'll need to have some code executing every time you take or heal damage to check your percentage of your health, whether you have the passive state, and act accordingly. You can do a bit of that in Yanfly's Damage Core, but that only applies to physical attack skills, so I'm not sure how you'd do it for magic damage, incidental damage, or healing, unless you go to the code/write your own plugin. There might be an existing plugin to call an event on all sources of damage and healing, but I couldn't find it with a cursory search.

So, basically...how important is it to you that this one weapon have all of this specific functionality in your game?
I mean i could go without this weapon but i am trying to do something new haha xD kind of new.. not really new xD ...ok its like the power of friendship basically xD but in a weapon haha xD

and yea im looking for some sort of javascript to get me started on this and im sure i can figure something out eventually but as mentioned before im still a complete noob at it xD

If you are using Yanflys action sequences you could create a common event that runs at the end of any skill. Inside this common event you could run any checks you like which could add or remove states depending on whatever conditions are met.

I use this in my game and it is very useful.
I have the action sequences but i have yet to use them for anything xD
anything i should start looking into specifically?
notetag or code? any is fine by me
 

Pots Talos

Veteran
Veteran
Joined
Jun 28, 2012
Messages
108
Reaction score
91
First Language
English
Primarily Uses
RMMV
@Aeternus You should check out this thread for some action sequence examples. The only thing I was talking about is having something like this at the end of the action sequence:

Code:
<finish action>
   common event: 10
   perform finish
</finish action>
If you have that at the end of all your skills (if you plan on using action sequences) this will make sure that Common Event 10 will run at the end of the skill. You would want this on every skill player and enemy so that it always checks for conditions you want, like dead party members or HP amounts.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
601
First Language
English
Primarily Uses
RMMV
The yanfly passive skill plugin has an option/note tag to "equip" a state. If you put the conditions into the state under, let's say <custom regeneration>, then during that phase the condition would be checked to see if it is true, thus updating the conditions during the battle. This would be the ideal way as opposed to using action sequencing every time any skill is used.

You will need yanfly passive skills and yanfly buff and state core.

edit:


1. This is a condition you could use to check if there are any actors affected by the knockout/dead state. You could probably add another condition(s) to get exactly how many party members are dead, thus allowing you to have different stat increases depending on how many dead actors are currently in the battle.
Code:
$gameParty.members().filter( function (actor) { return actor.isStateAffected(knockoutStateId); } ).length > 0
The problem then could be how you are increasing the stats for the actor. If you use a script call to increase a stat, then it will be permanent. The easier way would be to apply a buff or another state.

2. & 3. are pretty straightforward on the conditions.
 
Last edited:

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
89
Reaction score
39
First Language
English
Would Custom Regenerate do it? The documentation says Custom Regenerate will be executed "
whenever the battler would regenerate HP, MP, or TP." That doesn't seem to cover any time the battler takes damage from different kinds of skills. So it looks like that would be useful in manipulating the stats when they are healed above the desired HP thresholds, but it wouldn't accomplishing checking the state of the party every time damage is dealt.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
601
First Language
English
Primarily Uses
RMMV
Yeah you’re right. Whichever part of the turn would work, but the idea is the same. Custom Turn Start would probably be best
 

Aeternus

Hebitsukaiza
Veteran
Joined
Feb 28, 2014
Messages
92
Reaction score
17
First Language
Java
Primarily Uses
RMMV
The yanfly passive skill plugin has an option/note tag to "equip" a state. If you put the conditions into the state under, let's say <custom regeneration>, then during that phase the condition would be checked to see if it is true, thus updating the conditions during the battle. This would be the ideal way as opposed to using action sequencing every time any skill is used.

You will need yanfly passive skills and yanfly buff and state core.

edit:


1. This is a condition you could use to check if there are any actors affected by the knockout/dead state. You could probably add another condition(s) to get exactly how many party members are dead, thus allowing you to have different stat increases depending on how many dead actors are currently in the battle.
Code:
$gameParty.members().filter( function (actor) { return actor.isStateAffected(knockoutStateId); } ).length > 0
The problem then could be how you are increasing the stats for the actor. If you use a script call to increase a stat, then it will be permanent. The easier way would be to apply a buff or another state.

2. & 3. are pretty straightforward on the conditions.
Awesome i was looking for something along the lines of this
i just wasnt sure how to start it xD
with this i think i can come up with something, ill mess around with it and see what happens.
ill keep you guys updated within the next few days
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Just got two Switch E-Shop 20$ gift cards... Is 3D All-Stars worth it? Or should I get something like Celeste? I'd love to know your opinion!
I’m looking at the MZ full body images and I think Priscilla is taller than Reid...
Ami
--- Music Selection ---

M.Archer: It's Music Station,You can Change the Music as you like.
F.Healer: i want to hear the Romantic Music.
M.Fighter: Then,i want the Hard-Rock one!
(the Troll Song has played)
M.Archer: Hey,i hear this Music.
F.Healer: It's popular from Internet Music,i wonder who change it?
Hero: I change it.
Entire Party: YOU????
Had a soda for the first time in two months at my nephew's birthday party...it's amazing how once you are no longer addicted to soda, they actively taste like poison when you try to drink them. Couldn't even finish it.

Forum statistics

Threads
103,042
Messages
996,899
Members
134,516
Latest member
Pumpkinnubbin
Top