Game#

Contains general internal functions and variables.

Access with Game->.

Variables#

const int

CurScreen

const int

CurDMapScreen

const int

CurMap

const int

CurDMap

const int

CurLevel

int

NumDeaths

int

Cheat

int

MaxCheat

long

SubscreenSpeed

long

Time

const bool

HasPlayed

bool

TypingMode

bool

TimeValid

int[]

GuyCount

int

ContinueScreen

int

ContinueDMap

int[]

Counter

int[]

MCounter

int[]

DCounter

untyped[]

Generic

int[]

LItems

int[]

LKeys

long[]

LSwitches

int[]

GSwitch

int[]

BottleState

bool

Standalone

int

LastEntranceScreen

int

LastEntranceDMap

bool

ClickToFreezeEnabled

bool[]

FFRules

bool

SkipCredits

bool

SkipF6

bool[]

Suspend

bool[]

DisableItem

const int

MapCount

const int

ZScriptVersion

const int

Version

const int

Build deprecated

const int

Beta

const int

BetaType

bool

DisableActiveSubscreen

const int

NumMessages

int[]

Gravity

const int[]

Scrolling

int[]

MiscSprites

int[]

MiscSFX

untyped[]

EventData

int

MouseCursor

const int

NumSavedPortals

const savedportal[]

SavedPortals

const int[]

TrigGroups

const int[]

TriggerGroups

int[]

OverrideItems

const bool

ActiveSubscreenOpen

const int

ActiveSubscreenY

int

NumActiveSubscreens

int

NumPassiveSubscreens

int

NumOverlaySubscreens

const int

HighestStringID

const bool[]

ReadKey deprecated

const bool[]

JoypadPress deprecated

bool[]

ButtonPress deprecated

bool[]

ButtonInput deprecated

bool[]

ButtonHeld deprecated

int[]

DMapPalette deprecated

int[]

DMapFlags deprecated

int[]

DMapLevel deprecated

int[]

DMapCompass deprecated

int[]

DMapContinue deprecated

int[]

DMapMIDI deprecated

int[]

DMapOffset deprecated

int[]

DMapMap deprecated

Functions#

int

IncrementQuest()

int

MaxNPCs()

void

MaxNPCs(int value)

int

MaxLWeapons()

void

MaxLWeapons(int value)

int

MaxEWeapons()

void

MaxEWeapons(int value)

int

MaxItemsprites()

void

MaxItemsprites(int value)

int

GetCurScreen() deprecated

int

GetCurDMapScreen() deprecated

int

GetCurMap() deprecated

int

GetCurDMap() deprecated

int

GetCurLevel() deprecated

untyped

GetScreenD(int screen, int reg)

void

SetScreenD(int screen, int reg, untyped value)

untyped

GetDMapScreenD(int dmap, int screen, int reg)

void

SetDMapScreenD(int arg1, int arg2, int arg3, untyped arg4)

itemdata

LoadItemData(int item)

int

GetMIDI() deprecated

void

Save()

void

End()

void

Exit()

void

Reload()

void

Continue()

void

SaveAndQuit()

void

SaveAndContinue()

void

ShowContinueScreen()

void

GetSaveName(char32[] buf)

void

SetSaveName(char32[] buf)

bool

ShowSaveScreen()

void

ShowSaveQuitScreen()

int

GetFFCScript(char32[] name)

int

GetComboScript(char32[] name)

int

GetItemScript(char32[] name)

int

GetNPCScript(char32[] name)

int

GetLWeaponScript(char32[] name)

int

GetEWeaponScript(char32[] name)

int

GetPlayerScript(char32[] name)

int

GetGlobalScript(char32[] name)

int

GetDMapScript(char32[] name)

int

GetScreenScript(char32[] name)

int

GetItemSpriteScript(char32[] name)

int

GetNPC(char32[] name)

int

GetItem(char32[] name)

int

GetCombo(char32[] name)

int

GetDMap(char32[] name)

int

GetGenericScript(char32[] name)

int

MapCount() deprecated

npcdata

LoadNPCData(int id)

combodata

LoadComboData(int id)

mapdata

LoadMapData(int map, int screen)

mapdata

LoadTempScreen(int layer)

mapdata

LoadScrollingScreen(int layer)

spritedata

LoadSpriteData(int id)

shopdata

LoadShopData(int shop)

shopdata

LoadInfoShopData(int shop)

bitmap

LoadBitmapID(int id)

messagedata

LoadMessageData(int id)

dmapdata

LoadDMapData(int dmap)

dropsetdata

LoadDropset(int id)

randgen

LoadRNG()

stack

