From 7427396a02dd8587be23c196e2073f783f1983ab Mon Sep 17 00:00:00 2001 From: Emagi Date: Mon, 19 May 2025 13:13:42 -0400 Subject: [PATCH] Additional LUA function docs --- .../RemovePrimaryEntityCommand.md | 16 ++++++++++ .../ResetCharacterTitlePrefix.md | 22 ++++++-------- .../ResetCharacterTitleSuffix.md | 22 ++++++-------- .../lua_functions/SendUpdateDefaultCommand.md | 29 ++++++++++--------- .../lua_functions/SetAccessToEntityCommand.md | 20 +++++++++++++ .../SetAccessToEntityCommandByCharID.md | 20 +++++++++++++ 6 files changed, 89 insertions(+), 40 deletions(-) create mode 100644 docs/lua_functions/RemovePrimaryEntityCommand.md create mode 100644 docs/lua_functions/SetAccessToEntityCommand.md create mode 100644 docs/lua_functions/SetAccessToEntityCommandByCharID.md diff --git a/docs/lua_functions/RemovePrimaryEntityCommand.md b/docs/lua_functions/RemovePrimaryEntityCommand.md new file mode 100644 index 0000000..658de49 --- /dev/null +++ b/docs/lua_functions/RemovePrimaryEntityCommand.md @@ -0,0 +1,16 @@ +Function: RemovePrimaryEntityCommand(Spawn, CommandString) + +Description: Removes a previously added primary entity command from the specified spawn entirely. Players will no longer see that option when interacting with the spawn. + +Parameters: + + Spawn: Spawn – The entity from which to remove the command. + + CommandString: String – The name of the command to remove. + +Returns: None. + +Example: + +-- Example usage (Remove hail from command list) +RemovePrimaryEntityCommand(QuestNPC, "hail") \ No newline at end of file diff --git a/docs/lua_functions/ResetCharacterTitlePrefix.md b/docs/lua_functions/ResetCharacterTitlePrefix.md index b1fcca0..0150490 100644 --- a/docs/lua_functions/ResetCharacterTitlePrefix.md +++ b/docs/lua_functions/ResetCharacterTitlePrefix.md @@ -1,18 +1,14 @@ -### Function: ResetCharacterTitlePrefix(param1, param2, param3) +Function: ResetCharacterTitlePrefix(Player) -**Description:** -Placeholder description. +Description: Clears the player’s current prefix title, so no prefix is shown before their name. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +Parameters: -**Returns:** None. + Player: Spawn – The player whose prefix to clear. -**Example:** +Returns: None. -```lua --- Example usage -ResetCharacterTitlePrefix(..., ..., ...) -``` +Example: + +-- Example usage (player relinquishes a bestowed noble title) +ResetCharacterTitlePrefix(Player) \ No newline at end of file diff --git a/docs/lua_functions/ResetCharacterTitleSuffix.md b/docs/lua_functions/ResetCharacterTitleSuffix.md index 70403f1..56f8cff 100644 --- a/docs/lua_functions/ResetCharacterTitleSuffix.md +++ b/docs/lua_functions/ResetCharacterTitleSuffix.md @@ -1,18 +1,14 @@ -### Function: ResetCharacterTitleSuffix(param1, param2, param3) +Function: ResetCharacterTitleSuffix(Player) -**Description:** -Placeholder description. +Description: Removes any suffix title currently displayed on the player, resetting it to none. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +Parameters: -**Returns:** None. + Player: Spawn – The player whose suffix title to clear. -**Example:** +Returns: None. -```lua --- Example usage -ResetCharacterTitleSuffix(..., ..., ...) -``` +Example: + +-- Example usage (player chooses to hide their suffix title) +ResetCharacterTitleSuffix(Player) \ No newline at end of file diff --git a/docs/lua_functions/SendUpdateDefaultCommand.md b/docs/lua_functions/SendUpdateDefaultCommand.md index 2bb5e3e..857405f 100644 --- a/docs/lua_functions/SendUpdateDefaultCommand.md +++ b/docs/lua_functions/SendUpdateDefaultCommand.md @@ -1,19 +1,20 @@ -### Function: SendUpdateDefaultCommand(param1, param2, param3, param4) +Function: SendUpdateDefaultCommand(Spawn, Distance, CommandString, Player) -**Description:** -Placeholder description. +Description: Updates the default highlighted command for an entity, as seen on hover or target window. This is often used after changing accessible commands to ensure the correct default action (usually the first allowed command) is highlighted. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: float - Floating point value. -- `param3`: string - String value. -- `param4`: Spawn - The spawn or entity involved. +Parameters: -**Returns:** None. + Spawn: Spawn – The entity to update. -**Example:** + Distance: Float – The maximum distance the command can be used. -```lua --- Example usage -SendUpdateDefaultCommand(..., ..., ..., ...) -``` + CommandString: String – The command to provide access. + + Player: Spawn – The player whom has access to the command (optional to specify a specific Player). + +Returns: None. + +Example: + +-- Example usage (after toggling commands on an NPC, refresh its default action) +SendUpdateDefaultCommand(NPC, 10.0, "hail") \ No newline at end of file diff --git a/docs/lua_functions/SetAccessToEntityCommand.md b/docs/lua_functions/SetAccessToEntityCommand.md new file mode 100644 index 0000000..469808e --- /dev/null +++ b/docs/lua_functions/SetAccessToEntityCommand.md @@ -0,0 +1,20 @@ +Function: SetAccessToEntityCommand(Spawn, Player, CommandString, Allowed) + +Description: Controls whether a particular primary entity command (right-click option) is enabled for a given spawn. You can use this to enable or disable specific interactions dynamically. + +Parameters: + + Spawn: Spawn – The entity whose command access to modify. + + Player: Spawn – The Player who will receive access to the command. + + CommandString: String – The name of the command (same as used in AddPrimaryEntityCommand). + + Allowed: UInt8 – `1` to allow players to use this command on the spawn; `0` to remove it. + +Returns: Return's true if successfully adding access to the entity command. + +Example: + +-- Example usage (disable the 'Buy' option on a merchant after shop closes) +SetAccessToEntityCommand(MerchantNPC, "Buy", 0) \ No newline at end of file diff --git a/docs/lua_functions/SetAccessToEntityCommandByCharID.md b/docs/lua_functions/SetAccessToEntityCommandByCharID.md new file mode 100644 index 0000000..c19e6e0 --- /dev/null +++ b/docs/lua_functions/SetAccessToEntityCommandByCharID.md @@ -0,0 +1,20 @@ +Function: SetAccessToEntityCommandByCharID(Spawn, CharID, CommandString, Allowed) + +Description: Similar to SetAccessToEntityCommand, but targets a specific player (by character ID) and spawn. It toggles a command’s availability for that one player on the given spawn. + +Parameters: + + Spawn: Spawn – The entity offering the command. + + CharID: Int32 – The character ID of the player whose access to adjust. + + CommandString: String – The command name. + + Allowed: UInt8 – `1` to allow that player to use the command; `0` to deny them. + +Returns: If successful at setting permission to the entity command, function return's true. + +Example: + +-- Example usage (allow only a specific player to use a secret door’s “Open” command) +SetAccessToEntityCommandByCharID(SecretDoor, PlayerCharID, "Open", 1) \ No newline at end of file