Resetting Actor Turn on State Removal

Ruin

Veteran
Veteran
Joined
Apr 26, 2013
Messages
36
Reaction score
0
First Language
English
Primarily Uses
Hey guys,

There is a state in my game that changes the actors' command set in the actor command window.  When the state is removed, the affected actor's command set should return to normal.  This wouldn't be difficult if I was using the normal battle system, but I'm using an active time battle system.  This means that the state could be removed while an affected actor currently has a turn (while the player is selecting from the actor command window).  

I was wondering therefore what a good solution would be for refreshing the actor's turn when this state is removed?  As far as I know there's no "on state remove" event I can link up to.  Thanks for any help you can provide!

EDIT: I should note this goes the same for the opposite scenario where the state is added to an actor while it is their turn.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
please link to the scripts you're using for the battlesystem and to change the commands - no one can answer your questions without that info, because it completely depends on how those scripts work.
 

Ruin

Veteran
Veteran
Joined
Apr 26, 2013
Messages
36
Reaction score
0
First Language
English
Primarily Uses
Well to simplify the problem all I really would like to know is if there's a simple/elegant way to refresh the currently active actor's turn (close any open selection windows and redraw/activate the actor command window) and a simple way to have a method run when a state is added or removed.  Knowing how to do this for the default engine would be fine.

So far the best solution I've come up with is to add a method I'm calling "update_for_state_change" to the update_basic method that checks whether the status has been added/removed each frame, and if so redraws/refreshes the actor command window and closes all possible open selection windows/reactivates the command window.  Doing it every frame seems excessive though.  
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
sorry, no - that is not simplifying because you didn't realise the problem with that.


Such an effect can never be done in default battle, because in default battle the command selection is NOT part of the turn processing. In default, all commands are selected/put in before the first action is checked and processed, and any removal or adding of any state happens in a different sequence from where there is no way back to the command selection. The default command selection will only be available for the next turn.


Something that does not exists during turn processing cannot be updated.


Your battlescript changed the entire turn structure to allow you to select commands on active time between processings. If you want such a function that could be written, but it needs to be written specifically for the changed turn sequence of your battle script, and it will never work for other battlescripts.


That is why you need to give the links before anything can be done.
 

Ruin

Veteran
Veteran
Joined
Apr 26, 2013
Messages
36
Reaction score
0
First Language
English
Primarily Uses
I've managed that part on my own at this point (it was a matter of redrawing/activating windows as opposed to anything involving turn processing).  The more important question is if there is a way to have a method run when a state is added or removed without checking for it every frame?
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Well, since you don't want to share what scripts you're using, I guess I'll have to generalize a bit relying on the script that I use.

I would add a method to the skill processing that would check the skills target on-hit to see if their stamina is full.

If so, initiate an automatic pass on that character and lower their stamina by about 10 or so.

Once that is done, they won't be able to input a command and the rest should be doable with less trouble.

I use a heavily modified version of Fomar's ATB script and have many states in place that affect the flow of the stamina bar.

Don't know if that will help, but it's what I would do.
 

Ruin

Veteran
Veteran
Joined
Apr 26, 2013
Messages
36
Reaction score
0
First Language
English
Primarily Uses
Well, since you don't want to share what scripts you're using, I guess I'll have to generalize a bit relying on the script that I use.

I would add a method to the skill processing that would check the skills target on-hit to see if their stamina is full.

If so, initiate an automatic pass on that character and lower their stamina by about 10 or so.

Once that is done, they won't be able to input a command and the rest should be doable with less trouble.

I use a heavily modified version of Fomar's ATB script and have many states in place that affect the flow of the stamina bar.

Don't know if that will help, but it's what I would do.
Thanks for the response :D .  That would definitely work in the event of adding the state, but not for its removal, which could theoretically occur at any time (I may not have mentioned this).  That's why I'm currently still having to check every frame to see if the state has removed.

Regarding my code, it's code I wrote and don't want to post publicly.  I assure you it's not relevant to the problem however or I'd provide it.
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
You can't code a forced action in there?

If you could auto-pass, I'd think that would do the trick.
 

Ruin

Veteran
Veteran
Joined
Apr 26, 2013
Messages
36
Reaction score
0
First Language
English
Primarily Uses
You can't code a forced action in there?

If you could auto-pass, I'd think that would do the trick.
Not sure I understand.  There's not a skill removing the state, it just times out.  What would I code the forced action onto?  I was hoping there would be a way to attach code to the state that would run on removal, but that's what I'm not sure of.
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Well if that's what you want, you can use Yanfly's Lunatic States Script to do it.

It's has settings you can use to apply code whenever a specific state is added, removed naturally, or removed forcefully (via skill or item).

That might be enough to help solve this.

(And since you're good at coding, using this script shouldn't be hard for you at all.)
 

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

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,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top