State Name Cycling

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
330
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
9
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

Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
Ah! Another nice "clear day" in....
//Smacks a nearby fleshy mass
No you! Me time, not you time! :kaolivid:
//Looks back
Where was I? Oh yes, another...
//deep breath and coughs
...nice clear day in Silent Hill. :LZSexcite:
Finally logged back to my RM central account... it's been a while.
2018 joining project as scripter*
Owner "Check it out, got all the YEP plugins!!!
2020 joining project as scripter*
Owner "Sorry, I keep meaning to get rid of these..."

Forum statistics

Threads
103,460
Messages
999,473
Members
134,999
Latest member
Azadwarf
Top