RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Variable List

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 89
I am yourself!
Hi everybody!
Do you mind if we should make a list of variable used in standard RGSS?
It WILL help many beginner scripter.

As a start, I'll enlist some...

Code: [Select]
$game_variables[variable_id] #connect to event-system variables
$game_switches[switch_id] # connect to event-system switch
$game_party.actors[actor_id] # connect to current party member (the one you played)

Any donation will be appreciated... Thanx
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

***
Rep:
Level 90
Here're some :)
Code: [Select]
$game_map.events # Events
$game_map.map_id # current map id
$game_party.gold # gold
$game_party.actors[0].name # hero's name

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I'm a little confused as to this. This is a little strange. I'd probably be more thorough for one member to do it.
Anyway, here are a few
Code: [Select]
$data_troops[troop id] # database troops
$data_troops[troop id].members[member index]
$data_system
(for most datas, there's a game too)
$game_system
$game_temp
$game_self_switches[Map ID, Event ID, Whichever one it is ("A","B","C","D")]
$game_screen

Meh, I don't know how common it is to use such things, but meh, that is kind of why I'm not sure what I am supposed to be listing...

***
Rep:
Level 89
I am yourself!
Additional:
Code: [Select]
$game_party.actors[actor_id].maxhp #Party's max HP
$game_party.actors[actor_id].maxsp #Party's max SP
$game_party.actors[actor_id].hp #Party's current HP
$game_party.actors[actor_id].sp #Party's current SP
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
The help file already contains a lot of this information.
At least special version I got. Just look under Advanced Scripting in Introduction to Scripting

***
Rep:
Level 89
I am yourself!
No, no...
It's just a list of pre-defined variables on RGSS, not the tute.
Can you give some?
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
A pic from the help file.
There's also a similar page for Game Objects.

You can see what they are instances of and then it's just to click on the links to go to the other place in the help file where the rest stands ^_^
You can for example click on RPG::System and you come to a page explaining which functions there are and what they do ^_^
Much quicker and better than a static list in my opinion.

Spoiler for RPG::System (Definition from help file):
Code: [Select]
module RPG
  class System
    def initialize
      @magic_number = 0
      @party_members = [1]
      @elements = [nil, ""]
      @switches = [nil, ""]
      @variables = [nil, ""]
      @windowskin_name = ""
      @title_name = ""
      @gameover_name = ""
      @battle_transition = ""
      @title_bgm = RPG::AudioFile.new
      @battle_bgm = RPG::AudioFile.new
      @battle_end_me = RPG::AudioFile.new
      @gameover_me = RPG::AudioFile.new
      @cursor_se = RPG::AudioFile.new("", 80)
      @decision_se = RPG::AudioFile.new("", 80)
      @cancel_se = RPG::AudioFile.new("", 80)
      @buzzer_se = RPG::AudioFile.new("", 80)
      @equip_se = RPG::AudioFile.new("", 80)
      @shop_se = RPG::AudioFile.new("", 80)
      @save_se = RPG::AudioFile.new("", 80)
      @load_se = RPG::AudioFile.new("", 80)
      @battle_start_se = RPG::AudioFile.new("", 80)
      @escape_se = RPG::AudioFile.new("", 80)
      @actor_collapse_se = RPG::AudioFile.new("", 80)
      @enemy_collapse_se = RPG::AudioFile.new("", 80)
      @words = RPG::System::Words.new
      @test_battlers = []
      @test_troop_id = 1
      @start_map_id = 1
      @start_x = 0
      @start_y = 0
      @battleback_name = ""
      @battler_name = ""
      @battler_hue = 0
      @edit_map_id = 1
    end
    attr_accessor :magic_number
    attr_accessor :party_members
    attr_accessor :elements
    attr_accessor :switches
    attr_accessor :variables
    attr_accessor :windowskin_name
    attr_accessor :title_name
    attr_accessor :gameover_name
    attr_accessor :battle_transition
    attr_accessor :title_bgm
    attr_accessor :battle_bgm
    attr_accessor :battle_end_me
    attr_accessor :gameover_me
    attr_accessor :cursor_se
    attr_accessor :decision_se
    attr_accessor :cancel_se
    attr_accessor :buzzer_se
    attr_accessor :equip_se
    attr_accessor :shop_se
    attr_accessor :save_se
    attr_accessor :load_se
    attr_accessor :battle_start_se
    attr_accessor :escape_se
    attr_accessor :actor_collapse_se
    attr_accessor :enemy_collapse_se
    attr_accessor :words
    attr_accessor :test_battlers
    attr_accessor :test_troop_id
    attr_accessor :start_map_id
    attr_accessor :start_x
    attr_accessor :start_y
    attr_accessor :battleback_name
    attr_accessor :battler_name
    attr_accessor :battler_hue
    attr_accessor :edit_map_id
  end
end