Commit Graph

4216 Commits

Author SHA1 Message Date
unknao
b33045715a
Add E2 functions "entity:setLocalPos" and "entity:setLocalAng" for manipulating parented props (#2728)
* Added E2 functions "setLocalPos" and "setLocalAng".

* Made changes according to feedback.
2023-08-17 13:40:19 -04:00
Denneisk
e9a0fd8e7c
Fix Unpredictable EGP Order Behavior (#2731)
* Port egp-fixes order functions

* Remove this silly thing
2023-08-17 13:38:55 -04:00
Vurv
a17c86300a Add bezier polyfills for old servers 2023-08-15 18:40:52 -07:00
Vurv
fea4110171 Hotfix for key filters
Fix regression in https://github.com/wiremod/wire/pull/2718
2023-08-14 00:10:07 -07:00
Vurv
4eeb9be221 Don't TriggerOutput on nonexistant outputs 2023-08-12 18:42:15 -07:00
Denneisk
4d4cc55c29
Clean up interpolation functions (#2717)
* Clean up interpolation functions.

* Lints and some formatting

* Use lshift

---------

Co-authored-by: Vurv <56230599+Vurv78@users.noreply.github.com>
2023-08-12 14:03:04 -07:00
Vurv
b170fcec34
Validate I/O in case addons pass incorrect values (#2720)
* Validate I/O in case addons pass incorrect values

* Make Zero a function to avoid mutating default value

* Remove redundant parenthesis

* Remove unused variable
2023-08-12 13:58:22 -07:00
Denneisk
214d47367a
Miscellaneous E2 player additions (#2718)
* Add e:accountID()
Add e:userID()
Add player(n)
Add teamMembers(n) and teamMemberCount(n) (deprecate teamPlayers)
Minor cleanup

* Add some exceptions
Clean entity:inVehicle()

* Lints

* Actually remove lints
2023-08-12 13:55:08 -07:00
Vurv
244828b55f
Better print function (#2691)
* Better print function

* Add perf check in array toString

* Add hard serverside limit

* Tweak opcosts & Remove arg limit

Removed that 256 limit on number of arguments passed. I doubt anyone will go over it but that limit was pointless now that you can print more than 256 chars.

toString methods that are called now have their initial opcosts added upon being used inside print(...)

print(...) has base cost of 40 ops now.

* Add type check to array tostring

To avoid ugly unquoted string, and default angle/vector output

* Use %g for vec/ang repr

* Fix lints
2023-08-12 13:53:59 -07:00
Vurv
c7cfcaa15a Hotfix for repeat exploit
Could pass nan into `times` and break prf.

Annoying. Probably want to make division by zero hard error your chip as to not deal with these possibilities.
2023-08-10 16:10:05 -07:00
stepa2
010d423fbe
Another RT Camera fix (#2719)
* Fixed RT Screen (sometimes) not disabling itself when camera is set to E2 noentity()

* Code style fix
2023-08-10 14:16:18 -04:00
Vurv
ccfd65ee6b
Add remote event as an alternative to datasignals/gtables (#2706)
* Add remote event

* Overload to triggerEventOmit

To avoid adding overhead to triggerEvent
2023-08-03 14:43:54 -04:00
Vurv
45711f2748
Add ignite and extinguish functions to E2 (#2699)
* Add ignite and extinguish

* Fix lints

Removed unused variables and converted C comments to Lua ones.

* Fix wirelib lints

* Ignite forever by default

* Default overload use 360 seconds and maximum 100 hours

No server should be running that long anyway.
2023-08-03 14:43:42 -04:00
Vurv
5ba05559de
Add entityCreated event (#2704)
* Add entityCreated event

* Add comment for timer.Simple usage
2023-08-03 14:43:24 -04:00
Redox
f1441604ca
Fix wire damage detector error (#2710)
* Check if table exists

* Remove unnecessary pcall

* Trim trialing whitespaces

* Set key_ents on Initialize
2023-08-03 12:40:52 -04:00
Haze_of_dream
c6e8f776c0
fix value part 2 (#2712) 2023-08-03 12:39:45 -04:00
Haze_of_dream
ff059c2986
Implement turret ConVars (#2702)
* Implement ConVars

* Update turret.lua

* fix value

* Update turret.lua

* Update gmod_wire_turret.lua

* Update gmod_wire_turret.lua

* Update gmod_wire_turret.lua

* spelling error

---------

Co-authored-by: thegrb93 <grbrown93@sbcglobal.net>
2023-08-02 22:51:46 -04:00
Vurv
6a5a00a011
Add stack limit to E2 executions (#2708)
* Add stack limit of 150 to E2 executions

* Default to 0 and remove assignment in tick

Shouldn't need to reassign to 1 on tick.

Also should start at 0 since we check the limit after incrementing it.
2023-07-31 16:13:44 -07:00
thegrb93
5d4d52e4c6
Rename RCOverride to something less conflicty 2023-07-28 13:57:47 -04:00
unknao
9fbf8f64e6
Add more keys to the Pod Controller (#2695)
* Fix effect playing inconsistency & remove useless effect object returns

* Readded the effect object returns on functions

* Update effects.lua

* Update effects.lua

* Added more buttons to the Pod Controller

* Fix indentation


---------
2023-07-28 13:54:36 -04:00
Haze_of_dream
0853ef1ef1
Better descriptions for confusing effect functions (#2694) 2023-07-28 13:49:59 -04:00
Aske
e92d48938b
Extend weapon functionality (#2683)
* Add new functions and events to e2 weapons

* Added permission checks and cvars

* Add convar requiored to E2helper and check isFriend

* Fixed lint

* Change perm checks and add weapon/ammo checks

Added check to stripWeapon to throw a runtime error in case the weapon class is invalid.

Changed logic for permissions to AND, so you could be either a friend or have cppi perms rather than needing both to access the functions.

Added check to the ammo functions to ensure the ammo type is valid, or else throw a runtime error

self.entity.player -> self.player

Changed invalid weapon error message for giveWeapon functions

Fix checkGive using incorrect variable (this) instead of (target)

---------

Co-authored-by: Vurv <56230599+Vurv78@users.noreply.github.com>
2023-07-27 10:52:29 -07:00
unknao
3294816401
Fix effect playing inconsistency & remove useless effect object returns (#2693)
* Fix effect playing inconsistency & remove useless effect object returns

* Readded the effect object returns on functions
2023-07-26 16:17:25 -04:00
StyledStrike
a40027b484
Show file name before deletion (#2690)
* Show file name before deletion

* Concatenate instead
2023-07-25 00:35:51 -04:00
Haze_of_dream
2eb82805e7
Fix FLIR grouping (#2688) 2023-07-23 20:02:45 -04:00
Twig
545bdbdbb0
Flix some of FLIR's issues with certain entities. (#2684) 2023-07-19 00:22:44 -04:00
Vurv
6157368bdd Use master deploy version
Won't need to bump anymore
2023-07-13 20:39:32 -07:00
Vurv
df37196489 Change deploy secrets 2023-07-13 18:14:04 -07:00
Vurv
46f84f9402
Add damage inflicting functions (#2675)
* Add damage inflicting functions

* Add op costs

* E2Helper descriptions

* Fallback to cantool for entities

* Check equality to false
2023-07-13 12:58:06 -07:00
Sandalot
1d1df708f1
Player changed team event (#2681)
Added E2 event for PlayerChangedTeam hook
2023-07-12 15:23:19 -04:00
Vurv
6e2aba39f4 Undo gpulib removal
This is why we need automated tests
2023-07-12 08:57:36 -07:00
Vurv
04cecd8bb4
String library refactors (#2665)
* refactor: adjust cost of string functions

Removed "temporary" cost of 20 ops for some string functions which was pretty outrageous.

Reduce n:toChar, s:toByte costs to 1 op.
Reduce s:toNumber to 2 ops.
Reduce toUnicodeChar and toUnicodeByte to 3 ops.
Reduce base cost of non pattern s:explode to 3 ops
Reduce cost of s:reverse() to 6 ops

Reduce base cost of format() to 3 ops.
Make format() cost an additional 2 ops per argument.

Match functions cost 10 ops now. Gmatch 12. matchFirst is cheaper.

Raise cost of remaining unicode functions to 3 ops.

* fix: add base check to `toNumber`

Prevents a lua error.

* feat: add strict error on invalid character range for `toChar` and `toUnicodeChar`

* feat: runtime error instead of just printing to chat

Now `format`, `match*`, `find*`, `replaceRE` and `explodeRE` throw strict errors upon failing, instead of just printing their message in the chat.

* refactor!: remove chatprints in case of e2function error

Removed in favor of `@strict` runtime errors.

* refactor: convert operators to e2function syntax

* refactor: move vec/ang concat operators to respective files

* fix: incorrect arguments passed to format

* perf: localize string method calls

Localize functions used for better performance.

Also lower op cost of basic operations to 1 from 2.

* fix: error with using incorrect e2function vararg type

* style: enforce consistent casing

* refactor!: more expensive unicode functions

these functions were ridiculously cheap, no idea who thought giving a **single** op for running utf8.len on a thousand character long string was a good idea.

* 1 op per length of string in unicodeLength
* 3 ops per codepoint returned in toUnicodeByte
* 4 ops per argument passed to toUnicodeChar

* refactor: remove pointless optimization & comments
2023-07-11 17:45:53 -07:00
Vurv
21b8efa24c
Fixes for cpu migration (#2673) 2023-07-11 16:20:50 -07:00
Vurv
96b8687509
Remove zasm and all of its components (#2669)
Unfortunately the developer hasn't been active for the past decade or so, and it's been causing a lot more harm than good recently.

Currently trying to plan a new chip to replace it.
2023-07-11 15:47:37 -04:00
Fasteroid
6893cb4504
more models + modelplug cleanup (#2563)
* refactor this terribleness

like actually who wrote this

* add epic led model

* less redundant file-exists checks

* minor syntax error

* cursed model

* more leds!

* I'm a huge fan!

(add computer fan model)

* remove big LED

(this was way too large)

* inductor model :)

* pick one damn it

tabs OR spaces, NOT BOTH!

* unspaghetti this crap

data plug has been missing models for years!

* more antispaghetti shennanigans

* several things

add usb-c plug and socket
fix bugs from unspaghetti commit
plugs play confirmation sound when linked

* shared modelplug

* improve lua autorefresh compatibility

* finally remove redundant angle offset code

* SD card & socket

* microusb :)

* all lint fixes

* more lint fixes
2023-07-10 16:58:10 -04:00
Vurv
0ed150eb47
feat: mark find* functions as nodiscard (#2666) 2023-07-09 21:08:19 -07:00
Vurv
6b49572caf
chore: update workshop deploy action 2023-07-06 15:24:30 -07:00
Vurv
3fecefda0d
Workshop deployment via github actions (#2651)
* Workshop deployment via github actions

* Lua 5.4 `string.pack` implementation

Also fixed reference to wiremod/workshop-upload, since we don't have it on the github market. Need anticept to agree to some licensing thing

* Use new gmod-upload action

Includes the gma packer inside.

Much more minimal implementation from scratch that doesn't use docker, just a composite action running bash scripts.
2023-07-06 17:29:10 -04:00
Redox
6ed89b30d4
Improve code styling (#2657)
* Replace ( ) -> () for style purposes

* Remove whitespaces, bad parens and lua comments

* Fix further glualint issues

* Fix more simple lint issues

* Tell glualint to "shut the fuck up"

* Remove unused code and redundant parentheses

* Trim trailing whitespace

* Fix last parenthesis
2023-07-05 18:13:05 -04:00
Vurv
e81c6718a6
Fix toByte 2023-06-28 15:06:58 -07:00
Denneisk
dfacf9ec06
String hotfix (#2654) 2023-06-28 10:51:39 -07:00
Vurv
68037de925 Convert remaining string functions to use e2function
Also marked `s:index(n)` as deprecated.
2023-06-27 21:55:11 -07:00
Vurv
1567a94ec6
Update README.md
Fix incorrect subscriptions count. AdvDupe2 shield was showing wiremod's sub count.
2023-06-26 13:01:48 -07:00
Vurv
5b0fa85b78
New README.md (#2650) 2023-06-26 11:36:44 -07:00
Denneisk
db35c14e93
bool to number (#2649) 2023-06-23 16:24:21 -07:00
thegrb93
7b17aa1650
Only preprocess changed files (#2644) 2023-06-22 17:28:08 -04:00
thegrb93
e611721b2f
Only lint lua files 2023-06-22 16:52:31 -04:00
thegrb93
14f7764fa4
Revert these ones 2023-06-22 15:56:45 -04:00
Vurv
ebe917baa4
Add entityDamage event and damage type (#2628)
* Add entityDamage event and `damage` type

* Fix lints

* getDamage -> getAmount

Also extended description to warn that the extension may support dealing damage in the future too.

* Add E2Helper descriptions
2023-06-22 12:56:43 -07:00
thegrb93
3aa166e56c
More sanitization 2023-06-22 15:53:42 -04:00