PowerQuest  0.15.3
RoomScript Class Reference

Detailed Description

Each room you create will have its own room class and script file. These are created automatically with the name appended, eg: RoomForest.cs.

There are some additional helpful properties you can use in room scripts:

  • FirstTimeVisted property - This is true the first time the player visits the room
  • EnteredFromEditor property - This is true when testing your game, if you've pressed play in the editor from this script's room. Useful for setting up things so you can test from a particular room (eg, give the player an item they should have in that room).

Public Member Functions

void OnEnterRoom ()
 Called whenever you enter a room, before fading in. Non-blocking functions only Use this function to set up stuff you need to in your room, like where characters should be standing. You can also do this at the top of RoomScript.OnEnterRoomAfterFade. More...
 
IEnumerator OnEnterRoomAfterFade ()
 Blocking script called whenever you enter a room, after fade in is complete. More...
 
IEnumerator OnExitRoom (IRoom oldRoom, IRoom newRoom)
 Blocking script called whenever you exit a room, as it fades out. More...
 
IEnumerator UpdateBlocking ()
 Blocking script called every frame when no other scripts are blocking. More...
 
void Update ()
 Called every frame. Non-blocking functions only. More...
 
IEnumerator OnAnyClick ()
 Blocking script called whenever the player clicks anywhere. This function is called before any other click interaction. If this function blocks, it will stop any other interaction from happening. More...
 
IEnumerator OnWalkTo ()
 Blocking script called whenever the player tries to walk somewhere. Even if C.Player.Moveable is set to false. More...
 
void OnPostRestore (int version)
 Called after restoring a game. Use this if you need to update any references based on saved data. Non-blocking functions only. More...
 
IEnumerator OnInteractHotspot (Hotspot hotspot)
 Blocking script called when "Interact" is used on a hotspot. The name is appended to the function, eg: OnInteractHotspotTree(...). More...
 
IEnumerator OnLookAtHotspot (Hotspot hotspot)
 Blocking script called when "Look At" is used on a hotspot. The name is appended to the function, eg: OnLookAtHotspotTree(...). More...
 
IEnumerator OnUseInvHotspot (Hotspot hotspot, Inventory item)
 Blocking script called when an item is used on a hotspot. The name is appended to the function, eg: OnUseInvHotspotTree(...). Query the passed in 'item' to see if you should perform the action. Eg: ‘if ( item == I.Key ) {...}’ or 'if ( I.Key.Active ) {...}'. More...
 
IEnumerator OnInteractProp (Prop prop)
 Blocking script called when "Interact" is used on a prop. The name is appended to the function, eg: OnInteractPropDoor(...). More...
 
IEnumerator OnLookAtProp (Prop prop)
 Blocking script called when "Look At" is used on a prop. The name is appended to the function, eg: OnLookAtPropDoor(...). More...
 
IEnumerator OnUseInvProp (Prop prop, Inventory item)
 Blocking script called when an item is used on a prop. The name is appended to the function, eg: OnUseInvPropDoor(...). Query the passed in 'item' to see if you should perform the action. Eg: ‘if ( item == I.Key ) {...}’ or 'if ( I.Key.Active ) {...}'. More...
 
IEnumerator OnInteractCharacter (Hotspot hotspot)
 Blocking script called when "Interact" is used on a character. The name is appended to the function, eg: OnInteractCharacterBarney(...). More...
 
IEnumerator OnLookAtCharacter (Hotspot hotspot)
 Blocking script called when "Look At" is used on a hotspot. The name is appended to the function, eg: OnLookAtCharacterBarney(...). More...
 
IEnumerator OnUseInvCharacter (Hotspot hotspot, Inventory item)
 Blocking script called when an item is used on a hotspot. The name is appended to the function, eg: OnUseInvCharacterBarney(...). Query the passed in 'item' to see if you should perform the action. Eg: ‘if ( item == I.Key ) {...}’ or 'if ( I.Key.Active ) {...}'. More...
 
IEnumerator OnEnterRegion (IRegion region, ICharacter character)
 Blocking script called when "Interact" is used on a prop. The name is appended to the function, eg: OnInteractPropDoor(...). Blocking script called when an item is used on a prop. The name is appended to the function, eg: OnEnterRegionMud(...). Query the passed in 'character' to see if you should perform the action. Eg: ‘if ( character == C.Plr ) {...}’. More...
 
IEnumerator OnExitRegion (IRegion region, ICharacter character)
 Blocking script called when an item is used on a prop. The name is appended to the function, eg: OnExitRegion(...). Query the passed in 'character' to see if you should perform the action. Eg: ‘if ( character == C.Plr ) {...}’. More...
 

Member Function Documentation