LoadStack()

websocket

LoadWebSocket(char32[] arg1)

bottledata

LoadBottleData(int id)

bottleshopdata

LoadBottleShopData(int id)

genericdata

LoadGenericData(int scriptslot)

bitmap

CreateBitmap(int width = 256, int height = 256) deprecated

bitmap

AllocateBitmap()

void

SetCustomCursor(bitmap b, int fx, int fy, bool sys_recolor = false, bool user_scale = false)

int

NumSavedPortals() deprecated

savedportal

LoadSavedPortal(int saved_portal_id)

savedportal

CreateSavedPortal()

int

CurrentItemID(int itemtype, int flags = 1L)

subscreendata

LoadASubData(int id)

subscreendata

LoadPSubData(int id)

subscreendata

LoadOSubData(int id)

int

SwapActiveSubscreens(int arg1, int arg2)

int

SwapPassiveSubscreens(int arg1, int arg2)

int

SwapOverlaySubscreens(int arg1, int arg2)

void

GetMessage(int string, char32[] buffer)

void

SetMessage(int message, char32[] str)

int

ComboTile(int combo)

void

PlaySound(int soundid) deprecated

void

PlayMIDI(int MIDIid) deprecated

bool

PlayEnhancedMusic(char32[] filename, int track) deprecated

bool

PlayOgg(int arg1, int arg2) deprecated

int

GetOggPos() deprecated

void

SetOggPos(int arg1) deprecated

void

SetOggSpeed(int arg1) deprecated

int

GetScreenFlags(int map, int screen, int flagset) deprecated

bool

GetScreenState(int map, int screen, int flag) deprecated

void

SetScreenState(int map, int screen, int flag, bool value) deprecated

int

GetComboData(int map, int screen, int position) deprecated

void

SetComboData(int map, int screen, int position, int value) deprecated

int

GetComboCSet(int map, int screen, int position) deprecated

void

SetComboCSet(int map, int screen, int position, int value) deprecated

int

GetComboFlag(int map, int screen, int position) deprecated

void

SetComboFlag(int map, int screen, int position, int value) deprecated

int

GetComboType(int map, int screen, int position) deprecated

void

SetComboType(int map, int screen, int position, int value) deprecated

int

GetComboInherentFlag(int map, int screen, int position) deprecated

void

SetComboInherentFlag(int map, int screen, int position, int value) deprecated

int

GetComboSolid(int map, int screen, int position) deprecated

void

SetComboSolid(int map, int screen, int position, int value) deprecated

int

GetUntypedScript(int arg1) deprecated

int

GetSubscreenScript(int arg1) deprecated

void

GetDMapMusicFilename(int dmap, char32[] buf) deprecated

int

GetDMapMusicTrack(int dmap) deprecated

void

SetDMapEnhancedMusic(int dmap, char32[] filename, int track) deprecated

void

GetDMapName(int DMap, char32[] buffer) deprecated

void

SetDMapName(int DMap, char32[] buffer) deprecated

void

GetDMapTitle(int DMap, char32[] buffer) deprecated

void

SetDMapTitle(int DMap, char32[] buffer) deprecated

void

GetDMapIntro(int DMap, char32[] buffer) deprecated

void

SetDMapIntro(int DMap, char32[] buffer) deprecated

Enumerations#

enum GravityIndex: πŸ”— Source

Use as index for Game->Gravity[].

GravityIndex GR_STRENGTH = 0

GravityIndex GR_TERMINALV = 1

GravityIndex GR_SPRLAYER = 2

GravityIndex GR_AIRDRAG = 3


enum ScrollingIndex: πŸ”— Source

Use as index for Game->Scrolling[].

ScrollingIndex SCROLL_DIR = 0

ScrollingIndex SCROLL_NX = 1

ScrollingIndex SCROLL_NY = 2

ScrollingIndex SCROLL_OX = 3

ScrollingIndex SCROLL_OY = 4


enum MiscSpriteIndex: πŸ”— Source

Use as index for Game->MiscSprites[].

MiscSpriteIndex MISCSPR_FALL = 0

MiscSpriteIndex MISCSPR_DROWN = 1

MiscSpriteIndex MISCSPR_LAVADROWN = 2

MiscSpriteIndex MISCSPR_SWITCHPOOF = 3

MiscSpriteIndex MISCSPR_MAX = 4


enum MiscSfx: πŸ”— Source

Use as index for Game->MiscSFX[].

MiscSfx MISCSFX_BUSH = 0

MiscSfx MISCSFX_SWITCHED = 1

MiscSfx MISCSFX_LOWHEART = 2

