Lua API catalogs: Difference between revisions
Jump to navigation
Jump to search
Add the world item catalog planned for G1R:MP update 0.1.2 |
Update G1R:MP 0.1.2 API documentation |
||
| Line 20: | Line 20: | ||
| [[Monster type catalog]] || [[spawnMonster]] | | [[Monster type catalog]] || [[spawnMonster]] | ||
|- | |- | ||
| [[World item catalog]] <span style="color:#c62828; font-weight:bold;">( | | [[World item catalog]] <span style="color:#000; background:#ffcdd2; border:1px solid #c62828; font-weight:bold; padding:0.08em 0.35em; border-radius:0.2em;">(available from update 0.1.2)</span> || [[spawnItem]] and [[spawnTestItem]] | ||
|} | |} | ||
Revision as of 18:42, 3 September 2026
Lua API catalogs collect stable, server-validated keys used by G1R:MP resources. Prefer catalog keys and enumeration functions over hard-coded Unreal paths.
Static catalogs
| Catalog | Used by |
|---|---|
| Player skin catalog | setPlayerSkin, setNpcSkin |
| Player body catalog | deprecated compatibility reference for setPlayerBody |
| Player face catalog | deprecated compatibility reference for setPlayerFace |
| Player head catalog | deprecated compatibility reference for setPlayerHead |
| Player identity catalog | supported complete identity setter setPlayerIdentity |
| Synchronized spell catalog | basic synchronized spell set for G1R:MP 0.1a |
| Monster type catalog | spawnMonster |
| World item catalog (available from update 0.1.2) | spawnItem and spawnTestItem |
Runtime catalogs
These functions return the authoritative keys supported by the running server build:
| Function | Values |
|---|---|
| getPlayerArmorNames | Armor keys |
| getPlayerWeaponNames | Melee weapon keys |
| getPlayerRangedWeaponNames | Bow and crossbow keys |
| getPlayerAmmunitionNames | Ammunition keys |
| getPlayerRuneNames | All rune/spell-item keys; not a synchronization-support list |
| getSpellCatalog | All spell definitions and their implemented status; see Synchronized spell catalog
|
| getPlayerStatNames | Progression statistic keys |
| getPlayerSkillNames | Skill keys |
| getPlayerGuildNames | Guild keys |
Example
local function contains(values, wanted)
for _, value in ipairs(values) do
if value == wanted then
return true
end
end
return false
end
if contains(getPlayerArmorNames(), "none") then
setPlayerArmor(playerId, "none")
end