Game (functions)/Item Management: Difference between revisions
Created page with " == GAME:FindPlayerItem(System.String,System.Boolean,System.Boolean) == Finds an item in the player's team and returns its slot within the inventory or among its team's equips. === Arguments === * <code>id</code>: The item ID to search for. * <code>held</code>: Check equipped items. * <code>inv</code>: Check inventory items. === Returns === The InvSlot of the item. Invalid if the item could not be found. == GAME:GetPlayerEquippedCount == Get the number of items..." |
No edit summary |
||
| Line 1: | Line 1: | ||
== FindPlayerItem == | |||
Finds an item in the player's team and returns its slot within the inventory or among its team's equips. Returns the inventory slot of the item, but is invalid if no item was found. {{FuncUsage|nmspace=GAME|nm=FindPlayerItem|args=ID, checkHeld, checkInv}} | |||
Finds an item in the player's team and returns its slot within the inventory or among its team's equips. | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=ID | |||
|type=String | |||
|techt=System.String | |||
|purp=The item ID to search for. | |||
}} | |||
{{ArgRow | |||
|name=checkHeld | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=True to check held items. | |||
}} | |||
{{ArgRow | |||
|name=checkInv | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=True to check inventory items. | |||
}} | |||
|} | |||
== GetPlayerEquippedCount == | |||
Returns the number of items equipped by players. Does not include guests. | |||
== GetPlayerBagCount == | |||
Returns the number of items in the bag. | |||
== GetPlayerBagLimit == | |||
Returns the maximum amount of item the player's team can carry. | |||
== GetPlayerEquippedItem == | |||
== | |||
Returns the equipped item for the character in the specified slot. {{FuncUsage|nmspace=GAME|nm=GetPlayerEquippedItem|args=slot}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=slot | |||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The team slot of the character to check | |||
}} | |||
|} | |||
== GetGuestEquippedItem == | |||
== | |||
Returns the equipped item for the character in the specified guest slot. {{FuncUsage|nmspace=GAME|nm=GetGuestEquippedItem|args=slot}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=slot | |||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The guest slot of the character to check | |||
}} | |||
|} | |||
== GivePlayerItem == | |||
== | |||
Gives an item and adds it to the player team's bag. | Gives an item and adds it to the player team's bag. | ||
=== Context 1 === | |||
In this context, the item is given from the RogueEssense item data type.{{FuncUsage|nmspace=GAME|nm=GivePlayerItem|args=item}} | |||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=item | |||
|type=Dungeon Item | |||
|techt=RogueEssence.Dungeon.InvItem | |||
|purp=The item to give | |||
}} | |||
|} | |||
=== | === Context 2 === | ||
In this context, the item is defined in the script. {{FuncUsage|nmspace=GAME|nm=GivePlayerItem|args=id, count, cursed, hiddenVal}} | |||
{| class="wikitable" | |||
{{ArgHeader}} | |||
== | {{ArgRow | ||
|name=id | |||
|type=String | |||
|techt=System.String | |||
|purp=The ID of the item | |||
}} | |||
{{ArgRow | |||
|name=Count | |||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The amount to give. Default 1. | |||
}} | |||
{{ArgRow | |||
|name=cursed | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=Whether the item is cursed. Default false. | |||
}} | |||
{{ArgRow | |||
|name=hiddenVal | |||
|type=String | |||
|techt=System.String | |||
|purp=The hidden value of the item. Default empty string. | |||
}} | |||
|} | |||
== GetPlayerBagItem == | |||
Returns the item found at the specified slot of the player's bag. {{FuncUsage|nmspace=GAME|nm=|args=}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name= | |||
|type= | |||
|techt= | |||
|purp= | |||
}} | |||
|} | |||
== TakePlayerBagItem == | |||
== | |||
Remove an item from player's inventory. {{FuncUsage|nmspace=GAME|nm=TakePlayerBagItem|args= takeAll, slot}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
= | |name=slot | ||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The slot from which to remove the item | |||
}} | |||
{{ArgRow | |||
|name=takeAll | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=True to remove all of that item, false to not | |||
}} | |||
|} | |||
== TakePlayerEquippedItem == | |||
Remove the equipped item from a chosen | Remove the equipped item from a chosen member of the team. {{FuncUsage|nmspace=GAME|nm=TakePlayerEquippedItem|args=slot, takeAll}} | ||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=slot | |||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The slot of the character on the team from which to remove the item | |||
}} | |||
{{ArgRow | |||
|name=takeAll | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=(Undocumented) | |||
}} | |||
|} | |||
== | == TakeGuestEquippedItem == | ||
Remove the equipped item from a chosen guest of the team. {{FuncUsage|nmspace=GAME|nm=TakeGuestEquippedItem|args=slot, takeAll}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=slot | |||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The slot of the character in the guest list from which to remove the item | |||
}} | |||
{{ArgRow | |||
|name=takeAll | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=(Undocumented) | |||
}} | |||
|} | |||
== GetPlayerStorageCount == | |||
=== | |||
Returns the amount of items in the player's storage. | |||
== GetPlayerStorageItemCount == | |||
Returns the amount of a specific item in the player's storage. {{FuncUsage|nmspace=GAME|nm=GetPlayerStorageItemCount|args=id}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=id | |||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The ID of the item to take | |||
}} | |||
|} | |||
== GivePlayerStorageItem == | |||
Returns an item and adds it to the player team's storage. | |||
=== Context 1 === | |||
In this context, the item is given from the RogueEssense item data type. {{FuncUsage|nmspace=GAME|nm=GivePlayerStorageItem|args=item}} | |||
{| class="wikitable"Yea | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=item | |||
|type=Inventory Item | |||
|techt=RogueEssence.Dungeon.InvItem | |||
|purp= | |||
}} | |||
|} | |||
=== Context 2 === | |||
In this context, the item is defined in the script. {{FuncUsage|nmspace=GAME|nm=GivePlayerStorageItem|args=id, count, cursed, hiddenVal}} | |||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=id | |||
|type=String | |||
|techt=System.String | |||
|purp=The ID of the item | |||
}} | |||
{{ArgRow | |||
|name=count | |||
|type=Integer | |||
|techt=System.Int32 | |||
|purp=The amount to give. Default 1 | |||
}} | |||
{{ArgRow | |||
|name=isCursed | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=Whether the item is cursed. Default false. | |||
}} | |||
{{ArgRow | |||
|name=hiddenVal | |||
|type=String | |||
|techt=System.String | |||
|purp=The hidden value of the item. Default empty string. | |||
}} | |||
|} | |||
== TakePlayerStorageItem == | |||
Takes an item from the storage. {{FuncUsage|nmspace=GAME|nm=TakePlayerStorageItem|args=id}} | |||
== | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=id | |||
|type=String | |||
|techt=System.String | |||
|purp= The ID of the item to take | |||
}} | |||
|} | |||
== DepositAll == | |||
Takes all items in the player team's bag and equipped items, and deposits them in storage. | Takes all items in the player team's bag and equipped items, and deposits them in storage. | ||
Latest revision as of 23:49, 17 January 2026
FindPlayerItem
Finds an item in the player's team and returns its slot within the inventory or among its team's equips. Returns the inventory slot of the item, but is invalid if no item was found. Argument order is GAME:FindPlayerItem(ID, checkHeld, checkInv).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| ID | String | System.String
|
The item ID to search for. |
| checkHeld | Boolean | System.Boolean
|
True to check held items. |
| checkInv | Boolean | System.Boolean
|
True to check inventory items. |
GetPlayerEquippedCount
Returns the number of items equipped by players. Does not include guests.
GetPlayerBagCount
Returns the number of items in the bag.
GetPlayerBagLimit
Returns the maximum amount of item the player's team can carry.
GetPlayerEquippedItem
Returns the equipped item for the character in the specified slot. Argument order is GAME:GetPlayerEquippedItem(slot).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| slot | Integer | System.Int32
|
The team slot of the character to check |
GetGuestEquippedItem
Returns the equipped item for the character in the specified guest slot. Argument order is GAME:GetGuestEquippedItem(slot).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| slot | Integer | System.Int32
|
The guest slot of the character to check |
GivePlayerItem
Gives an item and adds it to the player team's bag.
Context 1
In this context, the item is given from the RogueEssense item data type.Argument order is GAME:GivePlayerItem(item).
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| item | Dungeon Item | RogueEssence.Dungeon.InvItem
|
The item to give |
Context 2
In this context, the item is defined in the script. Argument order is GAME:GivePlayerItem(id, count, cursed, hiddenVal).
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| id | String | System.String
|
The ID of the item |
| Count | Integer | System.Int32
|
The amount to give. Default 1. |
| cursed | Boolean | System.Boolean
|
Whether the item is cursed. Default false. |
| hiddenVal | String | System.String
|
The hidden value of the item. Default empty string. |
GetPlayerBagItem
Returns the item found at the specified slot of the player's bag. Argument order is GAME:().
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
|
TakePlayerBagItem
Remove an item from player's inventory. Argument order is GAME:TakePlayerBagItem(takeAll, slot).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| slot | Integer | System.Int32
|
The slot from which to remove the item |
| takeAll | Boolean | System.Boolean
|
True to remove all of that item, false to not |
TakePlayerEquippedItem
Remove the equipped item from a chosen member of the team. Argument order is GAME:TakePlayerEquippedItem(slot, takeAll).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| slot | Integer | System.Int32
|
The slot of the character on the team from which to remove the item |
| takeAll | Boolean | System.Boolean
|
(Undocumented) |
TakeGuestEquippedItem
Remove the equipped item from a chosen guest of the team. Argument order is GAME:TakeGuestEquippedItem(slot, takeAll).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| slot | Integer | System.Int32
|
The slot of the character in the guest list from which to remove the item |
| takeAll | Boolean | System.Boolean
|
(Undocumented) |
GetPlayerStorageCount
Returns the amount of items in the player's storage.
GetPlayerStorageItemCount
Returns the amount of a specific item in the player's storage. Argument order is GAME:GetPlayerStorageItemCount(id).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| id | Integer | System.Int32
|
The ID of the item to take |
GivePlayerStorageItem
Returns an item and adds it to the player team's storage.
Context 1
In this context, the item is given from the RogueEssense item data type. Argument order is GAME:GivePlayerStorageItem(item).
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| item | Inventory Item | RogueEssence.Dungeon.InvItem
|
Context 2
In this context, the item is defined in the script. Argument order is GAME:GivePlayerStorageItem(id, count, cursed, hiddenVal).
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| id | String | System.String
|
The ID of the item |
| count | Integer | System.Int32
|
The amount to give. Default 1 |
| isCursed | Boolean | System.Boolean
|
Whether the item is cursed. Default false. |
| hiddenVal | String | System.String
|
The hidden value of the item. Default empty string. |
TakePlayerStorageItem
Takes an item from the storage. Argument order is GAME:TakePlayerStorageItem(id).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| id | String | System.String
|
The ID of the item to take |
DepositAll
Takes all items in the player team's bag and equipped items, and deposits them in storage.
