Commit Graph

4116 Commits

Author SHA1 Message Date
TW1STaL1CKY
2694f7a124 more WIP 2024-07-13 19:32:23 +01:00
TW1STaL1CKY
33555dc03a Make sure these only trigger if nil or not nil + reverted netstream.lua 2024-07-13 15:06:47 +01:00
TW1STaL1CKY
e33b431683 Merge branch 'develop' into optimisation-pass 2024-07-13 14:30:40 +01:00
Techbot121
2d756a76c8
fix outfit filters not working (#1369)
* actually ignore outfits from people you have filtered

* - change config path (why was it separate anyway?)
- fix return value of get_config_value
it would only work if you opened the menu once

* ask for migration when the editor is being opened

* use __index

* maybe unnecessary?

* fix wearing not refreshing the part in the editor
2024-06-30 03:26:39 -04:00
techbot
44544dab29 update checkout due to deprecation [skip ci] 2024-06-29 17:20:39 +02:00
techbot
e26947b6cd lint only if lua files have been changed [skip ci] 2024-06-29 17:19:55 +02:00
techbot
4b8b99eadc only lint changed files 2024-06-29 17:03:45 +02:00
TW1STaL1CKY
8dc01ec02c More micro optimisations and slowly chipping away at expensive processes
Basically running FProfiler and seeing what I can do to make the most expensive and most ran functions run faster
2024-06-24 02:49:25 +01:00
TW1STaL1CKY
653ff65f47 Fixed possible error with convar variables in base_part 2024-06-18 00:00:43 +01:00
TW1STaL1CKY
471ac6b3d6 Distance optimisations in lock part 2024-06-17 23:59:47 +01:00
TW1STaL1CKY
20ece3db38 Fat optimisation pass
Had a scanthrough and made the following changes in the name of optimisation (even micro-optimisations) where possible:
- player.Get* -> player.Iterator
- ents.GetAll -> ents.Iterator
- ipairs -> for i=1,#tbl (only main uses of ipairs has been replaced, not every use)
- Vector:Distance -> Vector:DistToSqr
- Vector:Length -> Vector:LengthSqr
- net.Read/WriteEntity -> net.Read/WritePlayer where it is definitely intended to be a player
- Saved some GetConVar calls to local vars
- Localised/reused some Vector and Color objects
- Localised some functions where they are frequently used in a few files
- Misc minor styling cleanup (mostly spacing)
- BONUS: Fixed pac.ColorToNames being incorrect when used by some parts (some now use the new pac.VectorColorToNames func)
2024-06-17 02:51:39 +01:00
techbot
39fb1da025 Merge branch 'develop' of https://github.com/CapsAdmin/pac3 into develop 2024-06-16 11:44:54 +02:00
techbot
5794b6d559 only show prompt if there was a decoding error 2024-06-16 11:44:48 +02:00
Astralcircle
32ee247b1c
Use player.Iterator() instead of player.GetAll() (Development branch) (#1364)
* Update part_pool.lua

* Update init.lua
2024-06-15 18:33:31 -04:00
techbot
264793bde6 show prompts instead of calling ErrorNoHalt 2024-06-15 12:59:15 +02:00
techbot
f9c7e8fc0b 💀 2024-06-15 12:40:20 +02:00
techbot
9593563e04 fix mixed up title and message 2024-06-15 12:39:35 +02:00
techbot
11acae243e make it more clear that you can load only outfits via "load from url" 2024-06-15 12:22:02 +02:00
TW1STaL1CKY
26099cc523 Make pac.GetBonePosAng use GetBoneMatrix instead, fixing parts lagging behind when shot at 2024-06-14 22:02:08 +01:00
techbot
138c04b5e1 fix error 2024-06-14 19:08:19 +02:00
techbot
7a0f5509e9 don't use a deprecated render function 2024-06-14 19:07:14 +02:00
techbot
fb65d1b18c fix the annoying Invalid model scale 0.000000 spam 2024-06-14 19:06:10 +02:00
thegrb93
9a9971ff8b
Rewrote netstream (#1361)
* Rewrote netstream

* Only add timer when queue empty

* Only update activitytimeout if queue is empty too

* Move activity timeout reset into successful write

* Move net read before return
2024-06-09 17:33:15 -04:00
pingu7867
42796bcb83
wires hack fix
FindMetaTable("Color") call seems broken, the result is pretty much empty

get the color metatable via the color object we created instead
2024-06-04 20:03:05 -04:00
textstack
4db80ae27a
prevent healing functions from removing overheal (#1356) 2024-06-04 19:21:54 -04:00
techbot
67cafaceb4 fix error if target is not a player 2024-06-04 22:17:23 +02:00
techbot
df0aaf4df6 fix broken animation timeline selection 2024-06-04 21:09:55 +02:00
Denneisk
1d338cae82
Add size limit to E2 functions (#1348)
* Add byte limit for sending data

* Combine to single networkstring
Decrease limit to 2048

* Change limit to be per second
Make messages unreliable

* Fix ratelimit used int for a float value

* Update convar descriptions
2024-04-14 18:41:45 -04:00
pingu7867
151602213d
clear error when valid part class 2024-03-31 16:54:32 -04:00
pingu7867
5c34b12e9e
another revision for entity classification 2024-03-29 19:03:06 -04:00
pingu7867
cf6019c9b5
fixing drgbase npc compatibility 2024-03-25 23:40:15 -04:00
pingu7867
de7e4bcf0c
hotfix on wearing bypass hack
fix bad logic
2024-03-24 17:03:05 -04:00
pingu7867
621e1ab300 apply wearing bypass fix to more parts
preventing lock teleportations and OnShow command activations during weartime
2024-03-24 16:15:17 -04:00
pingu7867
152d670223
implement health modifier id for damage multiplier
for controlling one named "type" of damage multiplier involving multiple parts (instead of proxies)

when multiple parts can be active at a time, it's probably simpler to have the option to cleanup like this instead of making a complex event setup to force all the others to hide for the reset on hide
2024-03-24 14:53:39 -04:00
pingu7867
3593b68b6e fix proxy extra expressions index collisions 2024-03-09 16:46:40 -05:00
pingu7867
95ca54e1f1 small fix
create the pac_command_events table when creating a command event
also hide some editor-related code behind whether owner is localplayer
2024-03-09 15:25:56 -05:00
pingu7867
b6faf91869
actually add animation rate in player config
it already had an EntityField link, but we needed a part variable visible to the user
2024-03-05 21:19:49 -05:00
pingu7867
75ed8828ce
fixes for particle stick / align
use correct part variable names
apply particle angle post-stick and allow double sided particle to stick
add some descriptions
2024-03-01 23:45:48 -05:00
pingu7867
d830ea11b9 add hover halo configs to menu bar
and don't draw bulk select highlight if main hover halo color is "none", not only if the bulk hover mode is 0
2024-03-01 20:47:36 -05:00
pingu7867
074dd0c967 revert hackery from base part to outsource it to camera part's code
by overriding the base part functions only for this class
and use calcshowhide instead of only eventtrigger to detect show/hide operations
2024-03-01 19:26:02 -05:00
pingu7867
b9e5f7b74f hack hotfix for recent camera rework
pac.TryToAwakenDormantCameras calls Think recursively, which triggered seteventtrigger again in some setups

so stop the pac.TryToAwakenDormantCameras call if we're already running it, only do the recursive thinks once starting from the first calling part, and refresh after a second
2024-02-29 23:21:07 -05:00
pingu7867
bc00adb6a4 camera rework and related stuff
yet another attempt at making cameras more usable with some better code but also raw hackery
-view camera when activating a pac_event related to it
-manually view camera via partmenu option, some other part classes have similar activation/preview actions
-better auto-switching between cameras in various cases

PART:SetSmallIcon(str) overrides the tiny event indicator on part icons
used when manually viewing a camera to display an eye showing that this camera is the one being viewed, might be used later

PART:GetReasonsHidden() gives a whole list of reasons as a table of part-indexed strings instead of doing early returns as soon as one reason is found. there are often multiple reasons, a common one is parent hiding
also added parent hiding reason to PART:GetReasonHidden()

use interpolated_multibone's friendlyname in nicename to reflect that we'll refer to interpolated_multibone as interpolator, and added a better nicename showing the nodes

event seen_by_player detects other players' eyeangle raycasts on an adjustable bounding box
2024-02-29 22:49:40 -05:00
pingu7867
00d958f5b8 new shorthand proxy functions
-nsin makes a normalized sine ranging from 0 to 1, similar to what easy setup needs to do
-nsin2 is the same as nsin but half a pi radians less, so that the cycle's output starts at 0 (assuming 0, the starting value for timeex-based expressions) instead of 0.5
-ncos makes a normalized cosine
-ncos2 is ncos with pi radians less to start output at 0

shortened standard timeex-based fades to replace dual clamp fade-in-fade-out setups. they are normalized (0-1 range).
-ezfade(speed, starttime, endtime) resolves the fade equations by using a desired speed and the extrema. if not enough speed, it might not make the full transition and it'll crossfade before reaching 1
-ezfade_4pt(in_starttime, in_endtime, out_starttime, out_endtime) resolves the fade equations by using the four crossing points

new aliases to save a little bit of text space or perhaps be more meaningful to some:
-if_else = number_operator_alternative
-if_event = if_else_event = event_alternative

event_alternative now defaults the 2nd and 3rd args to 0 and 1. reflecting the event's state, if they are not specified

and server population-related inputs
2024-02-17 22:56:16 -05:00
pingu7867
d1e68b3593 text part chat support
ChatTyping updates when typing (outgoing networking is stopped when the part is removed and no more text parts requiring ChatTyping are present)

ChatSent reuses say event's existing data
2024-02-17 17:40:52 -05:00
pingu7867
b0a135cc29 more damagezone options
like the NPC preferences settings, a filter for each "disposition friendliness"

more developed "DoNotKill" options
DoNotKill will now stop healing at the critical point, the same way that it damaged no further than the critical point (converge to critical health)
ReverseDoNotKill reverses the rule into a health-based filter : don't heal if health is below, don't damage if health is above (diverge from critical health)

skip some hitmarker code when none are assigned
2024-02-10 14:11:43 -05:00
pingu7867
fb2d3c7d08 improve hitscan precision
use uints instead of vector, but it'll cost some more as the tradeoff
2024-02-05 21:08:40 -05:00
pingu7867
0e762038ac
net_combat: some server stuff moved to serverside 2024-01-27 18:36:06 -05:00
pingu7867
e4bacaa2ad
proxy: expression slots, text preview, ent_color functions
new expression slots:
-expression on hide will send an expression once at OnHide, running the Think one last time. for lighter toggled setups, but not meant for "moving math"
-extras will compute at the start of the proxy's Think, then the corresponding var1(), var2() / extra1() etc. which are up to 5, can take the result so it's written more compactly in the main expression. optional argument uid / name can search and link to another proxy's extra expression to read it

preview output is a one-click thing to get visual feedback in the world / view panel. easier than setting up a text part.

ent_color series (rgba): should work with colorable parts and owner entity
2024-01-27 18:32:14 -05:00
pingu7867
16284b2594
replace D enums with their numbers
apparently they don't exist before pac loads when we need them
2024-01-21 14:47:51 -05:00
pingu7867
1088e45e7c implement volume setting, drawable part limiters, NPC friendliness
pac_stopsound works for websound too, unlike console stopsound

clients can choose their own distance limits for sounds, shakes, sunbeams and 2D texts they see
shake also has duration and amplitude limits

new consent cvar for clients to exclude friendly or neutral NPCs from being damaged by hitscan and damage zone

added killicon for pac_bullet_emitter

combat parts reinitialize: from a spawnmenu options button, remotely request the refresh via a net message on multiplayer to make it work on dedicated servers
2024-01-20 18:48:20 -05:00