MiscSfx MISCSFX_ERROR = 3

MiscSfx MISCSFX_PLAYER_HURT = 4

MiscSfx MISCSFX_HAMMER_PEG = 5

MiscSfx MISCSFX_SUBSCR_ITEM_ASSIGN = 6

MiscSfx MISCSFX_SUBSCR_CURSOR_MOVE = 7

MiscSfx MISCSFX_REFILL = 8

MiscSfx MISCSFX_RUPEEDRAIN = 9

MiscSfx MISCSFX_MAX = 10


enum GenericIndex: πŸ”— Source

Use as index for Game->Generic[].

GenericIndex GEN_HEARTPIECES = 0

Heart Pieces currently possessed

GenericIndex GEN_MAGICDRAINRATE = 1

Link’s magic usage equals n / 2.

GenericIndex GEN_CANSLASH = 2

Link can slash with the sword.

GenericIndex GEN_WARPLEVEL = 3

Warp Ring number that a Whirlwind warp will send Link to. It is set every time that Link uses the Whistle.

GenericIndex GEN_HCPPERHC = 4

How many Pieces of Heart form a complete Heart Container?

GenericIndex GEN_CONTINUEHEARTS = 5

Amount of life that Link continues with

GenericIndex GEN_CONTINUEISPERCENT = 6

Percentage of life that Link continues with

GenericIndex GEN_HP_PER_HEART = 7

How much HP makes a β€˜heart’

GenericIndex GEN_MP_PER_BLOCK = 8

How much MP makes a β€˜block’

GenericIndex GEN_HERO_DMG_MULT = 9

Damage multiplier for damage by Link

GenericIndex GEN_ENEM_DMG_MULT = 10

Damage multiplier for damage by enemies

GenericIndex GEN_DITHER_TYPE = 11

Type of dithering used with dark rooms

GenericIndex GEN_DITHER_ARG = 12

Dithering argument used with dark rooms

GenericIndex GEN_DITHER_PERCENT = 13

Percent of light circles taken up by dithering

GenericIndex GEN_DEFAULT_LIGHT_RAD = 14

Default light radius initialized to enemies

GenericIndex GEN_TRANS_PERCENT = 15

Percent of light circles taken up by transparency

GenericIndex GEN_DARKNESS_COLOR = 16

Color of darkness

GenericIndex GEN_WATERGRAVITY = 17

Y position addition when not moving when sideview swimming. can be negative

GenericIndex GEN_SIDESWIM_STEP_UP = 18

Hero step speed when sideview swimming, moving up

GenericIndex GEN_SIDESWIM_STEP_SIDE = 19

Hero step speed when sideview swimming, moving left and right

GenericIndex GEN_SIDESWIM_STEP_DOWN = 20

Hero step speed when sideview swimming, moving down

GenericIndex GEN_SIDESWIM_EXITJUMP = 21

Jump value when exiting water from the top. If 0, Link can only leave the top of the water via sideview ladder.

GenericIndex GEN_BUNNY_TILEMOD = 22

Tile modifier to apply while Hero is bunnified

GenericIndex GEN_SWITCHHOOK_STYLE = 23

Which β€˜SW_EFF’ style to use for the β€˜Switch w/ Hero’ enemy defense

GenericIndex GEN_FLICKER_FRAMES = 24

How many frames Link / enemies flicker for with the flicker damage effect

GenericIndex GEN_FLICKER_COLOR = 25

Color used for the flicker effect

GenericIndex GEN_FLICKER_TRANSP = 26

Number of transparency passes for the flicker effect

GenericIndex GEN_MAX = 27


enum MouseCursor: πŸ”— Source

Values for Game->MouseCursor.

MouseCursor ZCM_CUSTOM = 0

MouseCursor ZCM_BLANK = 1

MouseCursor ZCM_NORMAL = 2

MouseCursor ZCM_MAX = 3


Variable descriptions#

const int CurScreen πŸ”— Source

Returns the screen the Hero is currently on.


const int CurDMapScreen πŸ”— Source

Returns the screen the Hero is currently on, offset by the current dmap offset.


const int CurMap πŸ”— Source

Returns the map the Hero is currently on.


const int CurDMap πŸ”— Source

Returns the dmap the Hero is currently on.


const int CurLevel πŸ”— Source

Returns the level the Hero is currently on.


int NumDeaths πŸ”— Source

The number of times the Hero has died.


int Cheat πŸ”— Source

The current activated cheat level. (range 0-4)


int MaxCheat πŸ”— Source

The highest cheat level that is enabled for the Hero. The Hero can change their cheat level in the cheat menu to any value <= this value (range 0-4). Updates when the Hero enters a cheat code.


