Tag: #lua-api (38) Clear filter ×

4 stories

Menu state on dev loses Vector, HTTP, CreateMaterial and more

In #next-update, Cynthia listed functions missing from the menu state on dev: Angle, CreateMaterial, GetLoadPanel, HTTP, http, LerpAngle, LerpVector, OrderVectors, UpdateLoadPanel and Vector. Rubat confirmed it and said the change wasn't silent: the changelog states "Remove some unused libs from menu state". He added that the wiki shouldn't list menu state functions at all, since the menu state isn't meant for modding. On GitHub, kila58's issue "CreateMaterial missing from menu state" was closed as not planned.

Per-entity materials suggested instead of the matproxy library

In #lua-help, full metal sergeant 228 asked whether there's a better way to do controllable textures, since he heard the default matproxy library is very slow, and noted LVS creates a material per entity. Artemking4 suggested instancing a material per usage from a base material and changing only what's needed. Asked by TankNut how slow matproxy must be for that to be the alternative, he said creating materials is "dirt cheap" because they are just containers for shader inputs.

JSONToTable converts vector-like strings even with ignoreConversions

In #lua-help, 0d9b reported that util.JSONToTable turns strings that look like vectors into vectors even when called with ignoreConversions set to true. He asked whether this is intended, calling a JSON parser that mangles the output without an option to keep the original values "a bit useless for... parsing json". Artemking4 said he prefers MessagePack.

TankNut: no Lua equivalent of PhysicsImpact for physics-driven player movement

In #developer-talk, TankNut described problems with his physics-driven mech: movement is unpredicted, so multiplayer feels slow, and hook order breaks things because the mech moves in PhysicsUpdate after its turrets update in PlayerPostThink/Think. He added that the biggest problem in recreating player movement is that Lua has no equivalent of entity->PhysicsImpact, though ApplyForceOffset might be enough. He later said it may matter less, since it seems to be only for touch-related things.

1 story

math.ceil/floor fix ported; "load quick" no longer boots you without a quick save

Commit bb557c on main ports a fix for math.ceil/math.floor, adds self checks for corrupted map files and stops the load command from booting you out of the session when the save is missing.

Details
  • Port a fix for math.ceil/math.floor
  • Self checks for corrupted map files
  • load doesn't boot you from the session for missing saves, so an accidental "load quick" bind press is harmless
  • Fixed ZFunc not being set when overriding depth testing
  • Fixed a regression with DPanel:OnMousePressed due to recent changes
  • Merged PR: ENT:StoreOutput treats times=0 the same as times=-1

2 stories

Prediction errors now show the array index; multicore memory leaks fixed

Commit 9ecf4a on main makes prediction errors on arrays include the index for ints and floats, fixes a couple of multicore rendering memory leaks and a crash in render.UpdateScreenEffectTexture.

Details
  • GitHub Actions updated to version 6 for Linux and Windows
  • trigger_portal_cleanser added to the entity override whitelist
  • Fixed a crash with render.UpdateScreenEffectTexture
  • widgets.RenderMe and properties.GetHovered removed serverside
  • Minor cleanups so methods match the wiki and vice versa
  • Prediction errors on arrays include the array index for ints and floats
  • Fixed a couple of memory leaks with multicore rendering (render.UpdateScreenEffectTexture, render.PushCustomClipPlane)

2 stories

surface.DrawTexturedRectUV stops applying sub-pixel UV adjustment

Commit 6a75b6 on main makes surface.DrawTexturedRectUV ignore the "sub pixel adjustment" of UVs so its UV arguments work as expected; only the Lua binding is affected.

Details
  • Ignore UV adjustments in surface.DrawTexturedRectUV
  • Refined DImage subrect support and KeepAspect features
  • Removed a leftover debug panel from the Paint tool; its icons keep aspect
  • Minor cleanups

1 story

1 story

1 story

Entity:SetPos now runs trigger touch events; controller input and SetNWVarProxy fixes

