Submit Your Article Guild Wars 2 Forum RPG Maker VX.com
 
RPG Maker
 

 Username:
 Password:
   Not a member? Register!



Home > RGSS Script Reference > Scene_Status

Scene_Status


Inherits from: None

Description: This class contains the windows for the character status screen that can be accessed from the main menu.

Code


class Scene_Status
# ------------------------------------
 def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
# ------------------------------------
  def main
    @actor = $game_party.actors[@actor_index]
    @status_window = Window_Status.new(@actor)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @status_window.dispose
  end
# ------------------------------------ 
  def update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(3)
      return
    end
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Status.new(@actor_index)
      return
    end
    if Input.trigger?(Input::L)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Status.new(@actor_index)
      return
    end
  end
end

Properties


Actor_Index: The relative position within the party of the actor whose status is being viewed.

Actor: The absolute ID of the actor whose status is being viewed.

Status_Window: A Window_Status object that shows the actor's status.

Methods


Initialize

Arguments: None
Local Variables: None

How it Works: This method sets the relative party position of the actor whose status is being viewed to the value passed to this method.

Main

Arguments: None
Local Variables: None

How it Works: This is the main method for this class. It processes the update, and disposes of the object. First, the absolute ID of the actor whose status is being viewed is set using the actor index acquired during initialization. Next, the status window is initalized. The main loop updates the graphics, checks for input, and updates the window in response to user input. Once the value of $Scene has changed (when the user leaves the status menu), the final part of the method disposes of the status window.

Update

Arguments: None
Local Variables: None

How it Works: This method responds to user input from the status window. If the user input is "B" (cancel key), then the cancel sound effect is played, and control is transferred back to the menu. If the user input is "R", then the cursor sound effect is played, and the actor index is incremented. The method then takes the modulous of the current index and the party size to see what the new index should be. A new status window is then created with the new actor index. If the user input is "L", then the cursor sound effect is played, and the actor index is decremented. The method then does the same as above to determine the new index. A new status window is then created with the new actor index. 
Syntax
@
@@
$
alias
[array index]
attr_accessor
attr_reader
attr_writer
class
def
do
ensure
for
if
[iterator]
key => value
new
next
nil
redo
require
return
rescue
self
super
undef
unless
until
while
yield

Classes
Arrow_Actor
Arrow_Base
Arrow_Enemy
Game_Actor
Game_Actors
Game_BattleAct
Game_Battler
Game_Character
Game_Common
Game_Enemy
Game_Event
Game_Map
Game_Party
Game_Picture
Game_Player
Game_Screen
Game_SlfSwitch
Game_Switches
Game_System
Game_Troop
Game_Variables
Interpreter
Scene_Debug
Scene_End
Scene_Equip
Scene_File
Scene_Gameover
Scene_Item
Scene_Load
Scene_Map
Scene_Menu
Scene_Name
Scene_Save
Scene_Shop
Scene_Skill
Scene_Status
Scene_Title
Sprite_Battler
Sprite_Character
Sprite_Picture
Sprite_Timer
Spriteset_Battle
Spriteset_Map
Window_Base
Window_Battleresult
Window_Battlestatus
Window_Command
Window_DebugLeft
Window_DebugRight
Window_EquipItem
Window_EquipLeft
Window_EquipRight
Window_Gold
Window_Help
Window_InputNumb
Window_Item
Window_MenuStatus
Window_Message
Window_NameEdit
Window_NameInput
Window_PartyCom
Window_PlayTime
Window_SaveFile
Window_Selectable
Window_ShopBuy
Window_ShopCom
Window_ShopNum
Window_ShopSell
Window_ShopStatus
Window_Skill
Window_SkillStatus
Window_Status
Window_Steps
Window_Target

Other
Class Hierarchy
Global Variables


RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

RPG RPG Revolution is an Privacy Policy and Legal