Functions

float InitD[] int GetCurScreen int GetCurDMapScreen int GetCurLevel int GetCurMap int GetCurDMap int DMapFlags[] int DMapLevel[] int DMapCompass[] int DMapContinue[] int DMapMIDI[] void GetDMapName void GetDMapTitle void GetDMapIntro int DMapOffset[] int DMapMap[] int NumDeaths int Cheat int Time bool TimeValid bool HasPlayed bool Standalone int GuyCount[] int ContinueDMap int ContinueScreen int LastEntranceDMap int LastEntranceScreen int Counter[] int MCounter[] int DCounter[] int Generic[] int LItems[] int LKeys[] int GetScreenFlags int GetScreenEFlags bool GetScreenState void SetScreenState float GetScreenD void SetScreenD float GetDMapScreenD void SetDMapScreenD itemdata LoadItemData void PlaySound void PlayMIDI int GetMIDI bool PlayEnhancedMusic void GetDMapMusicFilename int GetDMapMusicTrack void SetDMapEnhancedMusic int GetComboData void SetComboData int GetComboCSet void SetComboCSet int GetComboFlag void SetComboFlag int GetComboType void SetComboType int GetComboInherentFlag void SetComboInherentFlag int GetComboSolid void SetComboSolid int ComboTile void GetSaveName void SetSaveName void End void Save bool ShowSaveScreen void ShowSaveQuitScreen void GetMessage int GetFFCScript bool ClickToFreezeEnabled
Back to Top
Pages: Global | FFC | Link | Screen | Item | Weapon | Itemdata | Game | NPC | std | string

Game Functions and Variables Documentation

Functions and Properties

