Repository navigation
AlyxLib Changelog - v3.0.0
📦 Download Installer - New installer app for easy installation and updates (initial release - may contain bugs)
📚 Documentation - Full API reference (initial release - may contain errors)
⚠️ BREAKING CHANGES
You may need to update your code if you use these features:
Class System (class.lua)
- Variable prefix change: Variables that should not be automatically saved now use
_prefix instead of__- Old:
self.__myUnsavedVar - New:
self._myUnsavedVar - Note:
__is now reserved for meta-members only - This also fixes unsaved variables not being cloned into instances
- Old:
Debug Menu (debug/debug_menu.lua)
- Parameter reordering: Callback parameter moved to near the end of parameter list for all menu items
- This allows you to omit the callback instead of passing
nil
- This allows you to omit the callback instead of passing
- Convar names changed: Removed
alyxlib_prefix from debug menu convars- Old:
alyxlib_debug_menu_show - New:
debug_menu_show
- Old:
- Cycle items: Added
titleproperty - make sure to update your cycle items - Convar/callback decoupling: Menu items can now have both convar and callback properties
String Extensions (extensions/string.lua)
- Split functions now escape special characters automatically
- You no longer need to manually escape patterns
- May behave differently if you were already escaping
- Trim function renames:
string.trimleft→string.sliceleft(behavior unchanged)string.trimright→string.sliceright(behavior unchanged)- New
string.trimleft,string.trimright,string.trimnow behave like traditional trim functions
Input System (controls/input.lua)
- Renamed
INPUT_CALLBACKtoInputGenericCallback- This doesn't affect logic, but you lose code completion until you've renamed it in your code
- This brings it in line with
InputPressCallbackandInputReleaseCallback
✨ NEW FEATURES & CHANGES
Class System
BindClass(): Binds a class to an already spawned entity persistentlyResumeThink()now checks if Think function exists before calling- Think function removed from existing by default
- Fixed: Dead entities no longer cause errors on save and think
- Fixed: All members being saved each time
self:Save()is called with name
Storage System
- All save types accept nil: Passing
nilallows you to essentially delete the saved value
Input System
- New:
kindandhandcallback parameters forInput:ListenToAnalog() - Analog callback gets
handandkindparameters - Fixed:
Input:ListenToAnalog()now properly handles hand kind andInputHandBoth - Fixed:
Input:StopListening(id)now properly stops listeners- This was a significant bug preventing input cleanup
Player Data Management
- New module:
player.data- More control over internal player data- Use with
local data = require("alyxlib.player.data") - Functions for weapon equipping and save/load
- See documentation for full API reference
- Use with
Player Events
weapon_switchevent enhanced:- Now tracks left hand switches
- Includes which hand equipped the weapon
- Includes weapon entity reference
- Slightly delayed to gather complete data
Player Movement
GetPlayerMoveType()/SetPlayerMoveType()- Access player move type without player entity existing
EasyConvars
EasyConvars:Exists()- Check if convar existsEasyConvars:AddPostInitializer()- Per-addon post initializers- Deprecated:
EasyConvars:SetPostInitializer()(now callsAddPostInitializer)- This does not break existing addons - it simply reroutes to the new function
Debug Menu Configuration
- New: Custom debug menu configuration (
debug.debug_menu_cfg)- Users can now add their own debug menu categories and buttons via convars
- Enables menu extension without code changes
- Automatically loaded (no require needed)
- See documentation for configuration syntax
Debug Menu Enhancements
- Available to all: -dev mode is no longer required
- Floating menu mode: New
debug_menu_floatingconvar makes menu float in world instead of attaching to hand - Menu dragging: Grab and reposition the menu in 3D space
- Menu resizing: Change the width and height of the menu in-game or in config using
debug_menu_width/debug_menu_height - Lock mode:
debug_menu_lockconvar prevents accidental dragging - Extras tab:
debug_menu_extrasconvar enables extras tab by default - Cheats tab:
debug_menu_cheatsconvar enables cheats tab by default - Category indicators: Numbers on cycle buttons show hidden categories on each side
- Dynamic visibility:
DebugMenu:SetItemVisibilityCondition()to show/hide items conditionally - Anchor tracking: Menu now moves with player anchor (trains, elevators)
- Menu closing: Activation button can now also close the menu
- DebugMenu:ShowDialog: Shows a pop-up message box in the menu
- Automatically hides "NoClip VR" buttons when not in VR mode
- New "Give Grabbity Glove" button in VR mode
- New "Cubemap Colors" button in extras (toggles
r_cubemap_debug_colors) - Increased scroll speed
- Cycle values no longer sent to menu panel (reduces overhead)
- Improved hot-reloading for testing
- Every callback now receives the menu item as second argument
Precaching
GlobalPrecacheFlush()- Precache at runtime globally- See documentation for example
Panorama
- Fixed: Nested table data not flattening correctly before sending
Math Utilities
- New: OBB/AABB intersection utilities (
math.obb)- Check oriented and axis-aligned bounding box intersections
- Debug visualization support
- Functions automatically available (no require needed)
- See documentation for available functions
- Improved:
math.trunc()now handles negative numbers correctly
Entity Extensions
CBaseEntity:SetAbsVelocity()- Set absolute velocitySetPhysVelocity()- Convenience wrapper for aboveCBaseEntity:TrackProperty()now returns think name for stopping withCBaseEntity:SetContextThink()
Global Functions
IsAddonEnabled(workshopID)- Check if workshop addon is enabledRandomChance(value1, value2, percentage)- Returns one of two values based on percentageTableFindKey(tbl, predicate)- Find table key matching predicate- Fixed:
ifrequire()not always returning module result
Common Debugging
ent_print_children- Console command prints entity's childrenhlvr_give_grabbity_gloves- Console command gives player grabbity glovesprint_ent_by_index- Console command prints entity by indexRegisterAlyxLibEasyConvar()- Registers AlyxLib EasyConvars with callbacks and persistence
Debug Utilities
Debug.TableStr()- String representation of tablesDebug.SimpleVector()now accepts QAngles and tablesvecstr- Global alias forDebug.SimpleVectorentfind- Global alias forDebug.FindEntityByPatternentspawn()- Quick entity spawning for prototyping
VR Debug
- Fixed: NoClip VR using wrong move type
- Fixed: NoClip VR inconsistently using secondary hand
noclip_vr_enabledhidden convar moved out ofdebug/vr.luafor universal access- VR debug now loads in fake VR mode
NoVR Mode
- Improved entity activation detection
- New console commands:
alyxlib_start_print_novr_button_pressesandalyxlib_stop_print_novr_button_presses
GENERAL
- VR debug now loads in fake VR mode
- Various nil guards added throughout