Skip to content

Modularize randomized enemy size hook & fix enemy health bars#5887

Merged
serprex merged 4 commits intoHarbourMasters:develop-copperfrom
JordanLongstaff:hook-mod-rando-enemy-sizes
Dec 31, 2025
Merged

Modularize randomized enemy size hook & fix enemy health bars#5887
serprex merged 4 commits intoHarbourMasters:develop-copperfrom
JordanLongstaff:hook-mod-rando-enemy-sizes

Conversation

@JordanLongstaff
Copy link
Contributor

@JordanLongstaff JordanLongstaff commented Oct 25, 2025

Includes the EnemySizeScalesHealth CVar. I figured I'd be asked to add a VB hook for Freezard with said CVar, so I did.

Build Artifacts

});
}

static RegisterShipInitFunc initFunc(RegisterRandomizedEnemySizes, { CVAR_RANDO_ENEMY_SIZE_NAME });
Copy link
Contributor

Choose a reason for hiding this comment

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

Missed part of the ruleset for init func naming. This should also reflect the name or purpose of the function pointer being passed.

@Pepper0ni
Copy link
Contributor

I've noticed that the enemy health bars enhancement is no longer properly updating max HP to match the health scales with size feature, resulting in overflows and enemies appearing to start with less than max HP

@JordanLongstaff
Copy link
Contributor Author

This bug is also present on develop.

@JordanLongstaff
Copy link
Contributor Author

There's a registered hook in ActorMaximumHealth_Register that sets the "max health" value used by the health bars. It gets set equal to the actor's current health on spawn. It gets executed before the scaling hook, hence the desync.

I can either add a call in the scaling hook to refresh the maximum health, or if anyone can please tell me how to control the order of compilation, that would be very helpful.

@JordanLongstaff JordanLongstaff force-pushed the hook-mod-rando-enemy-sizes branch from 9d5ff43 to 4d2d375 Compare December 30, 2025 03:06
@JordanLongstaff JordanLongstaff changed the title Modularize randomized enemy size hook Modularize randomized enemy size hook & fix enemy health bars Dec 30, 2025
@JordanLongstaff JordanLongstaff changed the base branch from develop to develop-copper December 30, 2025 03:06
@JordanLongstaff
Copy link
Contributor Author

I can either add a call in the scaling hook to refresh the maximum health, or if anyone can please tell me how to control the order of compilation, that would be very helpful.

Unless someone chooses to answer the latter question, I've opted to do the former for now.

@garrettjoecox
Copy link
Contributor

the goal is for all hooks to always be idempotent, so the former option is recommended

@serprex serprex merged commit 50c023b into HarbourMasters:develop-copper Dec 31, 2025
1 check passed
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.

7 participants