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.

[Resolved] Accessing varibles in a script

OK i am using this script http://hometown.aol.com/Der%20VVulfman/Files/RPGMaker/XP/Scripts/Vehicle.txt

when you enter a vehicle HQ its location is stored using variables. i want to know how to access those variables to create an event that only works if those variables are a certain value.

i need them because in my game i want it so that inside some vehicles there is a teleporter and if the vehicle is at a certain location, such as above a town, when the player enters the HQ then the teleporter will transport the player into the town. if the vehicle is not in the right place then the teleporter will not work. I also want to make a similar event within the town for returning to the vehicle.
 
As far as I can see, the script tells it all...
Code:
attr_accessor :vehicle_movex            # vehicle position save array (x)        
attr_accessor :vehicle_movey            # vehicle position save array (y)

You can access those with $game_system.vehicle_movex and $game_system.vehicle_movex as long as you're going with the default Title initialization.
 
Well, that depends on how you want your event to work... I didn't understand your explanation of that really, but either way, you can use the Call Script event command (last event page, if I remember correctly) to execute script commands within events, or use the Script line in conditionals to check for code... which might be what you need. Just make a new conditional checking for Script: "your_x_value == $game_system.vehicle_movex" (without the quotation marks).
 

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