Difference between revisions of "Script Classes for Adventure Games/Global Variables"

From SCI Wiki
Jump to navigationJump to search
(Created page with "Official SCI Documentation<br /> <div align="center"> Chapter: 1 | 2...")
 
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
Chapter:  
 
Chapter:  
 
[[Script Classes for Adventure Games/Introduction|1]] |  
 
[[Script Classes for Adventure Games/Introduction|1]] |  
[[Script Classes for Adventure Games/RootObj|2]] |  
+
[[Script Classes for Adventure Games/RootObj Class|2]] |  
[[Script Classes for Adventure Games/Object|3]] |  
+
[[Script Classes for Adventure Games/Object Class|3]] |  
[[Script Classes for Adventure Games/Collection|4]] |  
+
[[Script Classes for Adventure Games/Collection Class|4]] |  
[[Script Classes for Adventure Games/List|5]] |  
+
[[Script Classes for Adventure Games/Script Class|5]] |  
[[Script Classes for Adventure Games/Set|6]] |  
+
[[Script Classes for Adventure Games/Timer Class|6]] |  
[[Script Classes for Adventure Games/EventHandler|7]] |  
+
[[Script Classes for Adventure Games/Feature Class|7]] |  
[[Script Classes for Adventure Games/Inventory|8]] |  
+
[[Script Classes for Adventure Games/View Class|8]] |  
[[Script Classes for Adventure Games/Script|9]] |  
+
[[Script Classes for Adventure Games/PicView Class|9]] |  
[[Script Classes for Adventure Games/Timer|10]] |  
+
[[Script Classes for Adventure Games/Cycling Classes|10]] |  
[[Script Classes for Adventure Games/Feature|11]] |  
+
[[Script Classes for Adventure Games/Motion Classes|11]] |  
[[Script Classes for Adventure Games/View|12]] |  
+
[[Script Classes for Adventure Games/Avoider Class|12]] |  
[[Script Classes for Adventure Games/Prop|13]] |  
+
[[Script Classes for Adventure Games/Event Class|13]] |  
[[Script Classes for Adventure Games/Actor|14]] |
+
[[Script Classes for Adventure Games/User Class|14]]<br />
[[Script Classes for Adventure Games/Ego|15]] |
+
[[Script Classes for Adventure Games/Game Class|15]] |  
[[Script Classes for Adventure Games/PicView|16]] |
+
[[Script Classes for Adventure Games/Locale Class|16]] |  
[[Script Classes for Adventure Games/Cycle|17]] |
+
[[Script Classes for Adventure Games/Region Class|17]] |  
[[Script Classes for Adventure Games/Forward|18]] |
+
[[Script Classes for Adventure Games/Room Class|18]] |  
[[Script Classes for Adventure Games/Walk|19]] |
+
[[Script Classes for Adventure Games/Timer2 Class|19]] |  
[[Script Classes for Adventure Games/Reverse|20]] |
+
[[Script Classes for Adventure Games/InvItem Class|20]] |  
[[Script Classes for Adventure Games/CycleTo|21]] |
+
[[Script Classes for Adventure Games/Block Class|21]] |  
[[Script Classes for Adventure Games/EndLoop|22]] |
+
[[Script Classes for Adventure Games/Cage Class|22]] |  
[[Script Classes for Adventure Games/BegLoop|23]] |
+
[[Script Classes for Adventure Games/Sound Class|23]] |  
[[Script Classes for Adventure Games/Motion|24]] |
+
[[Script Classes for Adventure Games/StatusLine Class|24]] |  
[[Script Classes for Adventure Games/MoveTo|25]] |
+
[[Script Classes for Adventure Games/File Class|25]] |  
[[Script Classes for Adventure Games/Wander|26]]<br />
+
[[Script Classes for Adventure Games/Code Class|26]] |  
[[Script Classes for Adventure Games/Follow|27]] |
+
[[Script Classes for Adventure Games/Global Variables|27]] |  
[[Script Classes for Adventure Games/Chase|28]] |
 
