User Tools

Site Tools


character

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
character [2024/10/22 23:45] justincharacter [2025/03/11 20:24] (current) justin
Line 13: Line 13:
  
 ^Function^Description^ ^Function^Description^
-|<character>.get_item_count("x")|Gives the count of a specific [[item]] in the [[character|character's]] [[inventory]], where "x" is a [[string]] containing the ID of the [[item]]. For example, **player.get_item_count("ITEM_0001")** will return how many of "ITEM_0001" the player possesses.|+|<character>.get_item_count("x")|Gives the count of a specific [[item]] in the [[character|character's]] [[inventory]], where "x" is a [[string]] containing the ID of the [[item]]. For example, you can use **player.get_item_count("ITEM_0001")** to check how many of "ITEM_0001" the player possesses.|
  
 ^Property^Description^ ^Property^Description^
Line 33: Line 33:
 |<character>.interact_cursor|Interaction cursor for the character, as set in the [[Map Editor]] from the [[Entity Properties]] panel. This can be used to either retrieve or change the interaction cursor for the character. Valid values include "default", "walk", "interact", "speak", "attack", or any custom cursor defined in your [[game configuration]].| |<character>.interact_cursor|Interaction cursor for the character, as set in the [[Map Editor]] from the [[Entity Properties]] panel. This can be used to either retrieve or change the interaction cursor for the character. Valid values include "default", "walk", "interact", "speak", "attack", or any custom cursor defined in your [[game configuration]].|
 |<character>.property["x"]|Custom property stored on the character, where "x" is a [[string]] containing the name of the property. This can be used to either retrieve or change the property's value.| |<character>.property["x"]|Custom property stored on the character, where "x" is a [[string]] containing the name of the property. This can be used to either retrieve or change the property's value.|
 +|<character>.properties|All custom properties defined for the character. As it's a [[codex]], its keys can be iterated using a “for” loop (refer to the [[codex]] documentation for an example).|
 |<character>.model|Name of the character's model (e.g. "purple_slime").| |<character>.model|Name of the character's model (e.g. "purple_slime").|
 |<character>.frame|Current [[animation]] frame (as a [[number]], with the first frame being 1). This can be used to either retrieve or change the model's current frame. If this property is changed and an [[animation]] is playing, the [[animation]] will first be stopped.| |<character>.frame|Current [[animation]] frame (as a [[number]], with the first frame being 1). This can be used to either retrieve or change the model's current frame. If this property is changed and an [[animation]] is playing, the [[animation]] will first be stopped.|
character.1729665924.txt.gz · Last modified: 2024/10/22 23:45 by justin