long SubscreenSpeed πŸ”— Source

Speed multiplier for the engine subscreen rise/fall. Default 1. Max 85.


long Time πŸ”— Source

The number of frames passed on the save file. include/time.zh has several functions that help manage this value.


const bool HasPlayed πŸ”— Source

Returns true if the current save file was loaded, false if it was a freshly created save.


bool TypingMode πŸ”— Source

If true, keyboard input is disabled except for scripts reading it.


bool TimeValid πŸ”— Source

If β€˜false’, Game->Time does not contain accurate time information.


int[] GuyCount πŸ”— Source

The count of enemies remaining alive for each screen on the current map.


int ContinueScreen πŸ”— Source

The continue point the Hero will be reset to when continuing.


int ContinueDMap πŸ”— Source

The continue point the Hero will be reset to when continuing.


int[] Counter πŸ”— Source

The value of each of the game’s counters.

Valid indices: CounterIndex (CR_). Valid values: 0 to 65535.


int[] MCounter πŸ”— Source

The max value of each of the game’s counters.

Valid indices: CounterIndex (CR_). Valid values: 0 to 65535.


int[] DCounter πŸ”— Source

The value of each of the game’s drain counters.

Valid indices: CounterIndex (CR_). Valid values: -32768 to 32767.


untyped[] Generic πŸ”— Source

Generic values related to the game.

Valid indices: GenericIndex (GEN_).


int[] LItems πŸ”— Source

Contains a bitwise flagset of the β€œLevel Items”.


int[] LKeys πŸ”— Source

How many level-specific keys are owned for each level.


long[] LSwitches πŸ”— Source

The level-specific switch states for each level. Each level has a single long, representing 32 bitwise states. Ex: (Game->LSwitches:ref:`Game->CurLevel<globals_game_var_curlevel>` & (1Lb << (5))) will get the switch state indexed 5.


int[] GSwitch πŸ”— Source

The 256 global switch timers.


int[] BottleState πŸ”— Source

The contents of the Hero’s fillable bottles. Use bottle type IDs for the values, and slots (set in the bottle item’s attributes) as the indexes.


bool Standalone πŸ”— Source

True if the game is running in Standalone mode.


int LastEntranceScreen πŸ”— Source

The last entrance point the Hero used, and will be reset to by some mechanics.


int LastEntranceDMap πŸ”— Source

The last entrance point the Hero used, and will be reset to by some mechanics.


bool ClickToFreezeEnabled πŸ”— Source

Writing this to β€˜false’ forcibly disables the β€œClick To Freeze” setting, allowing the user to click without pausing the game (ex. for scripted mouse interaction)


bool[] FFRules πŸ”— Source

The values of all Quest Rules.

Valid indices: QR (qr_).


bool SkipCredits πŸ”— Source

If true, the end credits will not be shown.


bool SkipF6 πŸ”— Source

If true, the F6 menu will not appear when F6 is pressed. The prompt to exit the game will still be shown.


bool[] Suspend πŸ”— Source

An array of suspend states, all false by default. By writing these true, certain game operations may be paused until the state is written false again.


bool[] DisableItem πŸ”— Source

Whether each item is disabled or not on the current dmap.


const int MapCount πŸ”— Source

The number of maps in the quest.


const int ZScriptVersion πŸ”— Source

The ZScript version number the quest was last compiled in.


const int Version πŸ”— Source

The current version of ZC that the quest is being played in (ex: β€œ2.55” for 2.55)


const int Build πŸ”— Source

The current Build ID of ZC that the quest is being played in.

Warning

Deprecated!


const int Beta πŸ”— Source

The current detailed version; this can be the current Alpha, Beta, Gamma, or Release number, depending on the version of the program.


const int BetaType πŸ”— Source

What type of detailed version the program is in. 0 = Alpha, 1 = Beta, 2 = Gamma, 3 = Release, -1 = error.


bool DisableActiveSubscreen πŸ”— Source

If true, pressing the Start button will no longer open the active subscreen.


const int NumMessages πŸ”— Source

The number of message strings in the quest.


int[] Gravity πŸ”— Source

Values related to gravity.

Valid indices: GravityIndex (GR_).


const int[] Scrolling πŸ”— Source

values related to scrolling.

Valid indices: ScrollingIndex (SCROLL_).


int[] MiscSprites πŸ”— Source

The Quest->Graphics->Sprites->Misc Sprites values.

Valid indices: MiscSpriteIndex (MISCSPR_).


int[] MiscSFX πŸ”— Source

