Status Duration = Variable...?

AirshipCanon

Veteran
Veteran
Joined
Oct 27, 2015
Messages
54
Reaction score
10
First Language
English
Ok, so I'm trying create a special status for one of my actors.

Basically she has a skill that can unseal her power temporarily, creating a buff that does various things.
Now, I'm using the Yanfly engine, so doing some of the basics is simple:

I want this skill to buff her for X turns where X is the amount of TP she consumes to activate the skill [it simply uses ALL of her TP] divided by 10 [rounding nearest (<5 down; >5 up) (and if used with 100TP instead of say 96, Take another action)].

Getting the X is the easy part.
Just set the cost of the skill to 10.
During the Setup Action [Yanfly], have it store her (remaining) TP as a variable. 
{Common Event:
Set X to 1.
Conditional branch series to check how it will round.
Divide by 10.
Add appropriate value to X,
If 100 set a switch to arm the extra turn}
Then have it drain out the remainder of her TP.
Switch off the Extra Turn Switch. Apply rest of the skill's effects.


It's making it last for X that's tripping me up.
The problem is that there doesn't appear to be a method to have the duration of a State last for a variable.
 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to JS Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

AirshipCanon

Veteran
Veteran
Joined
Oct 27, 2015
Messages
54
Reaction score
10
First Language
English
I've moved this thread to JS Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.
It...wasn't in the wrong place though.

It was general.

I'm using a plugin, but it's not the plugin I'm requesting support with. It's the rest of it. (I can work what I need to with the plugin just fine. It's after the plugin's work [which really is just creating a variable to work with] is done where I'm getting lost [converting said variable into a state duration (I mean I might need a plugin for that, but...)].)
 
Last edited by a moderator:

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
275
First Language
German
Primarily Uses
I haven't been using JavaScript much yet and can't verify this code right now either, so I can't promise it will work:

var actor = $gameActors.actor(ActorID);

actor._stateTurns[StateID] = $gameVariables.value(VariableID);
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
It...wasn't in the wrong place though.

It was general.

I'm using a plugin, but it's not the plugin I'm requesting support with. It's the rest of it.
You're wrong, because the default cannot make the duration of a state variable in that way, so you'll need either an additional plugin as a solution or a modification/add-on to yanfly's Plugins.

But your problem can't be solved without a plugin
 

AirshipCanon

Veteran
Veteran
Joined
Oct 27, 2015
Messages
54
Reaction score
10
First Language
English
While cracking my brain over this, I may have figured it out:

State doesn't clear itself.

Have a conditional Battle Event set to run at the end of every turn [Turn 0+X, Turn End, Span Turn]

Conditional Branch:
If [Character] is [state] Then:
Variable [Turn Counter]=+1
Nested Branch: If Turn Count = [X] Then:
Remove State Character [state]
Turn Counter = 0

Tested it a few times at different values, it works AFICT.
Solved my own problem with Events.

Of course, that needs to be in any battle where that character can be in, so either mass copypasta, or another plugin [of which, Yanfly has].
 
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

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
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top