State Name Cycling

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
So do you know how XP shows only one state on enemies and actors alike? I know the state icons script exist, but I want to keep the [State Name] but have it cycle through all of them. There is this script by Atoa that does something similar but does it for the state animations instead. I would like them to be compatible and ideally in unison so the name and animations changes at the same time.

Code:
#==============================================================================
# Atoa State Cycling
# by Atoa
#==============================================================================
module Atoa
  # Increase the time between the animation change.
  State_Cycle_Time = 4
end

#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
  #--------------------------------------------------------------------------
  include Atoa
  #--------------------------------------------------------------------------
  attr_accessor :state_animation_id
  #--------------------------------------------------------------------------
  alias atoa_state_initialize initialize
  def initialize
    atoa_state_initialize
    @state_frame = @state_animation_id = 0
    @anim_states = []
  end
  #--------------------------------------------------------------------------
  def state_animation_id
    return 0 if @states.empty?
    return 0 if @states.include?(1)
    @state_frame -= 1 if @state_frame > 0
    return @state_animation_id if @state_frame > 0
    if @anim_states.empty?
      for state in @states
        @anim_states << state if $data_states[state].animation_id > 0
      end
    end
    now_state = @anim_states.shift
    return 0 if now_state.nil?
    @state_animation_id = $data_states[now_state].animation_id
    return 0 if $data_animations[@state_animation_id].nil?
    @state_frame = $data_animations[@state_animation_id].frame_max * State_Cycle_Time * 2
    return @state_animation_id
  end
end
 
Joined
Oct 26, 2018
Messages
32
Reaction score
4
First Language
English (AUS)
Primarily Uses
RMXP
You'll want to tinker around with the Window scripts, specifically Window_Base.

You will need to edit the defs draw_actor_state and make_battler_state_text to get what you want.
I'm not much of an expert of THAT, but I know that that's where you'll want to be working.
 

Enigmo

Villager
Member
Joined
Jul 5, 2019
Messages
11
Reaction score
0
First Language
Bulgarian
Primarily Uses
RMVX
I might be able to help you out. Are you using any other addons for the battle system?
Anything more specific?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.
Why is there so much month left at the end of money? D=
Hello humans! How goes your day in this journey of living? I hope it is good, for I am human like you, and I am feeling great! Worship the altar.

Forum statistics

Threads
105,629
Messages
1,015,090
Members
137,290
Latest member
LilleB
Top