Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

what is the proper way to call an event database variable vx

I decided to toy around in scripting for once and can't seem to figure out how to properly reference a variable from the game's database.

I'm essentially trying to use a variable from the set you can manipulate via normal eventing in an if statement. But I can't figure out how it is supposed to be referenced in rgss.
 
Start with Scene_Title.load_database,

Each of the database files gets loaded into a separate $data_* object.
The definitions of each object are in the help file (Game Library --> RPGVX Data Structure)

So, if you want to reference a specific actor's weapon_id...

$data_actors[3].weapon_id

In a "script" event command, check to see if the actors weapon id is greater than 12 (an advanced weapon)

if $data_actors[3].weapon_id > 12
## do something
end


In a "Conditional Branch", the "if" is implied, so you just need:

$data_actors[3].weapon_id > 12
 
in my case, i don't want to compare the id, i want to call on it to get the value stored in it and compare the value:

essentially:

get value of variable [0003]
if value of [0003] = 0
do this
end

all i want to do is be able with play with the variables you can control easily in the event editor.

I found $game_variables is loaded in the title screen, but i can't figure out how to use that to call on game_variable[003] specifically.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top