Skip to content

New EEex Utils#116

Open
4Luke4 wants to merge 4 commits into
Bubb13:develfrom
4Luke4:utils
Open

New EEex Utils#116
4Luke4 wants to merge 4 commits into
Bubb13:develfrom
4Luke4:utils

Conversation

@4Luke4
Copy link
Copy Markdown
Contributor

@4Luke4 4Luke4 commented Apr 13, 2026

New secure Lua module provider:

  • Added EEex_LuaModule.lua, which exposes EEex.GetLuaModule(moduleName) and EEex_GetLuaModule(moduleName). This module builds a verified trust chain for Lua modules using dual-oracle verification (via string.dump and debug.getinfo) to ensure that functions are genuine C functions and that module members have not been tampered with. It provides a read-only proxy for modules and supports required-member and functional testing.
  • Integrated the new module provider into the early and main initialization flows by loading EEex_LuaModule.lua at the appropriate points in EEex_EarlyMain.lua and EEex_Main.lua, ensuring the trust chain is established once the correct Lua runtime and EEex table are available.

API enhancements:

  • Added new getter functions to EEex_GameObject.lua for retrieving EA, general, race, specifics, gender, and alignment from a CGameObject instance. These are also bound as instance methods for user convenience.
  • Added spellbook APIs and utility word helpers. These changes expose safer programmatic control over known/memorized spells and provide low-level utilities for integer byte/word manipulation.

New utility functions:

  • Added functions to compute the distance between two points.
  • Added function to pick n unique random elements from table t.
  • Added function to turn a string into a numeric value.
  • Added functions to check if exactly one bit set / at most one bit is set.
  • Added functions to pack/unpack SHORT and LONG values.
  • Added functions to discover and populate IDS and 2DA tables dynamically via Infinity_GetFilesOfType().
  • Added functions to determine if the specified target(s) / ally(ies) are within range of the given AoE projectile.

Bugfixes:

  • Fixed the offset calculation in EEex_Resource_GetItemAbility to use Item_ability_st.sizeof instead of Item_Header_st.sizeof, ensuring correct pointer arithmetic when accessing item abilities.

@4Luke4 4Luke4 marked this pull request as draft April 13, 2026 20:44
@4Luke4 4Luke4 marked this pull request as ready for review April 23, 2026 16:36
@4Luke4 4Luke4 marked this pull request as draft April 25, 2026 20:31
@4Luke4 4Luke4 marked this pull request as ready for review April 27, 2026 17:27
@4Luke4 4Luke4 marked this pull request as draft April 30, 2026 17:59
@4Luke4 4Luke4 marked this pull request as ready for review May 1, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant