xyzeden

Regular
Regular
Joined
Oct 16, 2021
Messages
38
Reaction score
7
First Language
English
Primarily Uses
RMMV
Hello @ATT_Turan and @caethyril. :kaoswt2: The turnCount property is added to actor objects by Yanfly's Battle Engine Core at game start.

Hi @xyzeden. :kaohi:You don't actually need troop events since ATT_Turan's original solution would work if you use a different variable name for the counter of each passive state (e.g. turnCountTGR, turnCountMAT) so they don't stack. You may also need to add $gameParty.inBattle() in the passive state condition.
Hello! Thanks for the response. I am very concerned about messing all of this up, since there's many more moving parts to this issue and solution than I'm used to. I would try to piece it together myself, but would very much appreciate a simple outline of what everything should look like and should be, especially since I do functionally have it working as is right now, just with the turnCount being messed up with two or more items.

Mostly, I'm not sure I understand what you mean by turnCountMAT and turnCountTGR. I understand naming them differently should differentiate them from eachother so they don't stack, but is this only for the specific state notes? If so, where is it designated? Do I just rename every instance of "turnCount" in the state notes to "turnCountMAT"?

Also, would I need to modify the script on each troop event as well?

Really appreciate the help. ;_;
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
10,963
Reaction score
8,850
First Language
English
Primarily Uses
RMMV
Hello! Thanks for the response. I am very concerned about messing all of this up
It's quite straightforward - each state should have its own variable name. Every place that variable is mentioned throughout the various notetags, you change it the same way.

Also, would I need to modify the script on each troop event as well?
You really should not need any troop events. I'm willing to bet if you update your project the code I originally gave you will work as expected.

If you don't do that, then you will need to copy and paste that script command for every different variable name you create.
 

Anastasius

Regular
Regular
Joined
Feb 7, 2022
Messages
61
Reaction score
47
First Language
English
Primarily Uses
RMMV
I don't see that in the plugin. It adds a _selfTurnCount member variable, but I haven't looked into when that's incremented - I would assume that it lines up with when the battle turn count increases, so that wouldn't match what the OP is trying to do.
What I meant was if YEP BEC were installed and user were an actor object, at game start user.turnCount will return the function itself as a non-empty, non-numeric string. At battle start this will mess up your passive state condition on either side of the logical preventing the passive state from ever activating.

In contrast user._selfTurnCount will be returned by user.turnCount() which at game start is 0.

Edit: If you really like the variable name why not use turncount instead? :kaophew:
 
Last edited:

xyzeden

Regular
Regular
Joined
Oct 16, 2021
Messages
38
Reaction score
7
First Language
English
Primarily Uses
RMMV
It's quite straightforward - each state should have its own variable name. Every place that variable is mentioned throughout the various notetags, you change it the same way.


You really should not need any troop events. I'm willing to bet if you update your project the code I originally gave you will work as expected.

If you don't do that, then you will need to copy and paste that script command for every different variable name you create.

I have tried updating my project in the past and it never worked. I followed the instructions exactly, copied every single thing as requested, backed up my project a bunch, etc etc. It does make the battletest run in a new window which is cool, but it doesn't do anything noticeable. But the RPGMV Project game file still says 1.0.1 in notepad, so I have no idea if it actually worked or not. I'm just going to assume it didn't.

That being said, renaming every instance of turncount to its own unique thing in the state notes appears to work independently of any troop event, so maybe did work after all?
 
Last edited:

xyzeden

Regular
Regular
Joined
Oct 16, 2021
Messages
38
Reaction score
7
First Language
English
Primarily Uses
RMMV
Alright, overall everything works for the most part. But there's still two issues, I'm going to info-dump and cross my fingers you read all the way to the end haha.

I "updated" my project, and the scripts in the state notes all appear to work independently of any troop event scripts. Renaming each individual state that has a "first x turns" effect to something unique appears to be flagging "off" at the proper times, but they're appearing on the map for some reason. Not sure why.

Here's the script for the three-turn MAT boost state, so maybe you can see why it's still on in worldmap.

Code:
<Custom Passive Condition>
condition=!user.turnCountMAT || user.turnCountMAT<4;
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCountMAT=user.turnCountMAT || 1;
user.turnCountMAT++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCountMAT;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCountMAT;
</Custom Escape Effect>

