RPG Script reference

TURBU

RPG Script reference

 

This section describes the variables, object types, and routines that have been written thus far for the RPG Script engine.

DISCLAIMER:  RPG Script and the TURBU engine are both under development.  Nothing here is guaranteed to remain the same in future releases as it is now, and several properties and routines described here have not yet been fully implemented.

 

Global variables:

The following variables are directly available from the scripting system:

Name Type Description
Switch array of boolean This array contains a group of boolean values which can be set to true or false in scripts throughout the game.
variable array of integer This array contains a group of integer values which can be set to any valid number in scripts throughout the game.
party  

TRpgParty This object refers to the currently active party. hero Array of TRpgHero This array contains a group of Hero objects, one for each Hero entry in the project's database. event Array of TRpgEvent This array refers to the various events on the map. thisEvent TRpgEvent Refers to to the TRpgEvent object whose scipt is currently running. timer TRpgTimer This object refers to the in-game timer. menuEnabled boolean Flag controlling whether or not the user can access the system menu. image Array of TRpgImage This array contains a group of Image objects. Its length is fixed at 20 slots

 

Object types:

The following classes (types of objects) are used in the scripting system.  Following the established Object Pascal conventions, all object types begin with a T.  Objects contain variables, known as "properties," and routines, known as "methods."  The page for each object below will show a list of all the properties and methods that each type of object in the RPG Script scripting system contains.

 

TRpgHero: Object representing a hero.

TRpgParty: Object representing the active party.

TRpgEvent: Object representing an event on the map.

TRpgTimer: Object representing the in-game timer.

TRpgInventory:  Object representing the party's inventory.

TRpgVehicle:  Object representing an in-game vehicle.

TRpgImage:  Object representing an on-screen image.

 

Global routines:

The following routines are available directly from the scripting system, without being members of any class.

 

random: Generates a random number.

showMessage: Displays an in-game message box

messageOptions: Sets various options for the in-game message box.

setPortrait: Sets the current portrait (face graphic) to be displayed in the message box.

clearPortrait: Sets the message box to not display a portrait.

showChoice: Shows a choice in the message box.

inputNumber: Uses the message box to input a number from the user.

heldItems: Checks to see how many of a certain item the party has.

heroJoin: Adds a hero to the party.

heroLeave: Removes a hero from the party.

addItem: Adds items to the inventory.

removeItem: Removes items from the inventory.

addExp: Adds experience to heroes.

removeExp: Removes experience from heroes.

addLevels: Adds levels to heroes.

removeLevels: Removes levels from heroes.

setSystemMusic: Changes the system background music for various events.

setSystemSound: Changes the preset system SFX for various events.

setSkin: Changes the current system "skin" graphics set.

battle: Begins a battle.  (Not yet implemented)

prepareStore: Sets up a store inventory for the shopping system to use.

shop: Opens the shopping system.

inn: Calls the inn. (Partially implemented)

buttonStart: Checks to see if the current event script was started by pressing the action button.

openMenu: Opens the system menu.

inputText: Allows the user to enter a text string. Commonly used for entering a custom hero name.

rideVehicle: Causes the party to board/leave a vehicle.

teleport: Teleports the current party to another location. (Partially implemented.)

memorizeLocation: Stores the current party's location in three variables. (Slightly bugged.)

teleportVehicle: Teleports a specified vehicle to another location.

teleportEvent: Teleports a specified event to another location on the map.

swapEvents: Exchanges the position of two events on the map.

getTerrainID: Returns the ID # of the map terrain at a certain square.

getEventID: Returns the ID # of the event at a certain square.

eraseScreen: Clears the screen, optionally using a system transition.

showScreen: Restores the screen after an erase, optionally using a system transition.

setTransition: Changes the default transition settings.

setScreenTone: Changes the overall color of the screen. (Partially implemented.)

flashScreen: Flashes a certain color over the screen.

lockScreen: Locks the current screen position.

unlockScreen: Unlocks the current screen position.

panScreen: Pans the screen from the current camera position.

panScreenTo: Pans the screen to a certain position.

returnScreen: Causes the screen to return to the current party.

setWeather: Sets the current weather effect.

increaseWeather: Increases the severity of the current weather effect.

decreaseWeather: Decreases the severity of the current weather effect.

newImage: Sets up a new on-screen image.

showBattleAnim: Displays a battle animation on-screen.

playMusic: Changes the background music.

fadeOutMusic: Causes the background music to gradually fade out.

memorizeBgm: Causes the system to remember the current background music.

playMemorizedBgm: Causes the system to play previously memorized background music.

playSound: Plays a sound effect.

prepareRoute: Sets up a new move script for characters to use.

waitUntilMoved: Pauses the script until all characters have finished their move scripts.

stopMoveScripts: Cancels all active move scripts.

wait: Pauses the script execution.

keyScan: Checks to see if any commands are being entered from the keyboard.

setBGImage: Changes the current background image.

deleteCharacter: Removes the character the current script is attached to from the map entirely.

callGlobalEvent: Causes a global event to run.

callEvent: Causes an event from the current map to run.

This help file was created with the free trial version of HelpScribble.