◆ OnEnterRoom()

void OnEnterRoom ( )

Called whenever you enter a room, before fading in. Non-blocking functions only Use this function to set up stuff you need to in your room, like where characters should be standing. You can also do this at the top of RoomScript.OnEnterRoomAfterFade.

◆ OnEnterRoomAfterFade()

IEnumerator OnEnterRoomAfterFade ( )

Blocking script called whenever you enter a room, after fade in is complete.

◆ OnExitRoom()

IEnumerator OnExitRoom ( IRoom  oldRoom,
IRoom  newRoom 
)

Blocking script called whenever you exit a room, as it fades out.

◆ UpdateBlocking()

IEnumerator UpdateBlocking ( )

Blocking script called every frame when no other scripts are blocking.

◆ Update()

void Update ( )

Called every frame. Non-blocking functions only.

◆ OnAnyClick()

IEnumerator OnAnyClick ( )

Blocking script called whenever the player clicks anywhere. This function is called before any other click interaction. If this function blocks, it will stop any other interaction from happening.

◆ OnWalkTo()

IEnumerator OnWalkTo ( )

Blocking script called whenever the player tries to walk somewhere. Even if C.Player.Moveable is set to false.

◆ OnPostRestore()

void OnPostRestore ( int  version)

Called after restoring a game. Use this if you need to update any references based on saved data. Non-blocking functions only.

◆ OnInteractHotspot()

IEnumerator OnInteractHotspot ( Hotspot  hotspot)

Blocking script called when "Interact" is used on a hotspot. The name is appended to the function, eg: OnInteractHotspotTree(...).

◆ OnLookAtHotspot()

IEnumerator OnLookAtHotspot ( Hotspot  hotspot)

Blocking script called when "Look At" is used on a hotspot. The name is appended to the function, eg: OnLookAtHotspotTree(...).

◆ OnUseInvHotspot()

IEnumerator OnUseInvHotspot ( Hotspot  hotspot,
Inventory  item 
)

Blocking script called when an item is used on a hotspot. The name is appended to the function, eg: OnUseInvHotspotTree(...). Query the passed in 'item' to see if you should perform the action. Eg: ‘if ( item == I.Key ) {...}’ or 'if ( I.Key.Active ) {...}'.

◆ OnInteractProp()

IEnumerator OnInteractProp ( Prop  prop)

Blocking script called when "Interact" is used on a prop. The name is appended to the function, eg: OnInteractPropDoor(...).

◆ OnLookAtProp()

IEnumerator OnLookAtProp ( Prop  prop)

Blocking script called when "Look At" is used on a prop. The name is appended to the function, eg: OnLookAtPropDoor(...).

◆ OnUseInvProp()

IEnumerator OnUseInvProp ( Prop  prop,
Inventory  item 
)

Blocking script called when an item is used on a prop. The name is appended to the function, eg: OnUseInvPropDoor(...). Query the passed in 'item' to see if you should perform the action. Eg: ‘if ( item == I.Key ) {...}’ or 'if ( I.Key.Active ) {...}'.

◆ OnInteractCharacter()

IEnumerator OnInteractCharacter ( Hotspot  hotspot)

Blocking script called when "Interact" is used on a character. The name is appended to the function, eg: OnInteractCharacterBarney(...).

◆ OnLookAtCharacter()

IEnumerator OnLookAtCharacter ( Hotspot  hotspot)

Blocking script called when "Look At" is used on a hotspot. The name is appended to the function, eg: OnLookAtCharacterBarney(...).

◆ OnUseInvCharacter()

IEnumerator OnUseInvCharacter ( Hotspot  hotspot,
Inventory  item 
)

Blocking script called when an item is used on a hotspot. The name is appended to the function, eg: OnUseInvCharacterBarney(...). Query the passed in 'item' to see if you should perform the action. Eg: ‘if ( item == I.Key ) {...}’ or 'if ( I.Key.Active ) {...}'.

◆ OnEnterRegion()

IEnumerator OnEnterRegion ( IRegion  region,
ICharacter  character 
)

Blocking script called when "Interact" is used on a prop. The name is appended to the function, eg: OnInteractPropDoor(...). Blocking script called when an item is used on a prop. The name is appended to the function, eg: OnEnterRegionMud(...). Query the passed in 'character' to see if you should perform the action. Eg: ‘if ( character == C.Plr ) {...}’.

◆ OnExitRegion()

IEnumerator OnExitRegion ( IRegion  region,
ICharacter  character 
)

Blocking script called when an item is used on a prop. The name is appended to the function, eg: OnExitRegion(...). Query the passed in 'character' to see if you should perform the action. Eg: ‘if ( character == C.Plr ) {...}’.