PowerQuest
GlobalScript Class Reference

Detailed Description

Global Script: The home for your game specific logic.

  • The functions in this script are used in every room in your game.
  • Put game-wide variables in here and you can access them from the quest script editor 'Globals.' (or from other quest scripts with 'GlobalScript.Script.')
  • If you've used Adventure Game Studio, this is equivalent to the Global Script in that

Inherits GlobalScriptBase< GlobalScript >.

Public Member Functions

void OnGameStart ()
 Called when game first starts. More...
 
void OnPostRestore (int version)
 Called after restoring a game. Use this if you need to update any references based on saved data. More...
 
void OnEnterRoom ()
 Called whenever you enter a room, before fading in. Non-blocking functions only. More...
 
IEnumerator OnEnterRoomAfterFade ()
 Called whenever you enter a room, after fade in is complete (blocking) More...
 
IEnumerator UpdateBlocking ()
 Called every frame when nothing's blocking, you can call blocking functions in here that you'd like to occur anywhere in the game. More...
 
void Update ()
 Called every frame. Non-blocking functions only. More...
 
void OnMouseClick (bool leftClick, bool rightClick)
 Called when the mouse is clicked in the game screen. Use this to customise your game interface by calling E.ProcessClick() with the verb that should be used. By default this is set up for a 2 click interface. More...
 
IEnumerator UnhandledInteract (IQuestClickable mouseOver)
 Called when player interacted with something that had not specific "interact" script. More...
 
IEnumerator UnhandledLookAt (IQuestClickable mouseOver)
 Called when player looked at something that had not specific "Look at" script. More...
 
IEnumerator UnhandledUseInvInv (Inventory invA, Inventory invB)
 Called when player used inventory on an inventory item that didn't have a specific UseInv script. More...
 
IEnumerator UnhandledUseInv (IQuestClickable mouseOver, Inventory item)
 Called when player used inventory on something that didn't have a specific UseInv script. More...
 

Public Attributes

eProgress m_progressExample = eProgress.None
 Just an example of using an enum for game state. More...
 
bool m_spokeToBarney = false
 Just an example of using a global variable that can be accessed in any room. All variables like this in Quest Scripts are automatically saved. More...
 

Member Data Documentation

◆ m_progressExample

eProgress m_progressExample = eProgress.None

Just an example of using an enum for game state.

◆ m_spokeToBarney

bool m_spokeToBarney = false

Just an example of using a global variable that can be accessed in any room. All variables like this in Quest Scripts are automatically saved.

Member Function Documentation

◆ OnGameStart()

void OnGameStart ( )
inline

Called when game first starts.

◆ OnPostRestore()

void OnPostRestore ( int  version)
inline

Called after restoring a game. Use this if you need to update any references based on saved data.

◆ OnEnterRoom()

void OnEnterRoom ( )
inline

Called whenever you enter a room, before fading in. Non-blocking functions only.

◆ OnEnterRoomAfterFade()

IEnumerator OnEnterRoomAfterFade ( )
inline

Called whenever you enter a room, after fade in is complete (blocking)

◆ UpdateBlocking()

IEnumerator UpdateBlocking ( )
inline

Called every frame when nothing's blocking, you can call blocking functions in here that you'd like to occur anywhere in the game.

◆ Update()

void Update ( )
inline

Called every frame. Non-blocking functions only.

◆ OnMouseClick()

void OnMouseClick ( bool  leftClick,
bool  rightClick 
)
inline

Called when the mouse is clicked in the game screen. Use this to customise your game interface by calling E.ProcessClick() with the verb that should be used. By default this is set up for a 2 click interface.

◆ UnhandledInteract()

IEnumerator UnhandledInteract ( IQuestClickable  mouseOver)
inline

Called when player interacted with something that had not specific "interact" script.

◆ UnhandledLookAt()

IEnumerator UnhandledLookAt ( IQuestClickable  mouseOver)
inline

Called when player looked at something that had not specific "Look at" script.

◆ UnhandledUseInvInv()

IEnumerator UnhandledUseInvInv ( Inventory  invA,
Inventory  invB 
)
inline

Called when player used inventory on an inventory item that didn't have a specific UseInv script.

◆ UnhandledUseInv()

IEnumerator UnhandledUseInv ( IQuestClickable  mouseOver,
Inventory  item 
)
inline

Called when player used inventory on something that didn't have a specific UseInv script.