Conversation
lua/wire/gates/angle.lua
Outdated
| if !F then F = Angle (0, 0, 0) end | ||
| if !G then G = Angle (0, 0, 0) end | ||
| if !H then H = Angle (0, 0, 0) end | ||
| if !A then A = ang0 end |
There was a problem hiding this comment.
This is not good since if the output angle is modified in some way, then all the ang0 will receive that modification.
There was a problem hiding this comment.
So is this the same issue as with the table? Is a link being passed into the variable instead of the vector value?
There was a problem hiding this comment.
Gonna revert it then
There was a problem hiding this comment.
Yeah, all variables pointing to a same angle/vector will be changed if the values in one of them are changed.
6941693 to
131a120
Compare
lua/wire/gates/unitconv.lua
Outdated
| local speed = { | ||
| ["u/s"] = 1 / 0.75, | ||
| ["u/m"] = 60 * (1 / 0.75), | ||
| ["u/h"] = 3600 * (1 / 0.75), | ||
| ["mm/s"] = 25.4, | ||
| ["cm/s"] = 2.54, | ||
| ["dm/s"] = 0.254, | ||
| ["m/s"] = 0.0254, | ||
| ["km/s"] = 0.0000254, | ||
| ["in/s"] = 1, | ||
| ["ft/s"] = 1 / 12, | ||
| ["yd/s"] = 1 / 36, | ||
| ["mi/s"] = 1 / 63360, | ||
| ["nmi/s"] = 127 / 9260000, | ||
| ["mm/m"] = 60 * 25.4, | ||
| ["cm/m"] = 60 * 2.54, | ||
| ["dm/m"] = 60 * 0.254, | ||
| ["m/m"] = 60 * 0.0254, | ||
| ["km/m"] = 60 * 0.0000254, | ||
| ["in/m"] = 60, | ||
| ["ft/m"] = 60 / 12, | ||
| ["yd/m"] = 60 / 36, | ||
| ["mi/m"] = 60 / 63360, | ||
| ["nmi/m"] = 60 * 127 / 9260000, | ||
| ["mm/h"] = 3600 * 25.4, | ||
| ["cm/h"] = 3600 * 2.54, | ||
| ["dm/h"] = 3600 * 0.254, | ||
| ["m/h"] = 3600 * 0.0254, | ||
| ["km/h"] = 3600 * 0.0000254, | ||
| ["in/h"] = 3600, | ||
| ["ft/h"] = 3600 / 12, | ||
| ["yd/h"] = 3600 / 36, | ||
| ["mi/h"] = 3600 / 63360, | ||
| ["nmi/h"] = 3600 * 127 / 9260000, | ||
| ["mph"] = 3600 / 63360, | ||
| ["knots"] = 3600 * 127 / 9260000, | ||
| ["mach"] = 0.0254 / 295, | ||
| } | ||
| local length = { | ||
| ["u"] = 1 / 0.75, | ||
| ["mm"] = 25.4, | ||
| ["cm"] = 2.54, | ||
| ["dm"] = 0.254, | ||
| ["m"] = 0.0254, | ||
| ["km"] = 0.0000254, | ||
| ["in"] = 1, | ||
| ["ft"] = 1 / 12, | ||
| ["yd"] = 1 / 36, | ||
| ["mi"] = 1 / 63360, | ||
| ["nmi"] = 127 / 9260000, | ||
| } | ||
| local weight = { | ||
| ["g"] = 1000, | ||
| ["kg"] = 1, | ||
| ["t"] = 0.001, | ||
| ["oz"] = 1 / 0.028349523125, | ||
| ["lb"] = 1 / 0.45359237, | ||
| } |
There was a problem hiding this comment.
I think these tables could be made global for use in E2/Gates instead of duplicating the code
There was a problem hiding this comment.
May I put them in WireLib?
There was a problem hiding this comment.
This also isn't how conversions should be done. It should be two parameters, a 'from' and 'to' which are simple conversions from natural units to unit and the resulting conversion factor is then x = to/from.
e.g.
Hours -> Minutes
from = Hours (Hours would be 1/(60*60) using seconds as natural unit)
to = Minutes (Minutes would be 1/(60) using seconds as natural unit)
conversion factor = to/from = 60
There was a problem hiding this comment.
I guess with gates the functionality would be a lot more limited though so maybe nvm.
lua/wire/gates/serverinfo.lua
Outdated
| Server Info | ||
| ]] | ||
|
|
||
| local sv_hostip = game.GetIPAddress() |
There was a problem hiding this comment.
You can't cache ip because of this issue:
Facepunch/garrysmod-issues#3001
Entity gates: - entity_vehicle: returns the vehicle a player is sitting in - entity_getmovetype: returns move type enum (WALK, NOCLIP, FLY, etc.) - entity_activeweapon: returns the weapon a player is currently holding - entity_weapons: returns an array of all weapons in player inventory - entity_eyepos: returns the world position of a player's eyes - entity_getchildren: returns an array of children parented to an entity Ranger gates: - rd_hull_pos: hull trace between two positions with optional entity parenting - rd_hull_ang: hull trace by angle and distance with optional entity parenting - Both hull trace gates support Filter (ARRAY) and Parent (ENTITY) inputs Misc: - frametime: returns the time in seconds it took to render the last frame
Server info gates (serverinfo.lua): - sv_hostname: returns server hostname via GetHostName() - sv_hostip: returns server IP via game.GetIPAddress() - sv_map: returns current map name - sv_maxplayers: returns max player slot count - sv_numplayers: returns current player count - sv_gravity: returns gravity via sv_gravity convar - sv_airdensity: returns physics air density - sv_propgravity: returns gravity as a vector - sv_tickinterval: returns server tick interval Unit conversion gates (unitconv.lua): - unit_tounit: converts from Source units to a named unit - unit_fromunit: converts from a named unit back to Source units - unit_convertunit: converts between two named units of the same type
- sv_hostip doesn't use cache
2d2461c to
436afe6
Compare
|
Not sure whether to keep these as gates or add these settings to the Target Finder instead. |
|
Some make sense in target finder, others... I wouldn't expect to see them in it, like "entity_getchildren". The target finder is more or less mainly about finding a target and feeding data to a targeting computer for the purpose of guidance. I think maybe this would be more of an "entity info gate" if you wanted to roll them together. As far as selecting what entity, defaults might be what its attached to or owner of the ship/fpga as appropriate, but to target another entity, feeding target finder data into it would be needed (i cant remember, doesn't target finder have an entity output?) |
Specifically, I’m thinking about removing the separate find gates and instead modifying the Target Finder so that in the Filter you can specify a string with Lua patterns and choose the search shape — cone, box, or circle. Right now, Target Finder has as many Entity outputs as configured in its settings, but it doesn’t have an Array output. I’d like to change the way it works internally, but I’m worried that would break backward compatibility. |
|
Worst case scenario, you end up creating target finder 2. |
It might not be the end of the list, so feel free to suggest your ideas — what you’ve been missing in the gates and what would actually be useful in practice 🙃
Entity gates:
Ranger gates:
Misc: