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

1 story

Artemking4 finds why bone 0 breaks IMesh:DrawSkinned

Artemking4 found the root cause of the bone 0 problem in IMesh:DrawSkinned: in shaderapidx8.cpp, bone 0 is also loaded as the model matrix, so rendering breaks unless it is reset afterwards. Wrapping the call in cam.PushModelMatrix and the matching pop fixes it, and he asks for bone 0 to be exposed.

Details

Without bone 0, player and NPC models that use all 53 bones have to be split into two draw calls, which hurts performance. The issue includes screenshots and a spiral test script. It follows his earlier argument with Rubat in #next-update about whether DrawSkinned should allow bone 0.

1 story · 1 update

Rubat reverts the SetPos touch and DrawTexturedRectUV changes

Commit 09a162 on main makes the change that had Entity:SetPos fire trigger touch events opt-in via a separate argument, since it caused infinite loops in existing addons such as TTT. The UV behaviour without the sub-pixel adjustment moves to a new function, surface.DrawTexturedRectRawUV, so surface.DrawTexturedRectUV works the old way again.

Details

This answers the complaints of the past days: RNDX and addons that compensated for the old adjustment no longer break. The same commit also fixes NPC-related crashes and lua_refresh_file autocomplete, adds the serverside Player:RunConsoleCommand (with the same limitations as the global RunConsoleCommand) and uses it in some Sandbox tools, and fixes citizen_sheet_bloody.vtf looking blurry. The changes reached the x86-64 beta in the large merge commit cfa73c.

Request: Player:RunConsoleCommand

Added in commit 09a162 and the request was closed as completed: Player:RunConsoleCommand is serverside only, has the same limitations as the global RunConsoleCommand, and some Sandbox tools already use it. The same commit adds lua_refresh_file autocomplete (#3428) and fixes the blurry citizen_sheet_bloody.vtf texture (garrysmod-issues #7116).

1 story

1 story

1 story · 1 update

2 stories · 1 update

Addons start hitting the new surface.DrawPoly error

In #next-update, Redox (22 Oct) and Nykez (23 Oct) saw bad argument #1 to 'DrawPoly' (table must contain at least three vertices), for example from cl_arc.lua. On 25 Oct Vitroze asked whether it would be fixed. Nykez said it is a bug fix and code has to be fixed, and Rubat agreed: "its not valid code on your end". Beelzebub posted a one-line patch for the bad math in luabee's arc library.

x86-64 beta catches up: ALT+F4, DrawPoly errors, SetPos touch events and more

Commit bb0975 on the x86-64 beta brings over the main changes from 5–12 October: the surface.DrawPoly error on fewer than 3 vertices, the mcore rope fix, ALT+F4 closing the game, the getmetatable() LuaJIT fix, the map compiler updates, Entity:SetPos running trigger touch events, menu state library removal, the HQ Eli face and the other fixes listed in commits 185851, efb205, 7be067, 71ca28, c18cba and 693484.

4 stories · 1 update

LibEdit dropped from Linux SRCDS; Mesh:DrawSkinned 52-bone error fixed

Commit 291b48 on main removes the LibEdit dependency (SRCDS input on Linux now works like on the x86-64 beta), fixes Linux32 SRCDS under WSL and fixes a wrongful error in Mesh:DrawSkinned with 52 bones.

Details
  • "MixMax 2: Electric Boogaloo"
  • LibEdit dependency removed; minor cosmetic changes to srcds_run
  • Fixed Linux32 SrcDS being unable to read file stats under WSL
  • Fixed wrongful error with Mesh:DrawSkinned with 52 bones
  • Folder addons are no longer searched in mountable games/platform
  • "Engine Error" added to the Sys_Error_Internal printf
  • Progress on Linux64 builds

Artemking4 argues Mesh:DrawSkinned should allow bone 0

In #next-update, Artemking4 said IMesh:DrawSkinned can't use all 53 matrices: it's off by one and wrongly errors on the last bone. Rubat replied that matrix 0 is reserved by the engine as far as he remembers, so DrawSkinned gets 1–52. In his tests, setting matrix 0 did nothing or caused issues. Artemking4 disagreed: bone 0 is a normal bone that also serves as the model matrix for unskinned vertices, and his patched client.dll renders models almost perfectly with it.

4 stories

Barnacle regression fixed, 3 bone weights for meshes, math_counter outputs, Autorefresh rework

Commit 280e7a on main fixes regressions in entity search (including Barnacles), allows three bone weights for procedural meshes, adds OnChangedFromMin/Max to math_counter and substantially changes Autorefresh error handling.

Details
  • Separate Linux client and SRCDS build scripts
  • Classname added to the CUtlRBTree overflow message
  • Fixed some regressions with entity search, including Barnacles
  • ErrorFromLua renamed to ErrorNoHaltStack; added CLuaInterface::FormatError
  • mesh.BoneData can be called with index 2 (weight ignored); Mesh() allows 3 bone weights and Mesh:BuildFromTriangles reads up to 3
  • Two new PhysFrame sub scopes: PhysFrame-CPhysicsEnvironment::Simulate and PhysFrame-VPhysicsShadowUpdate
  • math_counter gains OnChangedFromMin/OnChangedFromMax outputs and SetMaxValueNoFire/SetMinValueNoFire inputs
  • Improved Autorefresh error handling; fixed a memory leak with Windows auto refresh and symlinks ("hopefully without regressions, as the system was changed somewhat substantially")

Rubat: BASS can move a playing sound; the engine's sound system can't

In #lua-help, A1steaksa asked how to move a sound while it plays without attaching it to an entity, since CSoundPatch has no SetPos and needs an entity. homonovus thought it impossible without an entity. Rubat said the BASS audio system can do it but the engine sound system cannot.

Details

A1steaksa is also decoding old WAVE files by hand; Rubat asked for a sample, saying the only common format he hadn't tested with "my thing" is ADPCM, and A1steaksa's file was IMA ADPCM (format 0x11).

1 story