Game (functions)/Item Management: Difference between revisions

From PMDOWiki
Imbion (talk | contribs)
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..."
 
Imbion (talk | contribs)
No edit summary
 
Line 1: Line 1:
== FindPlayerItem ==


== 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. 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 ==


* <code>id</code>: The item ID to search for.
Returns the number of items equipped by players. Does not include guests.  
* <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 ==


== GetPlayerBagCount ==


Get the number of items equipped by players.  Does not include guests.
Returns the number of items in the bag.


== GetPlayerBagLimit ==


=== Returns ===
Returns the maximum amount of item the player's team can carry.


The number of items.
== GetPlayerEquippedItem ==
 
== GAME:GetPlayerBagCount ==
 
 
Get the number of items in the bag.
 
 
=== Returns ===
 
The number of items.
 
== GAME:GetPlayerBagLimit ==
 
 
Gets the maximum amount of item the player's team can carry.
 
 
=== Returns ===
 
The number of items.
 
== GAME:GetPlayerEquippedItem(System.Int32) ==
 
 
Gets the equipped item for the character in the specified slot.


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
}}
|}


* <code>slot</code>: The team slot of the character to check
== GetGuestEquippedItem ==
 
=== Returns ===
 
The character's equipped item
 
== GAME:GetGuestEquippedItem(System.Int32) ==
 
 
Gets the equipped item for the character in the specified guest slot.


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
}}
|}


* <code>slot</code>: The guest slot of the character to check
== GivePlayerItem ==
 
=== Returns ===
 
The character's equipped item
 
== GAME:GivePlayerItem(RogueEssence.Dungeon.InvItem) ==
 


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
}}
|}


=== Arguments ===
=== Context 2 ===
 
In this context, the item is defined in the script. {{FuncUsage|nmspace=GAME|nm=GivePlayerItem|args=id, count, cursed, hiddenVal}}
* <code>item</code>: The item to give
{| class="wikitable"
 
{{ArgHeader}}
== GAME:GivePlayerItem(System.String,System.Int32,System.Boolean,System.String) ==
{{ArgRow
 
|name=id
 
|type=String
Gives an item and adds it to the player team's bag.
|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=
}}
|}


* <code>id</code>: The ID of the item
== TakePlayerBagItem ==
* <code>count</code>: The amount to give. Default 1
* <code>cursed</code>: Whether the item is cursed. Default false.
* <code>hiddenval</code>: The hidden value of the item. Default empty string.
 
== GAME:GetPlayerBagItem(System.Int32) ==
 
 
Gets the item found at the specified slot of the player's bag.
 
 
=== Arguments ===
 
* <code>slot</code>: The slot to check
 
=== Returns ===
 
The item found in the slot
 
== GAME:TakePlayerBagItem(System.Int32,System.Boolean) ==
 
 
Remove an item from player inventory
 
 
=== Arguments ===
 
* <code>slot</code>: The slot from which to remove the item
* <code>takeAll</code>: None
 
== GAME:TakePlayerEquippedItem(System.Int32,System.Boolean) ==
 
 
Remove the equipped item from a chosen member of the team


Remove an item from player's inventory. {{FuncUsage|nmspace=GAME|nm=TakePlayerBagItem|args= takeAll, slot}}


=== Arguments ===
=== Arguments ===


* <code>slot</code>: The slot of the character on the team from which to remove the item
{| class="wikitable"
* <code>takeAll</code>: None
{{ArgHeader}}
 
{{ArgRow
== GAME:TakeGuestEquippedItem(System.Int32,System.Boolean) ==
|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 guest of the team
Remove the equipped item from a chosen member of the team. {{FuncUsage|nmspace=GAME|nm=TakePlayerEquippedItem|args=slot, takeAll}}
 


=== Arguments ===
=== Arguments ===


* <code>slot</code>: The slot of the character on the team's guest list from which to remove the item
{| class="wikitable"
* <code>takeAll</code>: None
{{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)
}}
|}


== GAME:GetPlayerStorageCount ==
== TakeGuestEquippedItem ==
 
 
Get the amount of items in the player's storage
 
 
== GAME:GetPlayerStorageItemCount(System.String) ==
 
 
Get the amount of a specific item in the player's storage


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)
}}
|}


* <code>id</code>: ID of the item ot check
== GetPlayerStorageCount ==
 
=== Returns ===
 
The amount of copies currently in storage


== GAME:GivePlayerStorageItem(RogueEssence.Dungeon.InvItem) ==
Returns the amount of items in the player's storage.


== GetPlayerStorageItemCount ==


Gives an item and adds it to the player team's storage.
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
}}
|}


* <code>item</code>: The item to give
== GivePlayerStorageItem ==


== GAME:GivePlayerStorageItem(System.String,System.Int32,System.Boolean,System.String) ==
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.
}}
|}


Gives an item and adds it to the player team's storage.


== TakePlayerStorageItem ==


=== Arguments ===
Takes an item from the storage. {{FuncUsage|nmspace=GAME|nm=TakePlayerStorageItem|args=id}}
 
* <code>id</code>: The ID of the item
* <code>count</code>: The amount to give. Default 1
* <code>cursed</code>: Whether the item is cursed. Default false.
* <code>hiddenval</code>: The hidden value of the item. Default empty string.
 
== GAME:TakePlayerStorageItem(System.String) ==
 
 
Takes an item from the storage
 


=== Arguments ===
=== Arguments ===


* <code>id</code>: The ID of the item to take
{| class="wikitable"
 
{{ArgHeader}}
== GAME:DepositAll ==
{{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.