The Quest->Audio->Misc SFX values.

Valid indices: MiscSfx (MISCSFX_).


untyped[] EventData πŸ”— Source

A variably-sized array containing information about the current event. This should be accessed from genericdata after returning from WaitEvent(). Depending on what event WaitEvent() returns, a different set of constants should be used to access this array.


int MouseCursor πŸ”— Source

Which mouse cursor should be displayed during gameplay. ZCM_BLANK is the default, and it resets on visiting the title screen.

Valid values: MouseCursor (ZCM_).


const int NumSavedPortals πŸ”— Source

Returns the number of saved portals that currently exist.


const savedportal[] SavedPortals πŸ”— Source

A 0-indexed Internal Array pointer referencing the saved portal objects. Cannot access the Magic Mirror’s portal.


const int[] TrigGroups πŸ”— Source

The 256 β€˜Trigger Group’ values for the current screen.


const int[] TriggerGroups πŸ”— Source

The 256 β€˜Trigger Group’ values for the current screen.


int[] OverrideItems πŸ”— Source

The override values for each itemclass. Default value is -2. If set to -2, no override occurs. If > -2, anything that checks for the β€˜highest level item’ of this class uses this ID instead. A value of -1 indicates forcing it to return β€˜no item’.


const bool ActiveSubscreenOpen πŸ”— Source

True if the active subscreen is currently open.


const int ActiveSubscreenY πŸ”— Source

The Y offset of the active subscreen, used while it is opening/closing.

Value is -224 if subscreen is closed, -56 if it is open, or the current draw offset otherwise.


int NumActiveSubscreens πŸ”— Source

Returns the total number of active subscreens


int NumPassiveSubscreens πŸ”— Source

Returns the total number of passive subscreens


int NumOverlaySubscreens πŸ”— Source

Returns the total number of overlay subscreens


const int HighestStringID πŸ”— Source

Returns the highest valid ID of the strings in the ZQuest String Editor.


const bool[] ReadKey πŸ”— Source

Warning

Deprecated! Use Input->KeyPress[] instead!


const bool[] JoypadPress πŸ”— Source

Warning

Deprecated! Use Input->Joypad[] instead!


bool[] ButtonPress πŸ”— Source

Warning

Deprecated! Use Input->Press[] instead!


bool[] ButtonInput πŸ”— Source

Warning

Deprecated! Use Input->Button[] instead!


bool[] ButtonHeld πŸ”— Source

Warning

Deprecated! Use Input->Button[] instead!


int[] DMapPalette πŸ”— Source

Set or get the Level Palette for each DMap

Warning

Deprecated! Use dmapdata::Palette instead!


int[] DMapFlags πŸ”— Source

Warning

Deprecated! Use dmapdata::Flagset[] instead!


int[] DMapLevel πŸ”— Source

Warning

Deprecated! Use dmapdata::Level instead!


int[] DMapCompass πŸ”— Source

Warning

Deprecated! Use dmapdata::Compass instead!


int[] DMapContinue πŸ”— Source

Warning

Deprecated! Use dmapdata::Continue instead!


int[] DMapMIDI πŸ”— Source

Warning

Deprecated! Use dmapdata::MIDI instead!


int[] DMapOffset πŸ”— Source

Warning

Deprecated! Use dmapdata::Offset instead!


int[] DMapMap πŸ”— Source

Warning

Deprecated! Use dmapdata::Map instead!


Function descriptions#

int IncrementQuest() πŸ”— Source

Ends the current quest in victory, resetting to the title screen (without showing the normal end credits), and if this quest is part of a module, increment to the next quest in the module.


int MaxNPCs() πŸ”— Source

Returns the current max sprite count for each sprite type.


void MaxNPCs(int value) πŸ”— Source

Sets the max sprite count for a sprite type to the given new value. Max must be between 1 and 1024, inclusive.


int MaxLWeapons() πŸ”— Source

Returns the current max sprite count for each sprite type.


void MaxLWeapons(int value) πŸ”— Source

Sets the max sprite count for a sprite type to the given new value. Max must be between 1 and 1024, inclusive.


int MaxEWeapons() πŸ”— Source

Returns the current max sprite count for each sprite type.


void MaxEWeapons(int value) πŸ”— Source

Sets the max sprite count for a sprite type to the given new value. Max must be between 1 and 1024, inclusive.


int MaxItemsprites() πŸ”— Source

Returns the current max sprite count for each sprite type.


void MaxItemsprites(int value) πŸ”— Source

Sets the max sprite count for a sprite type to the given new value. Max must be between 1 and 1024, inclusive.


int GetCurScreen() πŸ”— Source

