Yanfly Buffs & States Core: how do you subtract a state turn for a user's state when the skill's tar

Traveling Bard

The Bard
Veteran
Joined
Jul 4, 2012
Messages
565
Reaction score
491
First Language
English
Primarily Uses
I poured myself over the documentation and code attempting to figure out how to do this. I'm at a loss... 


Basically, I have a state called surge that I use to Instant Cast Eval a skill. So as long as the user has the surge state, whatever skill is being used is an instant cast. I am using turns as though they are stacks, and attempting to remove a turn upon using specific skills.


Ex. Leo has 3 turns on Surge. He uses Heavy strike (which is setup to remove 1 turn of surge) and that uses 1 turn of Surge. He uses Second Wind (which is instant cast but isn't setup to remove any turns) and that uses no turns of Surge. Leo then follows up with 2 more Heavy Strikes and that removes the Surge state from Leo leaving him one more action before ending his turn.


Now the note tags:


<State 12 Turns: -1> 


Only affect the scope/target. So if I add this note tag to Heavy Strike, it will attempt to remove 1 turn of surge from the enemy I just targeted. I want the use of this skill to remove 1 turn from the user of said skill... How do I do that?


Thanks in advance!
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
Yup, Yanfly's notetags are very flawed and can only affect the target. Unfortunately, we can't guess the script call either to make the user loses a turn state due to useless documentation on his plugins.


What l did to fix this is instead of turns, I used a counter.


So everytime you do an instant attack that shouldn't be instant, each skill should look like this


<After Eval>


user._Surge = user._Surge || 0;


user._Surge = user._Surge - 1


user.setStateCounter(X,user._Surge)


if (user._Surge <= 0) {


user.removeState(X) }


</After Eval>


The surge skill should have this:


<After Eval>


target._Surge = 3


target.setStateCounter(X,target._Surge)


</After Eval>


No duration unless you want it to expires after some turns.


Didn't test so there might be a bug, just let me know if it's not working properly.
 
Last edited by a moderator:

Traveling Bard

The Bard
Veteran
Joined
Jul 4, 2012
Messages
565
Reaction score
491
First Language
English
Primarily Uses
Thanks for all the help!


I gave this a spin this morning before work and it functioned as expected; though I will need to tweak a few things on my end before it behaves visually like I want it to. Every turn I add the surge state manually at level 5 to imitate Extra Attacks from D&D (if you couldn't tell that's what I am doing here... imitating a fighter's Action Surge ability). So, what this looks like is the turn count on the state icon's right side and the counters we are manipulating at the bottom, lol. I will see about just moving everything state related to counters and nixing the turn count all together. Your approach is definitely the way to go. Thanks again.
 

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

Latest Threads

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,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top