xyzeden

Veteran
Veteran
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
Veteran
Joined
Jul 2, 2014
Messages
7,086
Reaction score
4,895
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

Veteran
Veteran
Joined
Feb 7, 2022
Messages
56
Reaction score
40
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

Veteran
Veteran
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

Veteran
Veteran
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

Veteran
Veteran
Joined
Feb 7, 2022
Messages
56
Reaction score
40
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

Veteran
Veteran
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

Veteran
Veteran
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,078
Reaction score
6,380
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 Posts

Latest Profile Posts

All the artists on here always share their art, and I wanted to partake in the sharing. I wanted to show off the album art for my game's soundtrack while also showing off this song. I wanted to take a break from all the pianos/strings/jazz. I experimented with some side-chaining techniques to modulate the dub-step like synth.
Crazy idea to help people be more productive. We all upload a photo of someone who is good at nagging, cajoling, guilting, etc. you into doing what you should be doing. Then, after you have posted X amount of times in a defined period, that photo pops up with the text of "Shouldn't you be working on your game?" Just for fun.:wink:
Avery wrote on MouseWorks's profile.
That is a really cute avatar concept that you have there! I like it :3
Well, here's a screenshot of just another game that might never be completed...

quicktrip_xp01.jpg
Fake FullScreen (Download):

Forum statistics

Threads
128,509
Messages
1,195,116
Members
169,085
Latest member
JoshiRibombee
Top