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

 Username:
 Password:
   Not a member? Register!



Home > RGSS Script Reference > Arrow_Actor

Arrow_Actor


Inherits from: Arrow_Base

Description: This class defines the behavior of the cursor when pointing at an actor in battle.

Code

class Arrow_Actor < Arrow_Base
# ------------------------------------
  def actor
    return $game_party.actors[@index]
  end
# ------------------------------------
  def update
    super
    if Input.repeat?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @index += 1
      @index %= $game_party.actors.size
    end
    if Input.repeat?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @index += $game_party.actors.size - 1
      @index %= $game_party.actors.size
    end
    if self.actor != nil
      self.x = self.actor.screen_x
      self.y = self.actor.screen_y
    end
  end
# ------------------------------------
    def update_help
    @help_window.set_actor(self.actor)
  end
end

Properties

This class has no properties.

Methods


Actor

Arguments: None
Local Variables: None

How it Works: This method returns the name of the actor in the specified position in the current party. For instance, if the party order is (A, B, C, D), and the current index is 1, then the actor method will return B.

Update

Arguments: None
Local Variables: None

How it Works: This method processes input from the player that moves the arrow cursor. If the engine detects that the player has pressed the left arrow, the value of @index is decremented. If the right arrow is pressed, the value of @index is incremented. In either case, if index falls outside the values 0..[party_size-1], the cursor will "wrap around" to 0 or party_size-1 in accordance with the statement
@index %= $game_party.actors.size
After executing this statement, the final part of the method updates the arrow's coordinates.

Update_Help

Arguments: None
Local Variables: None

How it Works: This method updates the help window with the name of the currently selected actor.


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