Also, there's one final problem. I was still working on the "old" 1.0.1 version of the project where I was using the same scripts as now, only they were running in conjunction with the troop events which are no longer needed. Well, there's one Wand I made that essentially is dormant for the first three turns, then on turn 4 a new state is added that applies +5% MAT. Then on turn 7 that state is removed in favor of a new one which adds +10% MAT. Then on turn 10 that state is removed for a permanent +15% MAT until the end of battle.

After a little toying with it in the old project, I got it to function exactly as I wanted it to. But for some reason, even using the same scripts as the last project, it absolutely refuses to work at all on this "updated" version.

I'll post the direct script for all three states which worked flawlessly in the old project. In this one, they refuse to work at all, meaning they don't even show up no matter how long I wait. Renaming every instance to "user.turnCountWAND" actually does make the states appear, but for turn 1 only, and then they all vanish from turn 2 onwards despite the differences.


Code:
(+5%)
<Passive Condition Cases>
Not State 518
Not State 519
</Passive Condition Cases>

<Custom Passive Condition>
condition=!user.turnCount || user.turnCount>=4
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCount=user.turnCount || 1;
user.turnCount++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCount;
</Custom Escape Effect>


(+10%)
<Passive Condition Cases>
Not State 519
</Passive Condition Cases>

<Custom Passive Condition>
condition=!user.turnCount || user.turnCount>=7
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCount=user.turnCount || 1;
user.turnCount++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCount;
</Custom Escape Effect>


(+15%)
<Custom Passive Condition>
condition=!user.turnCount || user.turnCount>=10
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCount=user.turnCount || 1;
user.turnCount++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCount;
</Custom Escape Effect>
 
Last edited:

Anastasius

Regular
Regular
Joined
Feb 7, 2022
Messages
61
Reaction score
47
First Language
English
Primarily Uses
RMMV
I "updated" my project, and the scripts in the state notes all appear to work independently of any troop event scripts. Renaming each individual state that has a "first x turns" effect to something unique appears to be flagging "off" at the proper times, but they're appearing on the map for some reason. Not sure why.
That just means it's working. :kaojoy:
You need to add $gameParty.inBattle() like so:
JavaScript:
<Custom Passive Condition>
condition=$gameParty.inBattle() && (!user.turnCountMAT || user.turnCountMAT<4);
</Custom Passive Condition>
That checks whether your party is, well, in battle!
After a little toying with it in the old project, I got it to function exactly as I wanted it to. But for some reason, even using the same scripts as the last project, it absolutely refuses to work at all on this "updated" version.

I'll post the direct script for all three states which worked flawlessly in the old project.
About problems associated with updating projects... no idea. :kaophew:Better ask ATT_Turan or caethyril.
Well, there's one Wand I made that essentially is dormant for the first three turns, then on turn 4 a new state is added that applies +5% MAT. Then on turn 7 that state is removed in favor of a new one which adds +10% MAT. Then on turn 10 that state is removed for a permanent +15% MAT until the end of battle.
We'll do something different here.
  1. Create a new state. Call this state Actor Passive.
  2. Go to your YEP_AutoPassiveStates plugin.
  3. Go to Parameters > ---List--- > Actor Passives List > double-click.
  4. From the State List tab double-click on the Actor Passives List.
  5. Select the Actor Passive state.
Paste this in the notetag of your Actor Passive state.
JavaScript:
// Actor Passive state
<Custom Turn End Effect>
user.turncount=user.turncount || 1;
user.turncount++;
</Custom Turn End Effect>

<Custom Victory Effect>
delete user.turncount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turncount;
</Custom Escape Effect>
Paste these respectively within the notetags of the three passive state components of your 3-step Wand passive state:
JavaScript:
// State 517: +5% MAT
<Custom Passive Condition>
condition=user.turncount>=4 && user.turncount<7;
</Custom Passive Condition>

// State 518: +10% MAT
<Custom Passive Condition>
condition=user.turncount>=7 && user.turncount<10;
</Custom Passive Condition>

// State 519: +15% MAT
<Custom Passive Condition>
condition=user.turncount>=10;
</Custom Passive Condition>
Add the corresponding passive state notetags to your Wand weapon.
Pray and hope this works. :kaoswt2:
What we did was to create just one counter and just variable localized within just one passive state.
Use the same Actor Passive state as above for the counter variable.
Then paste the following respectively into your two passive states:
JavaScript:
// State #???: +200% TGR
<Custom Passive Condition>
condition=$gameParty.inBattle() && (!user.turncount || user.turncount <4);
</Custom Passive Condition>

