Skip to content

Conversation

@XNTEABDSC
Copy link
Contributor

@XNTEABDSC XNTEABDSC commented Nov 26, 2025

a unit_attributes_generic system which is more flexible and more readable.

It split attribute handling into files at LuaRules/Configs/UnitAttributeHandlers

also separate unit death explosion and unit reload pause into 2 gadgets.

Added ability to handle
burst(mult),
burstRate(mult),
sprayAngle(add),

Tested behaviors:
Techk level up health, projectileMult, rangeMult, minSpray, death explosion, econ
Jump,



function gadget:UnitDestroyed(unitID, unitDefID, teamID)
local deathExplodeMult=spGetUnitRulesParam(unitID, "deathExplodeMult")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GG would be better.

@GoogleFrog
Copy link
Contributor

This looks pretty good and seems like a decent next step in the genericising of attributes.Some comments.

  • I recall GG access being a lot faster than GetUnitRulesParams, so gadgets should use GG for internal communication.
  • Does this spam tables, and generally how is performance? The fairly silly structure of the original attributes came from trying to create only a few tables, each of which can contain a lot of unitIDs. This has been lost with the current stable attributes though.
  • I am concerned that the death explosion and reload pausing gadgets look like standalone gadgets. They each expose GGs that I don't think we can stop modders trying to use. I think I'd prefer it if the attributes gadget had a GameFrame and UnitDestroyed that it could send to the attribute types that use them.
  • Indent with tabs rather than spaces.

@GoogleFrog GoogleFrog requested a review from sprunk December 6, 2025 23:42
@sprunk
Copy link
Member

sprunk commented Dec 10, 2025

Scary amount of changes for so few commits. Would be nice if this was cut into minimal commits

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.

3 participants