Script Classes for Adventure Games/Global Variables

From SCI Wiki
Jump to: navigation, search

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Index


Global Variables

Author: Jeff Stephenson

Date: 5 April 1988

 


Global Variables

Global variables 0 through 49 are reserved for use by the system classes. Game-specific global variables start at 50. The following global variables are defined by the system. For up to date global list see s:system.sh.

ego

The ID of a static instance of class Ego defined in game.sc. This is the protagonist of the game.

curRoom

The ID of the current Room.

userFont

The number of the font to be used in Print statements, etc. Default is 1. Set it to the font you wish to use in the init: method of your Game, or change it at will in the game.

cast

The ID of a Set of Actors and Egos which constitutes the characters on the screen.

quit

The main loop of the game is
Code:
(while (not quit)
     (theGame doit:)
     (Wait speed)
)
so setting quit to TRUE breaks out of the main loop and terminates the game.

addToPics

A Set of PicViews which have been added to the current picture.

debugOn

A generic debugging flag. I usually have a Debug menu item to set it, and trigger any debug display that I want off of it, rather than creating a special trigger whenever I want to debug something.

sounds

The Set of Sounds currently playing.

inventory

The ID of the Inventory class or instance which is the Set of all InvItems (inventory items) in the Game. Inventory related issues are not well defined yet...

theGame

The ID of the Game instance.

regions

The Set of Regions currently in effect.

curRoomNum

The number of the current Room.

prevRoomNum

The number of the previous Room. (So you know how you got where you are.)

newRoomNum

Used by a Room to signal to the Game that it should change to a new Room.

showStyle

The global style for the transition from one picture to another. This may be overridden by the style property of a given room. See the DrawPic kernel function for the possible styles.

aniInterval

The number of ticks it took to do the last animation cycle. This is used to test animation speed on a particular machine.

speed

The number of ticks between animations. This is set, usually as a menu option, to determine the speed of animation. The default is 6.

timers

The List of timers in the game.

score

The player's current score.

possibleScore

The games highest possible score.

theCursor

The number of the current cursor.

normalCursor

Number of normal cursor form.

waitCursor

Cursor number of "wait" cursor.

smallFont

Small font for save/restore, etc.

lastEvent

The last event (used by save/restore game).

modelessDialog

The modeless Dialog known to User and Intrface.

bigFont

The number for a large font.

volume

Sound volume on supported machine.

version

The SCI version string.

locales

Set of current locales.

curSaveDir

Address of current save drive/directory string.

aniThreshold

perspective

The Player's viewing angle. This is set according to the Rooms picAngle property. Degrees away from vertical along y axis.

features

Locations that may respond to events.

sortedFeatures

The features and cast sorted by "visibility" to ego.

useSortedFeatures

If TRUE enable cast & feature sorting.

egoBlindSpot

Used by sortCopy for sortedFeatures to exclude actors behind ego within angle from straight behind. Default zero is no blind spot.

overlays

The overlay List.

doMotionCue

A motion cue has occured - process it. The Games doit method gives the motionCue: message to each element of the cast if this is set to TRUE.

systemWindow

ID of standard system window. If you wish to supply your own window for system messages set this to the ID of your window.

lastSysGlobal

Defines the end of Global variable space.

 

Notes


 

Table of Contents

 

< Previous: The Code Class Next: Index >