PowerQuest 0.20.12
Loading...
Searching...
No Matches
IInventory Interface Reference

Detailed Description

Inventory: Contains functions and data for manipluating Inventory Items - Eg.

    I.RubberChicken.Add();
    I.Active.Description = "A rubber chicken with a pulley in the middle"           
    if ( I.Sword.Active )
        Display: You can't use a sword on that
    if ( I.HeavyRock.EverCollected )
        Dave: I'm not lugging any more of those around          

Inherits IQuestClickableInterface.

Properties

string Description [get, set]
 Gets/Sets the description text shown to players when they hover the mouse over the object. Eg I.RubberChicken.Description = "A rubber chicken with a pulley in th emiddle";
 
string Anim [get, set]
 Use for setting the Gui AND cursor sprite/animation for the inventory item. Useful if the same sprite is used on both the gui and the cursor.
 
string AnimGui [get, set]
 Use for setting the sprite/animation for the inventory item on the Gui.
 
string AnimCursor [get, set]
 Use for setting the sprite/animation for the inventory item for the cursor.
 
string AnimCursorInactive [get, set]
 Use for setting the sprite/animation for the inventory item for the cursor, when not over a clickable object.
 
string ScriptName [get]
 The name used in scripts.
 
bool Active [get, set]
 Whether this item is the active item for the current player (ie: selected item to use on stuff)
 
bool Owned [get, set]
 Whether the current player has the item in their inventory.
 
int QuantityOwned [get, set]
 How many of the item the current player has in their inventory (For stackable items)
 
bool EverCollected [get]
 Whether the item has ever been collected.
 
bool FirstUse [get]
 Returns true the first time the player "uses" the object.
 
bool FirstLook [get]
 Returns true the first time the player "looked" at the object.
 
int UseCount [get]
 Returns the number of times player has "used" at the object. 0 when it's the first click on the object.
 
int LookCount [get]
 Returns the number of times player has "looked" at the object. 0 when it's the first click on the object.
 
Inventory Data [get]
 Access to the base class with extra functionality used by the PowerQuest.
 

Public Member Functions

void Add (int quantity=1)
 Gives the inventory item to the current player. Same as C.Player.AddInventory(item)
 
void AddAsActive (int quantity=1)
 Gives the inventory item to the current player and set's it as active inventory. Same as C.Player.AddInventory(item)
 
void Remove (int quantity=1)
 Removes the item from the current player. Same as C.Player.RemoveInventory(item)
 
void SetActive ()
 Sets this item as the active item for the current player (ie: selected item to use on stuff)
 
Coroutine DoInteract ()
 Runs the item's "OnInteract" function from another script, the same as if you clicked on it. Blocks until finished.
 
Coroutine DoLookAt ()
 Runs the item's "OnLookAt" function from another script, the same as if you clicked on it. Blocks until finished.
 
Coroutine DoUseInv (IInventory item)
 Runs the item's "OnUseInv" function from another script, the same as if you clicked on it. Blocks until finished.
 
T GetScript< T > ()
 PowerQuest internal function: Access to the specific quest script for the object. Use the specific item class as the templated parameter so you can access specific members of the script. Eg: GetScript<InventoryKey>().m_inDoor = true;.
 

Property Documentation

◆ Description

string Description
getset

Gets/Sets the description text shown to players when they hover the mouse over the object. Eg I.RubberChicken.Description = "A rubber chicken with a pulley in th emiddle";

◆ Anim

string Anim
getset

Use for setting the Gui AND cursor sprite/animation for the inventory item. Useful if the same sprite is used on both the gui and the cursor.

◆ AnimGui

string AnimGui
getset

Use for setting the sprite/animation for the inventory item on the Gui.

◆ AnimCursor

string AnimCursor
getset

Use for setting the sprite/animation for the inventory item for the cursor.

◆ AnimCursorInactive

string AnimCursorInactive
getset

Use for setting the sprite/animation for the inventory item for the cursor, when not over a clickable object.

◆ ScriptName

string ScriptName
get

The name used in scripts.

◆ Active

bool Active
getset

Whether this item is the active item for the current player (ie: selected item to use on stuff)

◆ Owned

bool Owned
getset

Whether the current player has the item in their inventory.

◆ QuantityOwned

int QuantityOwned
getset

How many of the item the current player has in their inventory (For stackable items)

◆ EverCollected

bool EverCollected
get

Whether the item has ever been collected.

◆ FirstUse

bool FirstUse
get

Returns true the first time the player "uses" the object.

◆ FirstLook

bool FirstLook
get

Returns true the first time the player "looked" at the object.

◆ UseCount

int UseCount
get

Returns the number of times player has "used" at the object. 0 when it's the first click on the object.

◆ LookCount

int LookCount
get

Returns the number of times player has "looked" at the object. 0 when it's the first click on the object.

◆ Data

Inventory Data
get

Access to the base class with extra functionality used by the PowerQuest.

Member Function Documentation

◆ Add()

void Add ( int quantity = 1)

Gives the inventory item to the current player. Same as C.Player.AddInventory(item)

◆ AddAsActive()

void AddAsActive ( int quantity = 1)

Gives the inventory item to the current player and set's it as active inventory. Same as C.Player.AddInventory(item)

◆ Remove()

void Remove ( int quantity = 1)

Removes the item from the current player. Same as C.Player.RemoveInventory(item)

◆ SetActive()

void SetActive ( )

Sets this item as the active item for the current player (ie: selected item to use on stuff)

◆ DoInteract()

Coroutine DoInteract ( )

Runs the item's "OnInteract" function from another script, the same as if you clicked on it. Blocks until finished.

See also
DoInteract
DoLookAt
DoUseInv

◆ DoLookAt()

Coroutine DoLookAt ( )

Runs the item's "OnLookAt" function from another script, the same as if you clicked on it. Blocks until finished.

See also
DoInteract
DoLookAt
DoUseInv

◆ DoUseInv()

Coroutine DoUseInv ( IInventory item)

Runs the item's "OnUseInv" function from another script, the same as if you clicked on it. Blocks until finished.

See also
DoInteract
DoLookAt
DoUseInv

◆ GetScript< T >()

T GetScript< T > ( )

PowerQuest internal function: Access to the specific quest script for the object. Use the specific item class as the templated parameter so you can access specific members of the script. Eg: GetScript<InventoryKey>().m_inDoor = true;.

Type Constraints
T :InventoryScript<T>