Commit c18cba on main makes Entity:SetPos run trigger touch events, fixes several controller input bugs and fixes the old value passed to SetNWVarProxy callbacks.

Details
  • "failed to dlopen" log skips are now case insensitive (macOS)
  • combine_booth_tall01b.vmt includes $normalmapalphaenvmapmask, commented out
  • Fixed IN_MOVERIGHT/IN_MOVELEFT not activating from a controller
  • Fixed a false positive "SeekPut overflow" message
  • Fixed Player:KeyDown clientside in singleplayer not detecting controller movement
  • Fixed SetNWVarProxy callback's old value being the new value
  • Entity:SetPos runs trigger touch events

2 stories

9 new Combine props added; engine.CloseServer no longer falsely announces a shutdown

Commit 71ca28 on main adds 9 new Combine-related props from the licensee repo and fixes engine.CloseServer claiming the server is shutting down when it is not.

Details
  • Material reading fixes
  • engine.CloseServer no longer falsely claims the server is shutting down
  • file.Read blocklist updated so it doesn't affect file and folder names in the DATA path
  • Added 9 new Combine related props; combine_booth_tall01b.vmt made less extremely glossy
  • Fixed a missing material on a CS:S prop and an EP1 prop

1 story

Envmap and lightprobe commands blocked from Lua; dupes/saves/demos with a single tag load again

Commit 7be067 on main blocks the envmap and lightprobe commands from Lua, fixes some dupes, saves and demos not loading, and adds more decompression self checks.

Details
  • Block envmap and lightprobe commands from Lua
  • Replace usages of string.Explode with string.Split
  • Properly fix env_microphone missing closed captions
  • Dedicated server workshop cleanup now runs in the correct folder (it was cleaning cache/workshop/ while files were saved to cache/srcds/)
  • Fixed some dupes/saves/demos not loading when they only have a single tag (Dupe, Save or Demo)
  • More decompression self checks; the FastLZ fallback was removed from util.Decompress (workshop dupes/saves already use LZMA, util.Compress has used LZMA since 2014)

3 stories

ALT+F4 now closes the game; map compile tools get TF2 limits and T-junction softcap

Commit efb205 on main enables ALT+F4 to close the game, makes Entity:Get/SetNetworkAngles exist serverside, applies the requested getmetatable() LuaJIT fix and brings several map compiler limits and fixes over from TF2.

Details
  • Enable ALT+F4 closing the game
  • Get/SetNetworkAngles exist serverside for consistency, and check for reasonable values
  • Apply "that getmetatable() LuaJIT fix someone wanted"
  • Handle context menu errors when the "originator" panel is removed
  • Fixed engine.LightStyle only updating static props once (community contribution)
  • Removed non-functional map compile tool parameters (-novconfig, -vproject, -x360/-nox360, -xbox, VBSP -virtualdispphysics); -tmpout moved from VVIS to VBSP; some undocumented VBSP params documented
  • Added -noTJuncsDetail to VBSP from TF2
  • Applied the T-junction limit softcap (community contribution) so the compiler no longer just stops
  • MAX_MAP_TEXINFO bumped to the new TF2 limit (16k → 32k)
  • Removed redundant VRAD code, fixed VRAD potentially adding new planes; VBSP detail sprite limit raised (2 million → 2 billion)
  • r_DrawBeams 2 now affects sprite trails (wireframe)

1 story · 1 update

surface.DrawPoly now errors on fewer than 3 vertices; invisible ropes under mcore fixed

Commit 185851 on main makes surface.DrawPoly throw an error when given fewer than 3 vertices, fixes ropes turning invisible in a specific multicore setup and restores sk_auto_reload_time.

Details
  • surface.DrawPoly throws an error on invalid data (fewer than 3 verts)
  • Ropes no longer go invisible with r_queued_ropes 0; mat_queue_mode 2; gmod_mcore_test 1
  • sk_auto_reload_time works again; it requires gmod_suit 1, and a value of 0 or below disables the feature