Returns the screen the Hero is currently on.

Warning

Deprecated! Use CurScreen instead!


int GetCurDMapScreen() πŸ”— Source

Returns the screen the Hero is currently on, offset by the current dmap offset.

Warning

Deprecated! Use CurDMapScreen instead!


int GetCurMap() πŸ”— Source

Returns the map the Hero is currently on.

Warning

Deprecated! Use CurMap instead!


int GetCurDMap() πŸ”— Source

Returns the dmap the Hero is currently on.

Warning

Deprecated! Use CurDMap instead!


int GetCurLevel() πŸ”— Source

Returns the level the Hero is currently on.

Warning

Deprecated! Use CurLevel instead!


untyped GetScreenD(int screen, int reg) πŸ”— Source


void SetScreenD(int screen, int reg, untyped value) πŸ”— Source


untyped GetDMapScreenD(int dmap, int screen, int reg) πŸ”— Source


void SetDMapScreenD(int arg1, int arg2, int arg3, untyped arg4) πŸ”— Source


itemdata LoadItemData(int item) πŸ”— Source


int GetMIDI() πŸ”— Source

Warning

Deprecated! Use Audio->MIDI instead!


void Save() πŸ”— Source

Saves the game. Can only run once per script per frame.


void End() πŸ”— Source

Closes the quest, returning to the title screen.


void Exit() πŸ”— Source

Closes the program, without saving.


void Reload() πŸ”— Source

Exits the quest without saving, then reloads the previous save.


void Continue() πŸ”— Source

Continue’s the quest, as β€˜F6->Continue’.


void SaveAndQuit() πŸ”— Source

Saves the game, then exits.


void SaveAndContinue() πŸ”— Source

Saves the game, then continues.


void ShowContinueScreen() πŸ”— Source

Displays the engine Continue/Save/Retry screen.


void GetSaveName(char32[] buf) πŸ”— Source

Loads the save file name into the buffer.


void SetSaveName(char32[] buf) πŸ”— Source

Sets the save file name to the contents of the buffer, limit 8 characters.


bool ShowSaveScreen() πŸ”— Source

Displays the Save screen, as Save Point combos use. Returns true if the Hero saved, false otherwise.


void ShowSaveQuitScreen() πŸ”— Source

Displays the Save/Quit screen.


int GetFFCScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetComboScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetItemScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetNPCScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetLWeaponScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetEWeaponScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetPlayerScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetGlobalScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetDMapScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetScreenScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetItemSpriteScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int GetNPC(char32[] name) πŸ”— Source

Gets the ID of the npc/item/combo/dmap whose name exactly matches name. If no such object exists, returns -1.


int GetItem(char32[] name) πŸ”— Source

Gets the ID of the npc/item/combo/dmap whose name exactly matches name. If no such object exists, returns -1.


int GetCombo(char32[] name) πŸ”— Source

Gets the ID of the npc/item/combo/dmap whose name exactly matches name. If no such object exists, returns -1.


int GetDMap(char32[] name) πŸ”— Source

Gets the ID of the npc/item/combo/dmap whose name exactly matches name. If no such object exists, returns -1.


int GetGenericScript(char32[] name) πŸ”— Source

Gets the script of the specified type with a name exactly matching name. If no such script exists, returns -1.


int MapCount() πŸ”— Source

The number of maps in the quest.

Warning

Deprecated! Use MapCount instead!


npcdata LoadNPCData(int id) πŸ”— Source

Loads an Enemy Editor table data ref for NPC id, to a npcdata pointer.


combodata LoadComboData(int id) πŸ”— Source

Loads a Combo Editor table data ref for combo id, to a combodata pointer.


mapdata LoadMapData(int map, int screen) πŸ”— Source

Loads the mapdata pointer for the screen at (map,screen). Edits to these pointers do not persist through quest exit. Edits to these pointers will NOT affect the β€œcurrent screen”, even if the current map/screen is supplied; see LoadTempScreen() below for that.


mapdata LoadTempScreen(int layer) πŸ”— Source

Loads the temp mapdata pointer for the specified layer. LoadTempScreen(0) gives a pointer that works mostly the same as Screen->, while passing 1 through 6 will give equal access to the other layers of the screen. Modifications to these pointers are reset when the screen changes.


mapdata LoadScrollingScreen(int layer) πŸ”— Source

Loads the temp mapdata pointer for the specified layer’s *scrolling screen*. This is only used during scrolling, for drawing the screen you just came from during the scrolling animation. Writing to this at any time other than during scrolling will have no effect.


