Global Lua Functions: Difference between revisions
Created page with "The following are '''global Lua functions''' — that is, they are accessible from within any Lua script and are not part of another module. == <code>CH(id)</code> == Returns the <code> Character</code> with the provided string <code>id</code> in the current map. == <code>OBJ(id)</code> == Returns the <code> Object</code> with the provided string <code>id</code> in the current map. Does not work in dungeon maps...." |
|||
| Line 13: | Line 13: | ||
Given the default (typically, English) string <code>name</code> of a character on the current ground map, returns that character's name in the language the game is currently set to, if they have a different name in that language. Does not work in dungeon maps. | Given the default (typically, English) string <code>name</code> of a character on the current ground map, returns that character's name in the language the game is currently set to, if they have a different name in that language. Does not work in dungeon maps. | ||
== <code>IDX(id [form, skin, gender])</code> == | == <code>IDX(id, [form, skin, gender])</code> == | ||
Creates a new [[MonsterID Reference | MonsterID]] with the provided parameters. <code>form</code>, <code>skin</code>, and <code>gender</code> are optional. | Creates a new [[MonsterID Reference | MonsterID]] with the provided parameters. <code>form</code>, <code>skin</code>, and <code>gender</code> are optional. | ||
Latest revision as of 00:57, 11 August 2025
The following are global Lua functions — that is, they are accessible from within any Lua script and are not part of another module.
CH(id)
Returns the Character with the provided string id in the current map.
OBJ(id)
Returns the Object with the provided string id in the current map. Does not work in dungeon maps.
MRKR(id)
Returns the Marker with the provided string id in the current map. Does not work in dungeon maps.
CHName(name)
Given the default (typically, English) string name of a character on the current ground map, returns that character's name in the language the game is currently set to, if they have a different name in that language. Does not work in dungeon maps.
IDX(id, [form, skin, gender])
Creates a new MonsterID with the provided parameters. form, skin, and gender are optional.
LTBL(entity)
Given an entity (such as a Character), returns that entity's LuaData table.
SPWN(id)
Returns the NPC spawner with the provided string id in the current map.