[[Script Classes for Adventure Games/Jump|29]] |
 
[[Script Classes for Adventure Games/JumpTo|30]] |
 
[[Script Classes for Adventure Games/Orbit|31]] |
 
[[Script Classes for Adventure Games/Path|32]] |
 
[[Script Classes for Adventure Games/RelPath|33]] |
 
[[Script Classes for Adventure Games/Avoider|34]] |
 
[[Script Classes for Adventure Games/Event|35]] |
 
[[Script Classes for Adventure Games/User|36]] |
 
[[Script Classes for Adventure Games/Game|37]] |  
 
[[Script Classes for Adventure Games/Locale|38]] |  
 
[[Script Classes for Adventure Games/Region|39]] |  
 
[[Script Classes for Adventure Games/Room|40]] |  
 
[[Script Classes for Adventure Games/Timer2|41]] |
 
[[Script Classes for Adventure Games/TimeOut|42]] |  
 
[[Script Classes for Adventure Games/InvItem|43]] |  
 
[[Script Classes for Adventure Games/Block|44]] |  
 
[[Script Classes for Adventure Games/Cage|45]] |  
 
[[Script Classes for Adventure Games/Sound|46]] |  
 
[[Script Classes for Adventure Games/StatusLine|47]] |  
 
[[Script Classes for Adventure Games/File|48]] |  
 
[[Script Classes for Adventure Games/Code|49]] |  
 
[[Script Classes for Adventure Games/Global Variables|50]] |  
 
 
[[Script Classes for Adventure Games/Index|Index]]
 
[[Script Classes for Adventure Games/Index|Index]]
 
</div><br />
 
</div><br />
  
<div align="center"><span style="font-size: 22pt"></span><br />
+
<div align="center"><span style="font-size: 22pt">Global Variables</span><br />
 
''Author: [[Jeff Stephenson]]''<br />
 
''Author: [[Jeff Stephenson]]''<br />
 
''Date: 5 April 1988''</div>
 
''Date: 5 April 1988''</div>
Line 62: Line 39:
 
&nbsp;
 
&nbsp;
  
xxxxxxx body xxxxxxxx
+
==<br /> 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 ===
 +
<blockquote>The ID of a static instance of class Ego defined in game.sc. This is the protagonist of the game.</blockquote>
 +
 
 +
=== curRoom ===
 +
<blockquote>The ID of the current Room.</blockquote>
 +
 
 +
=== userFont ===
 +
<blockquote>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.</blockquote>
 +
 
 +
=== cast ===
 +
<blockquote>The ID of a Set of Actors and Egos which constitutes the characters on the screen.</blockquote>
 +
 
 +
=== quit ===
 +
<blockquote>The main loop of the game is
 +
 
 +
<blockquote><div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="sci">
 +
(while (not quit)
 +
    (theGame doit:)
 +
    (Wait speed)
 +
)
 +
</syntaxhighlight></blockquote>
 +
 
 +
so setting quit to TRUE breaks out of the main loop and terminates the game.</blockquote>
 +
 
 +
=== addToPics ===
 +
<blockquote>A Set of PicViews which have been added to the current picture.</blockquote>
 +
 
 +
=== debugOn ===
 +
<blockquote>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.</blockquote>
 +
 
 +
=== sounds ===
 +
<blockquote>The Set of Sounds currently playing.</blockquote>
 +
 
 +
=== inventory ===
 +
<blockquote>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...</blockquote>
 +
 
 +
=== theGame ===
 +
<blockquote>The ID of the Game instance.</blockquote>
 +
 
 +
=== regions ===
 +
<blockquote>The Set of Regions currently in effect.</blockquote>
 +
 
 +
=== curRoomNum ===
 +
<blockquote>The number of the current Room.</blockquote>
 +
 
 +
=== prevRoomNum ===
 +
<blockquote>The number of the previous Room. (So you know how you got where you are.)</blockquote>
 +
 
 +
=== newRoomNum ===
 +