spritedata LoadSpriteData(int id) πŸ”— Source

Loads an Weapon Sprite Editor table data ref for sprite β€˜id’, to a β€˜spritedata’ typed pointer.


shopdata LoadShopData(int shop) πŸ”— Source

Loads a Shop Editor table ref for an item shop with an ID of β€˜id’ to a β€˜shopdata’ typed pointer.


shopdata LoadInfoShopData(int shop) πŸ”— Source

Loads a Shop Editor table ref for an info shop with an ID of id to a β€˜shopdata’ typed pointer.


bitmap LoadBitmapID(int id) πŸ”— Source

Loads a bitmap pointer for one of the old-style render target RT_ bitmaps.


messagedata LoadMessageData(int id) πŸ”— Source

Loads an String Table Editor table data ref for ZQ Message String β€˜id’, to a messagedata typed pointer.


dmapdata LoadDMapData(int dmap) πŸ”— Source

Loads a dmapdata ref for dmap ID dmap to a dmapdata typed pointer.


dropsetdata LoadDropset(int id) πŸ”— Source

Loads a dropsetdata ref for dropset number id to a dropsetdata typed pointer.


randgen LoadRNG() πŸ”— Source


stack LoadStack() πŸ”— Source


websocket LoadWebSocket(char32[] arg1) πŸ”— Source


bottledata LoadBottleData(int id) πŸ”— Source

Loads a bottledata ref for bottledata number id to a bottledata typed pointer.

Range 1-64


bottleshopdata LoadBottleShopData(int id) πŸ”— Source

Loads a bottleshopdata ref for bottleshopdata number id to a β€˜bottleshopdata’ typed pointer.

Range 0-255


genericdata LoadGenericData(int scriptslot) πŸ”— Source

Loads the genericdata pointer referencing the specified generic scriptslot.

Note that 0 is invalid.


bitmap CreateBitmap(int width = 256, int height = 256) πŸ”— Source

Allocates a new bitmap pointer, creating a width by height canvas (cleared to color 0).

Warning

Deprecated! Use new bitmap(width, height) instead!


bitmap AllocateBitmap() πŸ”— Source

Allocates a new bitmap pointer, but does not create a canvas on it. bitmap::Create() can later be used to create a canvas on the pointer.


void SetCustomCursor(bitmap b, int fx, int fy, bool sys_recolor = false, bool user_scale = false) πŸ”— Source

Sets the custom cursor based on the given bitmap. This cursor will be displayed if Game->MouseCursor == ZCM_CUSTOM.

fx, fy denotes the β€œfocus point” of the cursor. For a normal cursor, this is usually the top-left (the engine cursor uses 1, 1, which is the transparent pixel directly pointed to by the arrow). For a crosshair type cursor, this would be the center.

If user_scale is true, the user’s mouse scale config will apply to the custom cursor.

If sys_recolor is true, some special colors will be replaced based on the current theme.

  • 0xF1 = Cursor Misc

  • 0xF2 = Cursor Outline

  • 0xF3 = Cursor Light

  • 0xF5 = Cursor Dark

WARNING: The palette will NOT update on custom cursors automatically. You must call this function again if the cursor should be affected by palette changes.


int NumSavedPortals() πŸ”— Source

Returns the number of saved portals that currently exist.

Warning

Deprecated! Use NumSavedPortals instead!


savedportal LoadSavedPortal(int saved_portal_id) πŸ”— Source

Loads a β€˜Saved Portal’ pointer. Use 1 <= saved_portal_id <= NumSavedPortals, OR saved_portal_id == -1 to access the Magic Mirror’s portal.


savedportal CreateSavedPortal() πŸ”— Source


int CurrentItemID(int itemtype, int flags = 1L) πŸ”— Source

Returns the current item of the selected itemtype. This generally returns the highest owned of an itemclass, with some exceptions.

If [Game->OverrideItems``itemtype``] is set to an override value, that value will be returned.

Use the IC_ constants for itemtype, and the CIID_FLAG_ constants bitwise-or’d for flags.

With CIID_FLAG_CHECKCOST, it will ignore items whose usecosts are currently not affordable.

With CIID_FLAG_CHECKJINX, it will ignore items which are currently disabled by jinxes.

With CIID_FLAG_CHECKBUNNY, it will ignore items which are currently disabled by BunnyClk.

Returns -1 for β€˜no item’.


subscreendata LoadASubData(int id) πŸ”— Source

Loads the subscreendata pointer for the specified active/passive/overlay subscreen.

Use id -1 to load the current subscreen of the type.


subscreendata LoadPSubData(int id) πŸ”— Source