// State #???: +20% MAT
<Custom Passive Condition>
condition=$gameParty.inBattle() && (!user.turncount || user.turncount <4);
</Custom Passive Condition>
If you notice the codes are the same. That's right. If you want two passive states to stack, you copy the same code into the notetags of two different states.
You're probably already aware of this but when stacking most parameters, such as target rate and magic attack rate, they are multiplicative rather than additive.
By the way I am under the impression that every time we solve or nearly solve one issue you create a new one more complex than the last. :kaoangry:

If you have issues with the codes above or you have concocted a new more complicated timed passive state buff, sorry, I'm currently suffering from a mild allergic reaction to passive states. :stickytongue:
 
Last edited:

xyzeden

Regular
Regular
Joined
Oct 16, 2021
Messages
38
Reaction score
7
First Language
English
Primarily Uses
RMMV
That just means it's working. :kaojoy:
You need to add $gameParty.inBattle() like so:
JavaScript:
<Custom Passive Condition>
condition=$gameParty.inBattle() && (!user.turnCountMAT || user.turnCountMAT<4);
</Custom Passive Condition>
That checks whether your party is, well, in battle!
About problems associated with updating projects... no idea. :kaophew:Better ask ATT_Turan or caethyril.

We'll do something different here.
  1. Create a new state. Call this state Actor Passive.
  2. Go to your YEP_AutoPassiveStates plugin.
  3. Go to Parameters > ---List--- > Actor Passives List > double-click.
  4. From the State List tab double-click on the Actor Passives List.
  5. Select the Actor Passive state.
Paste this in the notetag of your Actor Passive state.
JavaScript:
// Actor Passive state
<Custom Turn End Effect>
user.turncount=user.turncount || 1;
user.turncount++;
</Custom Turn End Effect>

<Custom Victory Effect>
delete user.turncount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turncount;
</Custom Escape Effect>
Paste these respectively within the three passive state components of your 3-step wand passive state:
JavaScript:
// State 517: +5% MAT
<Custom Passive Condition>
condition=user.turncount>=4 && user.turncount<7;
</Custom Passive Condition>

// State 518: +10% MAT
<Custom Passive Condition>
condition=user.turncount>=7 && user.turncount<10;
</Custom Passive Condition>

// State 519: +15% MAT
<Custom Passive Condition>
condition=user.turncount>=10;
</Custom Passive Condition>
Add the corresponding passive state notetags to your Wand weapon.
Pray and hope this works. :kaoswt2:
What we did was to create just one counter and just variable localized within just one passive state.
Use the same Actor Passive state as above.
Then paste the following respectively into your two passive states:
JavaScript:
// State #???: +200% TGR
<Custom Passive Condition>
condition=$gameParty.inBattle() && (!user.turncount || user.turncount <4);
</Custom Passive Condition>

// State #???: +20% MAT
<Custom Passive Condition>
condition=$gameParty.inBattle() && (!user.turncount || user.turncount <4);
</Custom Passive Condition>
If you notice the codes are the same. That's right. If you want two passive states to stack, you copy the same code into the notetags of two different states.
You're probably already aware of this but when stacking most parameters, such as target rate and magic attack rate, they are multiplicative rather than additive.
By the way I am under the impression that every time we solve or nearly solve one issue you create a new one more complex than the last. :kaoangry:

If you have issues with the codes above or you have concocted a new more complicated timed passive state buff, sorry, I'm currently suffering from a mild allergic reaction to passive states. :stickytongue:
Wow, you went above an beyond for those issues. I appreciate that more than you know. Didn't even think anyone would read all of that! Completely understand if you're sick of this, I'll do my best to not create any more issues on this front while I work with these. You're amazing, thank you once again.

Edit: Not only did both of these work, but they didn't create any new problems either. And you've given me a lot to think about in terms of actually building my own scripts inside of this framework. I'm really thankful. Not fully sure I understand the "Actor Passive" fully, but as long as it works for the wand (which it does) then I'll take it and use the more longwinded codes for everything else, since I'm a little too nervous to risk breaking what works haha.

Seriously though I've been meaning to deal with this problem for a full year, and it all kind of makes sense otherwise. Incredibly happy, thank you.
 
Last edited:

xyzeden

Regular
Regular
Joined
Oct 16, 2021
Messages
38
Reaction score
7
First Language
English
Primarily Uses
RMMV
Alright, overall everything works for the most part. But there's still two issues, I'm going to info-dump and cross my fingers you read all the way to the end haha.

