From 43c86e7533ed18052689eb618f23a89443d3b672 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Tue, 27 Dec 2022 04:39:50 -0800 Subject: [PATCH 1/2] Base comments --- docs/game-mechanics/scripting-system.rst | 56 +++++++++++++++--------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/docs/game-mechanics/scripting-system.rst b/docs/game-mechanics/scripting-system.rst index 21a171d..2644755 100644 --- a/docs/game-mechanics/scripting-system.rst +++ b/docs/game-mechanics/scripting-system.rst @@ -27,26 +27,42 @@ Methods - Localize(key: string) -GameObject ----------- - -- obj:GetVar(key: string) -- obj:SetVar(key: string, value: any) -- obj:SetNetworkVar(key: string, value: any) -- obj:GetNetworkVar(key: string) -> any -- obj:SendLuaNotificationRequest{requestTarget: GameObject, messageName: string} -- obj:SendLuaNotificationCancel{requestTarget: GameObject, messageName: string} -- obj:GetRotation() -> Rotation -- obj:Exists() -> bool -- obj:GetFlag{iFlagID: int} -> Flag -- obj:GetLocationsVisited() -> Locations -- obj:SetRotation{x: float , y: float, z: float , w: float} -- obj:SetProximityRadius{iconID: int, radius: int, name: string} -- obj:UnsetProximityRadius{name: string} -- obj:CheckListOfPreconditionsFromLua{PreconditionsToCheck: ?, requestingID: GameObject} -- obj:RequestPickTypeUpdate() -- obj:GetID() -- obj:NotifyObject{ name: string, param1: int, ObjIDSender: ObjectID} +GameObject :samp:`obj` +---------------------- +| :samp:`function GetVar(key: string)` +| Gets the variable associated with the key :samp:`key` attached to :samp:`obj`. Example :script:`ai/RACING/OBJECTS/RACE_SMASH_SERVER.lua`. +| :samp:`function SetVar(key: string, value: any)` +| Sets a variable on the Entity :samp:`obj` with the key :samp:`key` and the value :samp:`value`. Example :script:`ai/RACING/OBJECTS/RACE_SMASH_SERVER.lua`. +| :samp:`function SetNetworkVar(key: string, value: any)` +| Sets a networked variable on the Entity :samp:`obj` with the key :samp:`key` and the value :samp:`value`. The message :gm:client:`ScriptNetworkVarUpdate` is then sent to the client to communicate this update. Example :script:`ai/FV/L_FV_PANDA_SERVER.lua`. +| :samp:`function GetNetworkVar(key: string) -> any` +| Gets a networked variable associated with the key :samp:`key`. Example :script:`02_client/Enemy/General/L_DRAGON_SMASHING_GOLEM_QB_CLIENT.lua`. +| :samp:`function SendLuaNotificationRequest{requestTarget: GameObject, messageName: string}` +| Adds the function :file:`notify{messageName}` to the :samp:`obj` so that function is called when the same :file:`on{messageName}` is called on :samp:`obj`. Example :script:`equipmenttriggers/gempack.lua`. +| :samp:`function SendLuaNotificationCancel{requestTarget: GameObject, messageName: string}` +| Removes the function :file:`notify{messageName}` from :samp:`obj` notifications so the function is no longer called. Example :script:`equipmenttriggers/gempack.lua`. +| :samp:`function GetRotation() -> Rotation` +| Gets the rotation of the :samp:`obj`. The rotation is a :packet:`Quaternion `. Example :script:`client/ai/AG/L_AG_CUSTOM_ROCKET.lua`. +| :samp:`function SetRotation{x: float , y: float, z: float , w: float} or obj:SetRotation(Quaternion)` +| Sets the rotation for the :samp:`obj`. Example :script:`client/ai/AG/L_AG_CUSTOM_ROCKET.lua`. +| :samp:`function Exists() -> bool` +| Returns :samp:`true` of :samp:`obj` exists, :samp:`false` otherwise. Example :script:`client/ai/NP/L_NP_NPC.lua` +| :samp:`function GetFlag{iFlagID: int} -> Flag` +| Gets the flag :samp:`iFlagID` from :samp:`obj`. True if the flag is set, false otherwise. See :doc:`flag-system` for more info. Example :script:`02_client/Map/NT/L_NT_IMAGIMETER_VISIBILITY_CLIENT.lua` +| :samp:`function GetLocationsVisited() -> Locations` +| Gets the locations :samp:`obj` has visited. Example :script:`02_client/Map/General/L_CHOOSE_YOUR_DESTINATION_NS_TO_NT_CLIENT.lua` +| :samp:`function SetProximityRadius{iconID: int, radius: int, name: string, collisionGroup: int, shapeType: string, height: int}` +| Sets a proximity radius for :samp:`obj` with radius :samp:`radius`, height :samp:`height`, the shape :samp:`shapeType` and attaches it to the collisionGroup :samp:`collisionGroup`. This new proximity radius also has the name :samp:`name` and an icon :samp:`iconID`. Example :script:`ai/ACT/FootRace/L_ACT_BASE_FOOT_RACE_CLIENT.lua` +| :samp:`function UnsetProximityRadius{name: string}` +| Removes the proximity radius from the object with the name :samp:`name`. Example :script:`ai/AG/L_AG_QB_Elevator.lua` +| :samp:`function CheckListOfPreconditionsFromLua{PreconditionsToCheck: string? (there seems to be comparison of this var to ""), requestingID: GameObject}` +| Checks whether the preconditions :samp:`PreconditionsToCheck` are met for the :samp:`obj`. If a :samp:`requestingID` is provided, :samp:`requestingID` is the GameObject that is checking the preconditions. Example :script:`02_client/Map/AM/L_SKULLKIN_DRILL_CLIENT.lua` +| :samp:`function RequestPickTypeUpdate()` +| Used to update interactions? Example :script:`02_client/Map/AM/L_BLUE_X_CLIENT.lua` +| :samp:`function GetID()` +| Gets the GameObjectID of :samp:`obj`. Example :script:`o_ChoicebuildBonus.lua` +| :samp:`function NotifyObject{ name: string, param1: int, ObjIDSender: ObjectID}` +| Notifies the :samp:`obj` of the notification :samp:`name` with the optional parameter :samp:`param1` and the sender being :samp:`ObjIDSender`. Example :script:`ai/FV/L_FV_CONSOLE_RIGHT_QUICKBUILD.lua` Game Messages ^^^^^^^^^^^^^ From 7e90933aebd88c22d6d951a44901a14e9f4520f1 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Tue, 27 Dec 2022 04:44:22 -0800 Subject: [PATCH 2/2] Ignore .DS_Store Thanks Mac... --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index aa4300b..ea5e901 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ venv _build __pycache__ +.DS_Store