Return Type Function Information
floatInitD[]
The original values of the item's 8 D input values are they are stored in the
.qst file, regardles of whether they have been modified by ZScript.
intGetCurScreen()
Retrieves the number of the current screen within the current map.
intGetCurDMapScreen()
Retrieves the number of the current screen within the current DMap.
intGetCurLevel()
Retrieves the number of the dungeon level of the current DMap. Multiple
DMaps can have the same dungeon level - this signifies that they share
a map, compass, level keys and such.
intGetCurMap()
Retrieves the number of the current map.
intGetCurDMap()
Returns the number of the current DMap.
intDMapFlags[]
An array of 512 integers, containing the DMap's flags ORed (|) together.
Use the 'DMF_' constants, or the 'DMapFlag()' functions from std.zh if you are not comfortable with binary.
intDMapLevel[]
An array of 512 integers containing each DMap's level
intDMapCompass[]
An array of 512 integers containing each DMap's compass screen
intDMapContinue[]
An array of 512 integers containing each DMap's continue screen
intDMapMIDI[]
An array of 512 integers containing each DMap's MIDI.
Positive numbers are for custom MIDIs, and negative values are used for
the built-in game MIDIs. Because of the way DMap MIDIs are handled
internally, however, built-in MIDIs besides the overworld, dungeon, and
level 9 songs won't match up with Game->PlayMIDI() and Game->GetMIDI().
voidGetDMapName(int DMap, int buffer[])
Loads DMap with ID 'DMap's name into 'buffer'.
See std.zh for appropriate buffer size.
voidGetDMapTitle(int DMap, int buffer[])
Loads DMap with ID 'DMap's title into 'buffer'.
See std.zh for appropriate buffer size.
voidGetDMapIntro(int DMap, int buffer[])
Loads DMap with ID 'DMap's intro string into 'buffer'.
See std.zh for appropriate buffer size.
intDMapOffset[]
An array of 512 integers containing the X offset of each DMap.
Game->DMapOffset is read-only; while setting it is not syntactically
incorrect, it does nothing.
intDMapMap[]
An array of 512 integers containing the map used by each DMap.
Game->DMapMap is read-only; while setting it is not syntactically
incorrect, it does nothing.
intNumDeaths
The number of times Link has perished during this quest.
intCheat
The current cheat level of the quest player.
intTime
Returns the time elapsed in this quest, in 60ths of a second. The
return value is undefined if TimeValid is false (see below).
boolTimeValid
True if the elapsed quest time can be determined for the current quest.
boolHasPlayed
This value is true if the current quest session was loaded from a saved
game, false if the quest was started fresh.
boolStandalone
This value is true if the game is running in standalone mode, false if not.
Game->Standalone is read-only; while setting it is not syntactically
incorrect, it does nothing.
intGuyCount[]
The number of NPCs (enemies and guys) on screen i of this map, where
i is the index used to access this array. This array is exclusively used
to determine which enemies had previously been killed, and thus won't
return, when you re-enter a screen.
intContinueDMap
The DMap where Link will be respawned after quitting and reloading the game.
intContinueScreen
The map screen where Link will be respawned after quitting and reloading the game.
intLastEntranceDMap
The DMap where Link will be respawned after dying and continuing.
intLastEntranceScreen
The map screen where Link will be respawned after dying and continuing.
intCounter[]
The current value of the game counters. Use the CR_ constants in
std.zh to index into this array.
intMCounter[]
The current maximum value of the game counters. Use the CR_ constants
in std.zh to index into this array.
intDCounter[]
The current value of the game drain counters. Use the CR_ constants
in std.zh to index into this array.
Note that if the player hasn't acquired the '1/2 Magic Upgrade' yet
then setting the CR_MAGIC drain counter to a negative value will
drain the magic counter by 2 per frame rather than 1.
intGeneric[]
An array of miscellaneous game values, such as number of heart
containers and magic drain rate. Use the GEN_ constants in std.zh
to index into this array.
intLItems[]
The exploration items (map, compass, boss key etc.) of dungeon level i
currently under the possession of the player, where i is
the index used to access this array. Each element of this
array consists of flags OR'd (|) together; use the LI_ constants in
std.zh to set or compare these values.
intLKeys[]
The number of level keys of level i currently under the possession of
the player, where i is the index used to access this array.
intGetScreenFlags(int map, int screen, int flagset)
Returns the screen flags from screen 'screen' on map 'map'
interpreted in the same way as Screen->Flags
intGetScreenEFlags(int map, int screen, int flagset)
Returns the enemy flags from screen 'screen' on map 'map'
interpreted in the same way as Screen->EFlags
boolGetScreenState(int map, int screen, int flag)
As with State, but retrieves the miscellaneous flags of any screen
not just the current one. This function is undefined if map is less
than 1 or greater than the maximum map number of your quest, or if
screen is greater than 127.
Note: Screen numbers in ZQuest are usually displayed in hexadecimal.
Use the ST_ constants in std.zh for the flag parameter.
voidSetScreenState(int map, int screen, int flag, bool value)
As with State, but sets the miscellaneous flags of any screen, not
just the current one. This function is undefined if map is less than
1 or greater than the maximum map number of your quest, or if
screen is greater than 127.
Note: Screen numbers in ZQuest are usually displayed in hexadecimal.
Use the ST_ constants in std.zh for the flag parameter.
floatGetScreenD(int screen, int reg)
Retrieves the value of D[reg] on the given screen of the current
DMap.
voidSetScreenD(int screen, int reg, float value)
Sets the value of D[reg] on the given screen of the current DMap.
floatGetDMapScreenD(int dmap, int screen, int reg)
Retrieves the value of D[reg] on the given screen of the given
DMap.
voidSetDMapScreenD(int dmap, int screen, int reg, float value)
Sets the value of D[reg] on the given screen of the given DMap.
itemdataLoadItemData(int item)
Retrieves the itemdata pointer corresponding to the given item.
Use the item pointer ID variable or I_ constants in std.zh as values.
voidPlaySound(int soundid)
Plays one of the quest's sound effects. Use the SFX_ constants in
std.zh as values of soundid.
voidPlayMIDI(int MIDIid)
Changes the current screen MIDI to MIDIid.
Will revert to the DMap (or screen) MIDI upon leaving the screen.
intGetMIDI()
Returns the current screen MIDI that is playing.
Positive numbers are for custom MIDIs, and negative values are used
for the built-in game MIDIs.
boolPlayEnhancedMusic(int filename[], int track)
Play the specified enhanced music if it's available. If the music
cannot be played, the current music will continue. The music will
revert to normal upon leaving the screen.
Returns true if the music file was loaded successfully.
The filename cannot be more than 255 characters. If the music format
does not support multiple tracks, the track argument will be ignored.
voidGetDMapMusicFilename(int dmap, int buf[])
Load the filename of the given DMap's enhanced music into buf.
buf should be at least 256 elements in size.
intGetDMapMusicTrack(int dmap)
Returns the given DMap's enhanced music track. This is valid but
meaningless if the music format doesn't support multiple tracks.
voidSetDMapEnhancedMusic(int dmap, int filename[], int track)
Sets the specified DMap's enhanced music to the given filename and
track number. If the music format does not support multiple tracks,
the track argument will be ignored. The filename must not be more
than 255 characters.
intGetComboData(int map, int screen, int position)
Grabs a particular combo reference from anywhere in the game
world, based on map (NOT DMap), screen number, and position.
Don't forget that the screen index should be in hexadecimal,
and that maps are counted from 1 upwards.
Position is considered an index, treated the same way as in
Screen->ComboD[].
voidSetComboData(int map, int screen, int position, int value)
Sets a particular combo reference anywhere in the game world,
based on map (NOT DMap), screen number, and position.
Don't forget that the screen index should be in hexadecimal,
and that maps are counted from 1 upwards.
Position is considered an index, treated the same way as in
Screen->ComboD[].
intGetComboCSet(int map, int screen, int position)
Grabs a particular combo's CSet from anywhere in the game
world, based on map (NOT DMap), screen number, and position.
Position is considered an index, treated the same way as in
Screen->ComboC[].
voidSetComboCSet(int map, int screen, int position, int value)
Sets a particular combo's CSet anywhere in the game world,
based on map (NOT DMap), screen number, and position. Position
is considered an index, treated the same way as in Screen->ComboC[].
intGetComboFlag(int map, int screen, int position)
Grabs a particular combo's placed flag from anywhere in the game
world, based on map (NOT DMap), screen number, and position.
Position is considered an index, treated the same way as in
Screen->ComboF[].
voidSetComboFlag(int map, int screen, int position, int value)
Sets a particular combo's placed flag anywhere in the game world,
based on map (NOT DMap), screen number, and position. Position
is considered an index, treated the same way as in Screen->ComboF[].
intGetComboType(int map, int screen, int position)
Grabs a particular combo's type from anywhere in the game
world, based on map (NOT DMap), screen number, and position.
Position is considered an index, treated the same way as in
Screen->ComboT[]. Note that you are grabbing an actual combo
attribute as referenced by the combo on screen you're
referring to.
voidSetComboType(int map, int screen, int position, int value)
Sets a particular combo's type anywhere in the game world,
based on map (NOT DMap), screen number, and position. Position
is considered an index, treated the same way as in Screen->ComboT[].
Note that you are grabbing an actual combo attribute as referenced
by the combo on screen you're referring to, which means that
setting this attribute will affect ALL references to this combo
throughout the quest.
intGetComboInherentFlag(int map, int screen, int position)
Grabs a particular combo's inherent flag from anywhere in the game
world, based on map (NOT DMap), screen number, and position.
Position is considered an index, treated the same way as in
Screen->ComboI[]. Note that you are grabbing an actual combo
attribute as referenced by the combo on screen you're
referring to.
voidSetComboInherentFlag(int map, int screen, int position, int value)
Sets a particular combo's inherent flag anywhere in the game world,
based on map (NOT DMap), screen number, and position. Position
is considered an index, treated the same way as in Screen->ComboI[].
Note that you are grabbing an actual combo attribute as referenced
by the combo on screen you're referring to, which means that
setting this attribute will affect ALL references to this combo
throughout the quest.
intGetComboSolid(int map, int screen, int position)
Grabs a particular combo's solidity flag from anywhere in the game
world, based on map (NOT DMap), screen number, and position.
Position is considered an index, treated the same way as in
Screen->ComboS[]. Note that you are grabbing an actual combo
attribute as referenced by the combo on screen you're
referring to.
voidSetComboSolid(int map, int screen, int position, int value)
Sets a particular combo's solidity anywhere in the game world
based on map (NOT DMap), screen number, and position. Position
is considered an index, treated the same way as in Screen->ComboS[].
Note that you are grabbing an actual combo attribute as referenced
by the combo on screen you're referring to, which means that
setting this attribute will affect ALL references to this combo
throughout the quest.
intComboTile(int combo)
Returns the tile used by combo 'combo'
voidGetSaveName(int buffer[])
Loads the current save file's name into 'buffer'
Buffer should be at least 9 elements long
voidSetSaveName(int name[])
Sets the current file's save name to 'name'
Buffer should be no more than 9 elements
voidEnd()
Ends the current game and returns to the file select screen
voidSave()
Saves the current game
boolShowSaveScreen()
Displays the save screen. Returns true if the user chose to save, false otherwise.
voidShowSaveQuitScreen()
Displays the save and quit screen.
voidGetMessage(int string, int buffer[])
Loads 'string' into 'buffer'. Use the function from std.zh
to remove trailing ' ' characters whilst loading.
intGetFFCScript(int name[])
Returns the number of the script with the given name or -1 if there is
no such script.
boolClickToFreezeEnabled
If this is false, the "Click to Freeze" setting will not function, ensuring
that the script can use the mouse freely. This overrides the setting rather
than changing it, so remembering and restoring the initial value is unnecessary.