<blockquote>Used by a Room to signal to the Game that it should change to a new Room.</blockquote>
 +
 
 +
=== showStyle ===
 +
<blockquote>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.</blockquote>
 +
 
 +
=== aniInterval ===
 +
<blockquote>The number of ticks it took to do the last animation cycle. This is used to test animation speed on a particular machine.</blockquote>
 +
 
 +
=== speed ===
 +
<blockquote>The number of ticks between animations. This is set, usually as a menu option, to determine the speed of animation. The default is 6.</blockquote>
 +
 
 +
=== timers ===
 +
<blockquote>The List of timers in the game.</blockquote>
 +
 
 +
=== score ===
 +
<blockquote>The player's current score.</blockquote>
 +
 
 +
=== possibleScore ===
 +
<blockquote>The games highest possible score.</blockquote>
 +
 
 +
=== theCursor ===
 +
<blockquote>The number of the current cursor.</blockquote>
 +
 
 +
=== normalCursor ===
 +
<blockquote>Number of normal cursor form.</blockquote>
 +
 
 +
=== waitCursor ===
 +
<blockquote>Cursor number of "wait" cursor.</blockquote>
 +
 
 +
=== smallFont ===
 +
<blockquote>Small font for save/restore, etc.</blockquote>
 +
 
 +
=== lastEvent ===
 +
<blockquote>The last event (used by save/restore game).</blockquote>
 +
 
 +
=== modelessDialog ===
 +
<blockquote>The modeless Dialog known to User and Intrface.</blockquote>
 +
 
 +
=== bigFont ===
 +
<blockquote>The number for a large font.</blockquote>
 +
 
 +
=== volume ===
 +
<blockquote>Sound volume on supported machine.</blockquote>
 +
 
 +
=== version ===
 +
<blockquote>The SCI version string.</blockquote>
 +
 
 +
=== locales ===
 +
<blockquote>Set of current locales.</blockquote>
 +
 
 +
=== curSaveDir ===
 +
<blockquote>Address of current save drive/directory string.</blockquote>
 +
 
 +
=== aniThreshold ===
 +
<blockquote></blockquote>
 +
 
 +
=== perspective ===
 +
<blockquote>The Player's viewing angle. This is set according to the Rooms picAngle property. Degrees away from vertical along y axis.</blockquote>
 +
 
 +
=== features ===
 +
<blockquote>Locations that may respond to events.</blockquote>
 +
 
 +
=== sortedFeatures ===
 +
<blockquote>The features and cast sorted by "visibility" to ego.</blockquote>
 +
 
 +
=== useSortedFeatures ===
 +
<blockquote>If TRUE enable cast & feature sorting.</blockquote>
 +
 
 +
=== egoBlindSpot ===
 +
<blockquote>Used by sortCopy for sortedFeatures to exclude actors behind ego within angle from straight behind. Default zero is no blind spot.</blockquote>
 +
 
 +
=== overlays ===
 +
<blockquote>The overlay List.</blockquote>
 +
 
 +
=== doMotionCue ===
 +
<blockquote>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.</blockquote>
 +
 
 +
=== systemWindow ===
 +
<blockquote>ID of standard system window. If you wish to supply your own window for system messages set this to the ID of your window.</blockquote>
 +
 
 +
=== lastSysGlobal ===
 +
<blockquote>Defines the end of Global variable space.</blockquote>
  
 
&nbsp;
 
&nbsp;
Line 75: Line 187:
 
&nbsp;
 
&nbsp;
  
<span style="float: left">[[Script Classes for Adventure Games/|&lt; Previous: ]]</span>
+
<span style="float: left">[[Script Classes for Adventure Games/Code Class|&lt; Previous: The Code Class]]</span>
<span style="float: right">[[Script Classes for Adventure Games/|Next: &gt;]]</span>
+
<span style="float: right">[[Script Classes for Adventure Games/Index|Next: Index &gt;]]</span>
  
 
&nbsp;
 
&nbsp;

Latest revision as of 02:21, 11 December 2015

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 >