I "updated" my project, and the scripts in the state notes all appear to work independently of any troop event scripts. Renaming each individual state that has a "first x turns" effect to something unique appears to be flagging "off" at the proper times, but they're appearing on the map for some reason. Not sure why.

Here's the script for the three-turn MAT boost state, so maybe you can see why it's still on in worldmap.

Code:
<Custom Passive Condition>
condition=!user.turnCountMAT || user.turnCountMAT<4;
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCountMAT=user.turnCountMAT || 1;
user.turnCountMAT++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCountMAT;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCountMAT;
</Custom Escape Effect>

Also, there's one final problem. I was still working on the "old" 1.0.1 version of the project where I was using the same scripts as now, only they were running in conjunction with the troop events which are no longer needed. Well, there's one Wand I made that essentially is dormant for the first three turns, then on turn 4 a new state is added that applies +5% MAT. Then on turn 7 that state is removed in favor of a new one which adds +10% MAT. Then on turn 10 that state is removed for a permanent +15% MAT until the end of battle.

After a little toying with it in the old project, I got it to function exactly as I wanted it to. But for some reason, even using the same scripts as the last project, it absolutely refuses to work at all on this "updated" version.

I'll post the direct script for all three states which worked flawlessly in the old project. In this one, they refuse to work at all, meaning they don't even show up no matter how long I wait. Renaming every instance to "user.turnCountWAND" actually does make the states appear, but for turn 1 only, and then they all vanish from turn 2 onwards despite the differences.


Code:
(+5%)
<Passive Condition Cases>
Not State 518
Not State 519
</Passive Condition Cases>

<Custom Passive Condition>
condition=!user.turnCount || user.turnCount>=4
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCount=user.turnCount || 1;
user.turnCount++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCount;
</Custom Escape Effect>


(+10%)
<Passive Condition Cases>
Not State 519
</Passive Condition Cases>

<Custom Passive Condition>
condition=!user.turnCount || user.turnCount>=7
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCount=user.turnCount || 1;
user.turnCount++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCount;
</Custom Escape Effect>


(+15%)
<Custom Passive Condition>
condition=!user.turnCount || user.turnCount>=10
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCount=user.turnCount || 1;
user.turnCount++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCount;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCount;
</Custom Escape Effect>
EDIT: So this was the code I was using for everything:
Code:
<Custom Passive Condition>
condition=$gameParty.inBattle() && (condition=!user.turnCountMAT || user.turnCountMAT<4);
</Custom Passive Condition>

<Custom Regenerate Effect>
user.turnCountMAT=user.turnCountMAT || 1;
user.turnCountMAT++;
</Custom Regenerate Effect>

<Custom Victory Effect>
delete user.turnCountMAT;
</Custom Victory Effect>

<Custom Escape Effect>
delete user.turnCountMAT;
</Custom Escape Effect>

The issue I was encountering was that the states would delete themselves after the first fight, and then never return, despite flagging and unflagging correctly within that fight. Using Anastasius' alternative code for every turn-reliant passive state above, it actually works flawlessly from battle to battle.

I was hesitant to use that since the codes were the same, and I thought they would stack and mess up the turncounts like previously, but it appears to not be the case. I still don't fully understand the "actor state" which allows all of this to function as well as it does, but as long as it works, that's all I really care about. Thanks for the help.
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
10,402
Reaction score
6,583
First Language
Dutch
Primarily Uses
RMXP

xyzeden, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.

 

Latest Threads

Latest Profile Posts

I have some new modern-ish inside autotiles for MZ in my thread. Check it out.
Finished the first few characters for my character asset pack. Here's a preview:
ScreenShot_9_22_2023_1_6_38.png
Working on a "dual tech" for two characters... it ends like the Raging Demon move from the Street Fighter games. The kanji sign here being "Lose". gotta tweak some things, but it looks pretty cool in game so far. love putting so many fighting game references in here since that and rpgs are my two favorite genres.
I've been thinking about making a tutorial on "how to draw digital art". I wonder how many are interested. It won't be anything fancy like color theory or anatomy. Just a technical on how to get things done such as how to use layer and other tools. To make it accessible, it is aimed at mouse users rather than pen tablet/display owners.
A new enemy approaches...

Forum statistics

Threads
134,705
Messages
1,249,930
Members
177,459
Latest member
felipesmoke94
Top