Loads the subscreendata pointer for the specified active/passive/overlay subscreen.

Use id -1 to load the current subscreen of the type.


subscreendata LoadOSubData(int id) πŸ”— Source

Loads the subscreendata pointer for the specified active/passive/overlay subscreen.

Use id -1 to load the current subscreen of the type.


int SwapActiveSubscreens(int arg1, int arg2) πŸ”— Source


int SwapPassiveSubscreens(int arg1, int arg2) πŸ”— Source


int SwapOverlaySubscreens(int arg1, int arg2) πŸ”— Source


void GetMessage(int string, char32[] buffer) πŸ”— Source


void SetMessage(int message, char32[] str) πŸ”— Source

Places string β€˜str[]’ into ZQ Message β€˜message’.


int ComboTile(int combo) πŸ”— Source


void PlaySound(int soundid) πŸ”— Source

Warning

Deprecated! Use Audio->PlaySound() instead!


void PlayMIDI(int MIDIid) πŸ”— Source

Warning

Deprecated! Use Audio->PlayMIDI() instead!


bool PlayEnhancedMusic(char32[] filename, int track) πŸ”— Source

Warning

Deprecated! Use Audio->PlayEnhancedMusic() instead!


bool PlayOgg(int arg1, int arg2) πŸ”— Source

Warning

Deprecated! Use Audio->PlayEnhancedMusic() instead!


int GetOggPos() πŸ”— Source

Warning

Deprecated!


void SetOggPos(int arg1) πŸ”— Source

Warning

Deprecated!


void SetOggSpeed(int arg1) πŸ”— Source

Warning

Deprecated!


int GetScreenFlags(int map, int screen, int flagset) πŸ”— Source

Warning

Deprecated! Use β€˜mapdata->’ vars instead!


bool GetScreenState(int map, int screen, int flag) πŸ”— Source

Warning

Deprecated! Use β€˜mapdata->’ vars instead!


void SetScreenState(int map, int screen, int flag, bool value) πŸ”— Source

Warning

Deprecated! Use β€˜mapdata->’ vars instead!


int GetComboData(int map, int screen, int position) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboD[]’ instead!


void SetComboData(int map, int screen, int position, int value) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboD[]’ instead!


int GetComboCSet(int map, int screen, int position) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboC[]’ instead!


void SetComboCSet(int map, int screen, int position, int value) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboC[]’ instead!


int GetComboFlag(int map, int screen, int position) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboF[]’ instead!


void SetComboFlag(int map, int screen, int position, int value) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboF[]’ instead!


int GetComboType(int map, int screen, int position) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboT[]’ instead!


void SetComboType(int map, int screen, int position, int value) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboT[]’ instead!


int GetComboInherentFlag(int map, int screen, int position) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboI[]’ instead!


void SetComboInherentFlag(int map, int screen, int position, int value) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboI[]’ instead!


int GetComboSolid(int map, int screen, int position) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboS[]’ instead!


void SetComboSolid(int map, int screen, int position, int value) πŸ”— Source

Warning

Deprecated! Use mapdata::ComboS[]’ instead!


int GetUntypedScript(int arg1) πŸ”— Source

Warning

Deprecated!


int GetSubscreenScript(int arg1) πŸ”— Source

Warning

Deprecated!


void GetDMapMusicFilename(int dmap, char32[] buf) πŸ”— Source

Warning

Deprecated! Use dmapdata::GetMusic() instead!


int GetDMapMusicTrack(int dmap) πŸ”— Source

Warning

Deprecated! Use dmapdata::MusicTrack instead!


void SetDMapEnhancedMusic(int dmap, char32[] filename, int track) πŸ”— Source

Warning

Deprecated! Use dmapdata::SetMusic() instead!


void GetDMapName(int DMap, char32[] buffer) πŸ”— Source

Warning

Deprecated! Use dmapdata::GetName() instead!


void SetDMapName(int DMap, char32[] buffer) πŸ”— Source

Warning

Deprecated! Use dmapdata::SetName() instead!


void GetDMapTitle(int DMap, char32[] buffer) πŸ”— Source

Warning

Deprecated! Use dmapdata::GetTitle() instead!


void SetDMapTitle(int DMap, char32[] buffer) πŸ”— Source

Warning

Deprecated! Use dmapdata::SetTitle() instead!


void GetDMapIntro(int DMap, char32[] buffer) πŸ”— Source

Warning

Deprecated! Use dmapdata::GetIntro() instead!


void SetDMapIntro(int DMap, char32[] buffer) πŸ”— Source

Warning

Deprecated! Use dmapdata::SetIntro() instead!