CapsAdmin / pac3

advanced avatar customization for garrysmod
GNU General Public License v3.0
203 stars 94 forks source link

events with both boolean and number arguments fail to register their booleans seemingly randomly #1272

Open pingu7867 opened 1 year ago

pingu7867 commented 1 year ago

it affects command's "hide in editor", ranger's "npcs and players only", etc. and affects both the workflow ingame and what eventually gets (not) saved if you miss it.

On closer inspection, the arguments aren't being registered in the editor unless of certain conditions. I've done some tests by doing actions at different orders.

image the results of these orders of operations are as such.

https://user-images.githubusercontent.com/3782245/210969540-989a06a5-f590-463f-b1fc-43d910c7fd8b.mp4 video if that's any help.

with ranger, touching distance then checking the tickbox doesn't register the boolean and compare isn't registered either; touching compare registers both and allows the tickbox to be registered;

seems the boolean only gets registered if all number values, or the final/bottom number value in the list get registered / touched

Yagira commented 1 year ago

This is actually a bunch of issues combined.

  1. Events don't actually have any values until you set them yourself, the values that you see by default are just placeholders displayed in the editor. They are also often different from what the events fallback to when the value doesn't exist (editor shows 0 but the event uses 0.1).
  2. The argument values are a list so if a value is missing they will get assigned to the wrong arguments, the in-editor order is also different from the actual argument order. On your video the 'hide in editor' is first but it is actually the last argument.

There's a bit more but this is roughly what happens. I guess the easiest solution - without reworking the whole argument thing - is to just set default values on every event so they always exist. I guess I can add that for the command event and we will see how that works.

Yagira commented 1 year ago

Well, give it a try: https://github.com/CapsAdmin/pac3/archive/develop.zip It's only added for command events, everything else should still work as it did before. Let me know if it fixes the issue and I'll add it to the other events.

pingu7867 commented 1 year ago

It breaks at a fundamental level.

-loading old outfits with the command events breaks the editor.

[pac3-develop] addons/pac3-develop/lua/pac3/core/client/parts/event.lua:830: attempt to concatenate local 'time' (a nil value)

  1. GetNiceName - addons/pac3-develop/lua/pac3/core/client/parts/event.lua:830
    1. GetName - addons/pac3-develop/lua/pac3/core/client/base_part.lua:88
    2. unknown - addons/pac3-develop/lua/pac3/editor/client/panels/tree.lua:389
      1. sort - [C]:-1
      2. PopulateParts - addons/pac3-develop/lua/pac3/editor/client/panels/tree.lua:388
      3. Populate - addons/pac3-develop/lua/pac3/editor/client/panels/tree.lua:518
      4. unknown - addons/pac3-develop/lua/pac3/editor/client/panels/tree.lua:571

Timer Failed! [pace_refresh_tree][@addons/pac3-develop/lua/pac3/editor/client/panels/tree.lua (line 569)]

https://user-images.githubusercontent.com/3782245/211098333-29120b1d-5d33-4af1-ba0a-53b53dbc9eb4.mp4 as a bonus, it almost guarantees that bug where some sort of label escapes the editor and ends up permanently in the top left corner (until a pac_restart)

-selecting the command event breaks the event, but starting from any other event name (even an invalid name i.e. misspelling the name) and then selecting command works "fine"

[pac3-develop] addons/pac3-develop/lua/pac3/core/client/parts/event.lua:830: attempt to concatenate local 'time' (a nil value)

  1. GetNiceName - addons/pac3-develop/lua/pac3/core/client/parts/event.lua:830
    1. get - addons/pac3-develop/lua/pac3/core/client/base_part.lua:88
    2. Populate - addons/pac3-develop/lua/pac3/editor/client/panels/properties.lua:515
      1. PopulateProperties - addons/pac3-develop/lua/pac3/editor/client/logic.lua:10
      2. Call - addons/pac3-develop/lua/pac3/editor/client/parts.lua:177
      3. OnValueChanged - addons/pac3-develop/lua/pac3/editor/client/panels/properties.lua:633
      4. OnRowSelected - addons/pac3-develop/lua/pac3/editor/client/panels/properties.lua:61
        1. OnClickLine - lua/vgui/dlistview.lua:443
        2. unknown - lua/vgui/dlistview_line.lua:81

[pac3-develop] addons/pac3-develop/lua/pac3/core/client/parts/event.lua:830: attempt to concatenate local 'time' (a nil value)

  1. GetNiceName - addons/pac3-develop/lua/pac3/core/client/parts/event.lua:830
    1. GetName - addons/pac3-develop/lua/pac3/core/client/base_part.lua:88
    2. unknown - addons/pac3-develop/lua/pac3/editor/client/panels/tree.lua:152 (x278)

https://user-images.githubusercontent.com/3782245/211097335-114944fb-ecb3-46eb-9bf1-0fd534eb66d8.mp4

Yagira commented 1 year ago

Ye I guess its because the time in your old outfits was never set. Could you try again? Same link: https://github.com/CapsAdmin/pac3/archive/develop.zip