Script to Manually end an actor turn in battle

Hi there, I have a small but seemingly easy script request that I can't find the answer to.

I have a timer parallel processing event,
when this timer reaches zero, I'd like to call a script that ends the actor turn instantly, ignoring any inputs (the actor skips his turn)

I have no idea how to do it. Could anyone help in this way?
What turn order you're using? Default? ATB? FTB? Or other turn order?
Is it specific for a single actor? or do you mean party turns?
What turn order you're using? Default? ATB? FTB? Or other turn order?
Is it specific for a single actor? or do you mean party turns?

Single actor, default turn order.
Is it possible?
Code:
class Scene_Battle
  def force_turn_start
    @actor_window.hide
    @enemy_window.hide
    @skill_window.hide
    @item_window.hide
    turn_start
  end
end
I'm not even sure if this will work, but anyway the script call is
Code:
SceneManager.scene.force_turn_start
Code:
class Scene_Battle
  def force_turn_start
    @actor_window.hide
    @enemy_window.hide
    @skill_window.hide
    @item_window.hide
    turn_start
  end
end
I'm not even sure if this will work, but anyway the script call is
Code:
SceneManager.scene.force_turn_start

It causes a crash sadly... Thanks for the help though.
battler.clear_actions.

should cancel the action and move on but I can't remember if it would end *the turn*. The default system has it's particular shenanigans.
ARE you using the default system? if not, you'll have to refer to your system's manual
When is this timer running? Is it during the player's action selection? Or is it already during the action processing?

If its during the selection, Theo's should (Theo-retically) work. What error message did you get during the crash?

If its already during processing, gtsv's should clear the actor's action such that he will do nothing when his turn starts
... (the actor skips his turn) ...
There is no such thing as an "actor's turn" in the default battle system. The party itself got a turn, but that is not separated by individual actor turns in regards of command inputs. This alone makes your request more complicated than you think it is.
If your party will never have more than one actor during battles, it's fairly simple, but if that's not the case, you will have to provide more details on what happens with the other actors in the party during command selection, more specifically, what happens after this "command skip" triggers in regards to the command selection itself.
By default, the player can cancel all actions inputted for all actors as long as the player didn't select the action of the last party member. This would have to be changed for your request, for example.

Spoiler
Hi there, I have a small but seemingly easy script request that I can't find the answer to.
...
I have no idea how to do it.
Don't do this, please...
How could you know if it's easy or small if you have no idea how to do it?
I don't want to sound rude, but lines like these will put off even the most helpful people sooner or later, myself included, and I see a lot of these around here nowadays.
Just an advice (not just for you, but for anyone asking for help):
Leave the "small", "simple" and "easy" assumptions out if you need help with something, not just here, but in any other situations.
There is no such thing as an "actor's turn" in the default battle system

ahem.....
there is, indirectly, controlled by three different functions.
there's no specification to *an* actor's turn, but rather *a* turn, that is assigned after shuffling the battle order according to attack speed.
you could potentially sneak a check in that shuffling, to condition the actor's turns to the timer being up, but that wouldn't *stop* the turn, only prevent a next turn once the timer is down.
If you would have read the whole paragraph, you would know that I wrote about the command selection part specifically which should be the thing that needs to be skipped based on the request itself, unless I misunderstood something which is possible with a not really detailed request.

By default, nothing blocks the player to cancel the already selected actor commands and change them, and that being the case, it will have to be changed.
by how the request is worded, I assume the author wants to stop *the processing* of the turn, not *the selection* of actions.
pre-select the actions, run the turn, and if and/or when a timer runs out, stop that turn mid-way.
that's what you can't do by default, because the processing of the turn runs in it's own loop and has no watch for the player's input.

I believe this request comes up from the fact that if the timer stops it won't alter the scene until a running turn has finished, OR, from the fact that battle-event-driven processes *tied* to that timer also won't happen mid-turn.

Code:
class Game_Timer
 def on_expire
  BattleManager.abort
 end
end

module BattleManager
def self.abort
 @phase = :aborting
 end
 def self.aborting?
  @phase == :aborting
 end
 def self.judge_win_loss
   if @phase
     return process_abort   if $game_party.members.empty?
     return process_defeat  if $game_party.all_dead?
     return process_victory if $game_troop.all_dead?
     return process_abort   if aborting?
   end
   return false
 end
end

class Scene_Battle
 def update
  super
   if BattleManager.in_turn?
     process_event
     process_action
   end
   BattleManager.judge_win_loss
 end
end

timer runs out, raises flag for abort, battle manager checks for abort through win/loss check, which happens right at the end of the process.


Code:
  def process_action
    return if scene_changing?
    if !@subject || [email protected]_action
      @subject = BattleManager.next_subject
    end
    return turn_end unless @subject
    if @subject.current_action
      @subject.current_action.prepare
      if @subject.current_action.valid?
        @status_window.open
        execute_action
      end
      @subject.remove_current_action
    end
    process_action_end unless @subject.current_action
  end

battler.clear_actions drops subject.current_action, since current_action is actions[0], and by dropping actions[] clean, current_action drops, which drops process_action, which drops the turn, which drops the whole loop.
(hopefully without dropping the whole game in the process 😀 )

Original thread: https://forums.rpgmakerweb.com/threads/script-to-manually-end-an-actor-turn-in-battle.106453/