Skip to content

Commit

Permalink
sentSpawn functionality (#3086)
Browse files Browse the repository at this point in the history
* sentSpawn functionality

* Comply with linter

* Move castings to E2/Wire lib

Moved casting and typeIdToString to E2Lib and WireLib.

Fixed major bug, where registered sents didn't check for prop protection, when creating constrains.

Changed comments a bit

* Update sents_default_params.lua

* Update prop.lua

* Moved sents_default_params.lua

Moved sents_default_params.lua
Renamed sents_default_params.lua
Changed the way to block sents, and renamed whitelist to registry, to reinforce reusability for thirdparty addons

* gmod_wire_value bug fixes

* remove whitespace -_-

* WireLib.SentSpawn.Unregister table removal fix
  • Loading branch information
deltamolfar authored Jun 27, 2024
1 parent 7ee8185 commit e587aec
Show file tree
Hide file tree
Showing 7 changed files with 1,840 additions and 2 deletions.
1 change: 1 addition & 0 deletions lua/autorun/wire_load.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ if SERVER then
include("wire/server/wirelib.lua")
include("wire/server/modelplug.lua")
include("wire/server/debuggerlib.lua")
include("wire/server/sents_registry.lua")

if CreateConVar("wire_force_workshop", "1", FCVAR_ARCHIVE, "Should Wire force all clients to download the Workshop edition of Wire, for models? (requires restart to disable)"):GetBool() then
if select(2, WireLib.GetVersion()):find("Workshop", 1, true) then
Expand Down
15 changes: 15 additions & 0 deletions lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ E2Helper.Descriptions["propSpawn(san)"] = "Model path, Rotation, Frozen Spawns a
E2Helper.Descriptions["propSpawn(ean)"] = "Rotation, Frozen Spawns a prop with the model of the template entity and rotated to the angle given. If frozen is 0, then it will spawn unfrozen."
E2Helper.Descriptions["propSpawn(svan)"] = "Model path, Position, Rotation, Frozen Spawns a prop with the model denoted by the string file path, at the position denoted by the vector, and rotated to the angle given. If frozen is 0, then it will spawn unfrozen."
E2Helper.Descriptions["propSpawn(evan)"] = "Position, Rotation, Frozen Spawns a prop with the model of the template entity, at the position denoted by the vector, and rotated to the angle given. If frozen is 0, then it will spawn unfrozen."
E2Helper.Descriptions["sentSpawn(s)"] = "Sent class - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
E2Helper.Descriptions["sentSpawn(sv)"] = "Sent class, Position - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
E2Helper.Descriptions["sentSpawn(st)"] = "Sent class, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
E2Helper.Descriptions["sentSpawn(sva)"] = "Sent class, Position, Rotation - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
E2Helper.Descriptions["sentSpawn(svat)"] = "Sent class, Position, Rotation, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
E2Helper.Descriptions["sentSpawn(svan)"] = "Sent class, Position, Rotation, Frozen - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
E2Helper.Descriptions["sentSpawn(svant)"] = "Sent class, Position, Rotation, Frozen, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
E2Helper.Descriptions["sentGetWhitelisted()"] = "Returns an array of classes, which is registered to the whitelist (can be spawned regardless of wire_expression2_propcore_sents_whitelist). (Can be used to make a lookup table)"
E2Helper.Descriptions["sentGetData(s)"] = "Returns a table, where keys are parameter names (key sensitive!) and values as a table, where first value is the (lua-)type and second value is the default value. (When spawning a sent values is being turned from E2 to Lua types. For example - vec(255,0,0) or vec4(255,0,0,255) is being turned to type Color (red))"
E2Helper.Descriptions["sentGetDataTypes(s)"] = "Returns a table, where keys are parameter names (key sensitive!) and values as (lua-)types. (When spawning a sent values is being turned from E2 to Lua types. For example - vec(255,0,0) or vec4(255,0,0,255) is being turned to type Color (red))"
E2Helper.Descriptions["sentGetDataDefaultValues(s)"] = "Returns a table, where keys are parameter names (key sensitive!) and values as default values, which will be applied if none would be provided."
E2Helper.Descriptions["sentCanCreate()"] = "Returns 1 if you can spawn a SENT, 0 otherwise. (Complete alias of propCanCreate())"
E2Helper.Descriptions["sentCanCreate(s)"] = "Returns 1 if you can spawn a provided class(type) SENT, 0 otherwise. (Accounts both for antispam and whitelist)"
E2Helper.Descriptions["sentIsWhitelist()"] = "Returns 1 if the whitelist is enabled, 0 otherwise."
E2Helper.Descriptions["sentIsEnabled()"] = "Returns 1 if server allows spawning sents, 0 otherwise."
E2Helper.Descriptions["seatSpawn(sn)"] = "Model path, Frozen Spawns a prop with the model denoted by the string filepath. If frozen is 0, then it will spawn unfrozen."
E2Helper.Descriptions["seatSpawn(svan)"] = E2Helper.Descriptions["seatSpawn(sn)"]
E2Helper.Descriptions["seatSpawn(svans)"] = E2Helper.Descriptions["seatSpawn(sn)"] .. " String seatType, determines what animations the seat will have. For example phx_seat2 and phx_seat3 will have Jeep and Airboat animations."
Expand Down
Loading

0 comments on commit e587aec

Please sign in to comment.