[SOLVED](YEP_BuffStatesCore)Help with Custom State Duration?

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
Hello(again)!
I ask help, like last time, with the BuffStatesCore Plugin by Yanfly.

This time, i wanted to make so a State's Turn Duration was determined by one of the user's Parameters(in this case i'm using Agility).
So, i used the plugin's tag "Custom State X Turn", that does the exact thing i need, in this way:

Code:
<Custom State 22 Turn> 
turn = 2;
turn += Math.floor((user.agi - 10) / 2);
</Custom State 22 Turn>
If i understood it correctly, this would make it so when i use the Skill the tag is attached to, if State 22 is applied it would endure as many turns as the final value of the variable "turn". That doesn't seem the case though.

To make a test i used a character with an Agility parameter equal to 12, which would mean:

Code:
<Custom State 22 Turn> 
turn = 2;
turn += Math.floor((12 - 10) / 2);
</Custom State 22 Turn>
By this logic, "turns" should return '3' as a value. Instead, when the Character uses the ability in battle and applies the State 22 to itself, the turn counter only gives "2", which is the effective base turn duration of the State in the Database.

Am i doing something wrong? Or the Tag simply doesn't work that way? Thanks in advance!
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
are you counting the current turn/turn 0?
did you try seeing if without the second line it would give 1 or 2 turns?
 

0zuma

Villager
Member
Joined
Dec 14, 2019
Messages
27
Reaction score
19
First Language
English
Primarily Uses
RMMV
try setting turn to a higher number, like 7.
what happens?
 

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
try setting turn to a higher number, like 7.
what happens?
are you counting the current turn/turn 0?
did you try seeing if without the second line it would give 1 or 2 turns?
I tried it, it still gives me the value for the State duration in the States Database :/
Also what do you mean Waterguy with the current turn?
 

0zuma

Villager
Member
Joined
Dec 14, 2019
Messages
27
Reaction score
19
First Language
English
Primarily Uses
RMMV
Have you checked the console for errors? hit F12 after you apply the state in battle
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
well, my idea was that the problem may be that it is counting turn 0, so the value shown is one smaller than the value set - that is, if it is two turns it would show 1 then 0 three turns 2, 1, 0... so just checking the turn = 2; line to see the result, since we already know what to expect with only it.
But if a bigger value still shows 2, then that is not the problem.

Hmm... ok, some obvious-looking questions but that even I sometimes make these mistakes:
Did you make sure the plugin is turned on?
And did you check the console (f8 or f12, be sure to be in the "console" tab) when you tried the skill that adds it to see if there was any error message?

I am checking your code and comparing with the one on yanfly's wiki examples, and can't see a problem with the code...
 

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
well, my idea was that the problem may be that it is counting turn 0, so the value shown is one smaller than the value set - that is, if it is two turns it would show 1 then 0 three turns 2, 1, 0... so just checking the turn = 2; line to see the result, since we already know what to expect with only it.
But if a bigger value still shows 2, then that is not the problem.

Hmm... ok, some obvious-looking questions but that even I sometimes make these mistakes:
Did you make sure the plugin is turned on?
And did you check the console (f8 or f12, be sure to be in the "console" tab) when you tried the skill that adds it to see if there was any error message?

I am checking your code and comparing with the one on yanfly's wiki examples, and can't see a problem with the code...
- The plugin is ON
- I checked the console

I really don't understand.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
sorry, only thing I can think is something else in your notetags may be wrong and messing with that
 

0zuma

Villager
Member
Joined
Dec 14, 2019
Messages
27
Reaction score
19
First Language
English
Primarily Uses
RMMV
Write
console.log("I'm working!")

Inside the custom turn tag. If nothing appears on the console, then the plugin isn't reading your notetags
 

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
sorry, only thing I can think is something else in your notetags may be wrong and messing with that
Code:
<setup action>
display action
wait: 40
clear battle log
</setup action>
<finish action>
</finish action>

<Instant>
<Skill Tier: 1>
<Cooldown: 4>

<Custom State 22 Turn>
turn = 2;
turn += Math.floor((user.agi - 10) / 2);
</Custom State 22 Turn>
This is the entire notetag, i don't think there's something wrong with it.


Write
console.log("I'm working!")

Inside the custom turn tag. If nothing appears on the console, then the plugin isn't reading your notetags
Tried it, and nothing appears on console. Now we need to find out why the tag isn't read.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Ok, do the rest of the notetags work properly?
cton sequence? Instant skill? Skill cooldown? the tier? is this the only thing not working?
 

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
Ok, do the rest of the notetags work properly?
cton sequence? Instant skill? Skill cooldown? the tier? is this the only thing not working?
Yup.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
...ok, quick question, how is the state being added?
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
think I found the problem.

you used
JavaScript:
<Custom State 22 Turn>
turn = 2;
turn += Math.floor((user.agi - 10) / 2);
</Custom State 22 Turn>
I think you should have used
JavaScript:
<Custom State 22 Turns>
turn = 2;
turn += Math.floor((user.agi - 10) / 2);
</Custom State 22 Turns>
notice the s in turns in the notetags
 

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
think I found the problem.

you used
JavaScript:
<Custom State 22 Turn>
turn = 2;
turn += Math.floor((user.agi - 10) / 2);
</Custom State 22 Turn>
I think you should have used
JavaScript:
<Custom State 22 Turns>
turn = 2;
turn += Math.floor((user.agi - 10) / 2);
</Custom State 22 Turns>
notice the s in turns in the notetags
.... Oh. This is embarrassing XD
Thank you very much! Yet another lesson about double-checking the Code's syntax.
 

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
Is it working now then?
Glad I could help.
Yup! Now the State when applied lasts 3 turns, as it should be.
I also tried by modifying the character parameters, and it works as intended.
Thank you again!
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top