Main Page: Difference between revisions
Jump to navigation
Jump to search
Update Lua API overview |
Place the main wiki heading above release announcements |
||
| (14 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
<div style="max-width:58rem; color:#cfc8b8; font-size:1.02rem; line-height:1.55;">Build multiplayer resources and gamemodes with Lua 5.1. This wiki documents the server, client, networking, gameplay, database, and RmlUi APIs exposed by G1R:MP.</div> | <div style="max-width:58rem; color:#cfc8b8; font-size:1.02rem; line-height:1.55;">Build multiplayer resources and gamemodes with Lua 5.1. This wiki documents the server, client, networking, gameplay, database, and RmlUi APIs exposed by G1R:MP.</div> | ||
<div style="margin-top:1rem; color:#e1c36d; font-size:0.9rem;">Lua 5.1 • server and client resources • authoritative gameplay • RmlUi</div> | <div style="margin-top:1rem; color:#e1c36d; font-size:0.9rem;">Lua 5.1 • server and client resources • authoritative gameplay • RmlUi</div> | ||
</div> | |||
<div style="border:1px solid #b28a3d; border-left:4px solid #b28a3d; background:#faf9f5; padding:0.9rem 1rem; margin:0 0 1.2rem;"> | |||
'''G1R:MP 0.1.3 — official release, BUILD106 / Protocol 35.''' Windows client and Windows/Linux dedicated server downloads are available on the [https://g1r-mp.com/download/ Download page]. Update both the client and server. See [[Update 0.1.3]] for scripting additions and migration notes. | |||
</div> | |||
<div style="background:#fff8f8; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111; padding:0.95rem 1.1rem; margin:0 0 1.25rem;"> | |||
<div style="color:#111; font-size:1.05rem; font-weight:bold;">CHAPTER SCREENS — AVAILABLE FROM UPDATE 0.1.3</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.55;">'''2 new server-side functions''': [[showChapterScreen|ShowChapterScreen]] and [[hideChapterScreen|HideChapterScreen]] (also available with lower-camel aliases). Show custom chapter-style title cards without advancing the story. See [[Chapter screens]] for examples, validation, resource ownership and <code>/chaptertest</code>.</div> | |||
</div> | |||
<div style="background:#fff8f8; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111; padding:0.95rem 1.1rem; margin:0 0 1.25rem;"> | |||
<div style="color:#111; font-size:1.05rem; font-weight:bold; letter-spacing:0.04em;">OBSERVER NAMEPLATES — AVAILABLE FROM UPDATE 0.1.3</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.55;">'''12 new server-side functions''' add per-observer text, whole-label visibility and numeric-ID policy. Build directional acquaintance presentation with exclusive resource-owned fields and reliable relevance replay. See [[Observer nameplates]] for APIs, lifecycle, database integration and the optional three-client <code>/nametest</code> sequence. Overhead customization does not anonymize other packets, chat or player lists.</div> | |||
</div> | |||
<div style="background:#fff8f8; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111; padding:0.95rem 1.1rem; margin:0 0 1.25rem;"> | |||
<div style="color:#111; font-size:1.05rem; font-weight:bold; letter-spacing:0.04em;">PLAYER CUSTOMIZATION — AVAILABLE FROM UPDATE 0.1.3</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.55;">'''7 new server-side functions''' provide independent skin-color and tattoo overrides. Existing identity selection has improved head and armor compatibility from update 0.1.3. See [[Player customization]] for examples and reset behavior, and [[Player tattoo catalog]] for all 12 keys.</div> | |||
<div style="color:#111; margin-top:0.65rem; line-height:1.65;"><strong>Skin color:</strong> [[setPlayerSkinColor]] • [[getPlayerSkinColor]] • [[resetPlayerSkinColor]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Tattoos:</strong> [[setPlayerTattoo]] • [[getPlayerTattoo]] • [[resetPlayerTattoo]] • [[getPlayerTattooNames]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Improved existing API:</strong> [[setPlayerIdentity]] keeps the game-owned body and equipped armor. These are cosmetic controls, not a full NPC body/outfit replacement.</div> | |||
</div> | |||
<div style="background:#fff8f8; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111; padding:0.95rem 1.1rem; margin:0 0 1.25rem;"> | |||
<div style="color:#111; font-size:1.05rem; font-weight:bold; letter-spacing:0.04em;">SCRIPTED CAMERA — AVAILABLE FROM UPDATE 0.1.3</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.55;">'''15 camera functions''' and '''2 client camera events''' are available from G1R:MP 0.1.3. Build login backgrounds, fixed shots, smooth transitions, paths and orbits. See [[Scripted camera]] for examples, limits and client/server differences.</div> | |||
<div style="color:#111; margin-top:0.65rem; line-height:1.65;"><strong>Client and server (10):</strong> [[setCameraPos]] • [[setCameraRot]] • [[setCameraLookAt]] • [[setCameraFOV]] • [[setCameraPose]] • [[moveCameraTo]] • [[playCameraPath]] • [[orbitCamera]] • [[stopCameraMovement]] • [[resetCameraPos]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Client read-back (5):</strong> [[getCameraPos]] • [[getCameraRot]] • [[getCameraFOV]] • [[getCameraState]] • [[requestCameraState]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Client events (2):</strong> [[onClientCameraCommandResult]] • [[onClientCameraReset]]. Client commands use asynchronous acknowledgements; server calls return only a queued boolean.</div> | |||
</div> | |||
<div style="background:#fff8f8; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111; padding:0.95rem 1.1rem; margin:0 0 1.25rem;"> | |||
<div style="color:#111; font-size:1.05rem; font-weight:bold; letter-spacing:0.04em;">AVAILABLE AND IMPROVED FROM UPDATE 0.1.2</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.55;">The following '''40 Lua functions''' — 29 server-side and 11 client-side — are available from G1R:MP 0.1.2. Existing lifecycle, inventory, JSON, NPC, monster, and world-item APIs also include corrected or expanded behavior from this update.</div> | |||
<div style="color:#111; margin-top:0.65rem; line-height:1.65;"><strong>Accounts and consumables (4):</strong> [[completePlayerConsumableFinalize]] • [[completePlayerConsumableUse]] • [[getPlayerAccountBindingSerial]] • [[getPlayerConsumableNames]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>World items (1):</strong> [[spawnItem]] — see also the [[World item catalog]].</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Monster identity, health, and combat (5):</strong> [[setMonsterName]] • [[setMonsterIdVisible]] • [[setMonsterMaxHealth]] • [[getMonsterAttackDamage]] • [[setMonsterAttackDamage]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Monster navigation (6):</strong> [[setMonsterNavigationMode]] • [[setMonsterNavigationCollisionMode]] • [[setMonsterMoveGoal]] • [[stopMonsterMovement]] • [[testMonsterMove]] • [[walkMonsterTo]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>NPC identity and navigation (7):</strong> [[setNpcIdVisible]] • [[setNpcObstacleBehavior]] • [[setNpcNavigationMode]] • [[setNpcNavigationCollisionMode]] • [[setNpcMoveGoal]] • [[stopNpcMovement]] • [[testNpcMove]]</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Custom navigation blockers (6):</strong> [[createAiNavigationBlocker]] • [[updateAiNavigationBlocker]] • [[setAiNavigationBlockerEnabled]] • [[destroyAiNavigationBlocker]] • [[getAiNavigationBlockerData]] • [[getAiNavigationBlockers]] — see [[NPC and monster navigation collision]].</div> | |||
<div style="color:#111; margin-top:0.35rem; line-height:1.65;"><strong>Client audio (11):</strong> [[playSound]] • [[playSound3D]] • [[stopSound]] • [[setSoundVolume]] • [[getSoundVolume]] • [[setSoundPaused]] • [[isSoundPaused]] • [[isSoundPlaying]] • [[setSoundLooped]] • [[setSound3DPosition]] • [[setSound3DMinMaxDistance]] — see [[Client audio]].</div> | |||
<div style="color:#111; margin-top:0.65rem; line-height:1.65;"><strong>Events available from 0.1.2 (8):</strong> [[onNpcIdVisibilityChange]] • [[onMonsterNameChange]] • [[onMonsterIdVisibilityChange]] • [[onMonsterMoveBlocked]] • [[onMonsterMoveComplete]] • [[onNpcMoveBlocked]] • [[onNpcMoveComplete]] • [[onWorldItemDrop]]. Existing [[onPlayerJoin]], [[onPlayerQuit]], [[onWorldItemPickup]], and [[onWorldItemSpawn]] contracts are also improved from 0.1.2.</div> | |||
</div> | </div> | ||
| Line 16: | Line 61: | ||
<li>[[:Category:Lua Functions|Complete function catalog]]</li> | <li>[[:Category:Lua Functions|Complete function catalog]]</li> | ||
<li>[[Lua events|Complete event and callback catalog]]</li> | <li>[[Lua events|Complete event and callback catalog]]</li> | ||
<li>[[Scripting limits|Lua, resource and API limits — 0.1.3 BUILD81]]</li> | |||
<li>[[Lua API catalogs|Validated skin, monster, equipment, and gameplay keys]]</li> | |||
<li>[[NPC and monster navigation collision|NPC and monster navigation collision]]</li> | |||
<li>[[Client audio|Client audio and synchronized 3D playback]]</li> | |||
<li>[[Scripted camera|Scripted camera and moving login backgrounds (0.1.3)]]</li> | |||
<li>[[Chapter screens|Custom chapter title cards (0.1.3)]]</li> | |||
<li>[[Observer nameplates|Observer-specific labels and acquaintance presentation (0.1.3)]]</li> | |||
<li>[[:Category:Resource Functions|Resource lifecycle functions]]</li> | <li>[[:Category:Resource Functions|Resource lifecycle functions]]</li> | ||
<li>[[:Category:Lua Examples|Lua examples]]</li> | <li>[[:Category:Lua Examples|Lua examples]]</li> | ||
<li>[[Hosting a G1R:MP dedicated server|Hosting a dedicated server]]</li> | |||
<li>[[:Category:Experimental Lua API|Experimental API status]]</li> | <li>[[:Category:Experimental Lua API|Experimental API status]]</li> | ||
</ul> | </ul> | ||
| Line 28: | Line 81: | ||
<li>[[:Category:Server Functions|Server-side functions]]</li> | <li>[[:Category:Server Functions|Server-side functions]]</li> | ||
<li>[[:Category:Client Functions|Client-side functions]]</li> | <li>[[:Category:Client Functions|Client-side functions]]</li> | ||
<li>[[:Category:Audio Functions|Client audio functions]]</li> | |||
<li>[[:Category:Shared Functions|Shared functions]]</li> | <li>[[:Category:Shared Functions|Shared functions]]</li> | ||
<li>[[:Category:Server Events|Server-side events]]</li> | <li>[[:Category:Server Events|Server-side events]]</li> | ||
| Line 50: | Line 104: | ||
<div>[[:Category:World Functions|World time and weather]]</div> | <div>[[:Category:World Functions|World time and weather]]</div> | ||
<div>[[:Category:Monster Functions|Monsters]]</div> | <div>[[:Category:Monster Functions|Monsters]]</div> | ||
<div>[[:Category:Navigation Functions|AI navigation]]</div> | |||
<div>[[:Category:Interaction Functions|Interactions]]</div> | <div>[[:Category:Interaction Functions|Interactions]]</div> | ||
</div> | </div> | ||
| Line 59: | Line 114: | ||
<div>[[:Category:GUI Functions|RmlUi and GUI]]</div> | <div>[[:Category:GUI Functions|RmlUi and GUI]]</div> | ||
<div>[[:Category:Database Functions|Database]]</div> | <div>[[:Category:Database Functions|Database]]</div> | ||
<div>[[Known issue: MySQL error 2006 (Server has gone away)|Known MySQL/MariaDB issue]]</div> | |||
<div>[[:Category:Timer Functions|Timers]]</div> | <div>[[:Category:Timer Functions|Timers]]</div> | ||
<div>[[:Category:Command Functions|Commands]]</div> | <div>[[:Category:Command Functions|Commands]]</div> | ||
<div>[[:Category:Chat Functions|Chat]]</div> | <div>[[:Category:Chat Functions|Chat]]</div> | ||
<div>[[:Category:Animation Functions|Animations]]</div> | <div>[[:Category:Animation Functions|Animations]]</div> | ||
<div>[[Client audio|Client audio and OGG playback]]</div> | |||
<div>[[:Category:Camera Functions|Camera]]</div> | <div>[[:Category:Camera Functions|Camera]]</div> | ||
<div>[[Lua events|Events and callbacks]]</div> | <div>[[Lua events|Events and callbacks]]</div> | ||
| Line 95: | Line 152: | ||
<div style="flex:1 1 22rem; border-top:3px solid #6f8461; background:#f5f2e9; padding:1rem 1.15rem;"> | <div style="flex:1 1 22rem; border-top:3px solid #6f8461; background:#f5f2e9; padding:1rem 1.15rem;"> | ||
<div style="font-size:1.2rem; font-weight:bold; margin-bottom:0.4rem;">Documentation status</div> | <div style="font-size:1.2rem; font-weight:bold; margin-bottom:0.4rem;">Documentation status</div> | ||
<div style="line-height:1.6;">The reference | <div style="line-height:1.6;">The reference contains '''312 Lua functions''' and '''94 events''', including '''2 chapter-screen functions, 12 observer/nameplate-ID functions, 7 skin-color/tattoo functions, 15 camera functions and 2 camera events available from update 0.1.3'''. Version notices distinguish newly available APIs from improved contracts in earlier APIs. See [[Chapter screens]] for custom title cards, [[Observer nameplates]] for directional labels, [[Player customization]] for identity, color and tattoos, [[Lua API catalogs]] for validated gameplay keys, and [[Scripted camera]] for camera state and lifecycle rules. APIs marked [[:Category:Experimental Lua API|experimental]] may still change while the multiplayer runtime is under active development.</div> | ||
</div> | </div> | ||
</div> | </div> | ||
[[Category:Lua API]] | [[Category:Lua API]] | ||
Latest revision as of 00:41, 13 September 2026
Gothic 1 Remake Multiplayer
G1R:MP Scripting Wiki
Build multiplayer resources and gamemodes with Lua 5.1. This wiki documents the server, client, networking, gameplay, database, and RmlUi APIs exposed by G1R:MP.
Lua 5.1 • server and client resources • authoritative gameplay • RmlUi
G1R:MP 0.1.3 — official release, BUILD106 / Protocol 35. Windows client and Windows/Linux dedicated server downloads are available on the Download page. Update both the client and server. See Update 0.1.3 for scripting additions and migration notes.
CHAPTER SCREENS — AVAILABLE FROM UPDATE 0.1.3
2 new server-side functions: ShowChapterScreen and HideChapterScreen (also available with lower-camel aliases). Show custom chapter-style title cards without advancing the story. See Chapter screens for examples, validation, resource ownership and
/chaptertest.OBSERVER NAMEPLATES — AVAILABLE FROM UPDATE 0.1.3
12 new server-side functions add per-observer text, whole-label visibility and numeric-ID policy. Build directional acquaintance presentation with exclusive resource-owned fields and reliable relevance replay. See Observer nameplates for APIs, lifecycle, database integration and the optional three-client
/nametest sequence. Overhead customization does not anonymize other packets, chat or player lists.PLAYER CUSTOMIZATION — AVAILABLE FROM UPDATE 0.1.3
7 new server-side functions provide independent skin-color and tattoo overrides. Existing identity selection has improved head and armor compatibility from update 0.1.3. See Player customization for examples and reset behavior, and Player tattoo catalog for all 12 keys.
Improved existing API: setPlayerIdentity keeps the game-owned body and equipped armor. These are cosmetic controls, not a full NPC body/outfit replacement.
SCRIPTED CAMERA — AVAILABLE FROM UPDATE 0.1.3
15 camera functions and 2 client camera events are available from G1R:MP 0.1.3. Build login backgrounds, fixed shots, smooth transitions, paths and orbits. See Scripted camera for examples, limits and client/server differences.
Client and server (10): setCameraPos • setCameraRot • setCameraLookAt • setCameraFOV • setCameraPose • moveCameraTo • playCameraPath • orbitCamera • stopCameraMovement • resetCameraPos
Client read-back (5): getCameraPos • getCameraRot • getCameraFOV • getCameraState • requestCameraState
Client events (2): onClientCameraCommandResult • onClientCameraReset. Client commands use asynchronous acknowledgements; server calls return only a queued boolean.
AVAILABLE AND IMPROVED FROM UPDATE 0.1.2
The following 40 Lua functions — 29 server-side and 11 client-side — are available from G1R:MP 0.1.2. Existing lifecycle, inventory, JSON, NPC, monster, and world-item APIs also include corrected or expanded behavior from this update.
Accounts and consumables (4): completePlayerConsumableFinalize • completePlayerConsumableUse • getPlayerAccountBindingSerial • getPlayerConsumableNames
World items (1): spawnItem — see also the World item catalog.
Monster identity, health, and combat (5): setMonsterName • setMonsterIdVisible • setMonsterMaxHealth • getMonsterAttackDamage • setMonsterAttackDamage
Monster navigation (6): setMonsterNavigationMode • setMonsterNavigationCollisionMode • setMonsterMoveGoal • stopMonsterMovement • testMonsterMove • walkMonsterTo
NPC identity and navigation (7): setNpcIdVisible • setNpcObstacleBehavior • setNpcNavigationMode • setNpcNavigationCollisionMode • setNpcMoveGoal • stopNpcMovement • testNpcMove
Custom navigation blockers (6): createAiNavigationBlocker • updateAiNavigationBlocker • setAiNavigationBlockerEnabled • destroyAiNavigationBlocker • getAiNavigationBlockerData • getAiNavigationBlockers — see NPC and monster navigation collision.
Client audio (11): playSound • playSound3D • stopSound • setSoundVolume • getSoundVolume • setSoundPaused • isSoundPaused • isSoundPlaying • setSoundLooped • setSound3DPosition • setSound3DMinMaxDistance — see Client audio.
Events available from 0.1.2 (8): onNpcIdVisibilityChange • onMonsterNameChange • onMonsterIdVisibilityChange • onMonsterMoveBlocked • onMonsterMoveComplete • onNpcMoveBlocked • onNpcMoveComplete • onWorldItemDrop. Existing onPlayerJoin, onPlayerQuit, onWorldItemPickup, and onWorldItemSpawn contracts are also improved from 0.1.2.
Start here
Find the right entry point for your first resource.
- Lua API overview
- Complete function catalog
- Complete event and callback catalog
- Lua, resource and API limits — 0.1.3 BUILD81
- Validated skin, monster, equipment, and gameplay keys
- NPC and monster navigation collision
- Client audio and synchronized 3D playback
- Scripted camera and moving login backgrounds (0.1.3)
- Custom chapter title cards (0.1.3)
- Observer-specific labels and acquaintance presentation (0.1.3)
- Resource lifecycle functions
- Lua examples
- Hosting a dedicated server
- Experimental API status
Reference by execution side
Check where a function is available before using it.
Gameplay
Your first server script
The following example welcomes a joining player and places them at an authoritative spawn point:
addEventHandler("onPlayerJoin", root, function(playerId)
setPlayerName(playerId, "Newcomer")
spawnPlayer(playerId, 12.0, 24.0, 2.0, 90)
outputChatBox("Welcome to G1R:MP!", playerId, 225, 195, 110)
end)
See onPlayerJoin, addEventHandler, setPlayerName, spawnPlayer, and outputChatBox for parameter details and additional examples.
Documentation status
The reference contains 312 Lua functions and 94 events, including 2 chapter-screen functions, 12 observer/nameplate-ID functions, 7 skin-color/tattoo functions, 15 camera functions and 2 camera events available from update 0.1.3. Version notices distinguish newly available APIs from improved contracts in earlier APIs. See Chapter screens for custom title cards, Observer nameplates for directional labels, Player customization for identity, color and tattoos, Lua API catalogs for validated gameplay keys, and Scripted camera for camera state and lifecycle rules. APIs marked experimental may still change while the multiplayer runtime is under active development.