Skip to content

Conversation

@XNTEABDSC
Copy link
Contributor

make UnitDef.customParams.model_rescale applied to all UnitModelRescale so tech-k's UnitModelRescale works properly for ships.
make obj_artefact use model_rescale instead of UnitModelRescale
Im not sure whether offset of UnitModelRescale should be scaled because I didnt see any usage of offset

@GoogleFrog
Copy link
Contributor

I don't like what UnitModelRescale now means. Previously it mean "set the unit model to this scale". Now it means "multiply the input by a custom param and set the unit to that scale". The former is pretty direct and the latter is a bit arbitrary. Also, if I see UnitModelRescale(unitID, 1) I expect it to be resetting scale, or a noop if there has been no scaling.

The PR happens to fix an interaction between two things that want to scale models multiplicatively (tech-k and custom params), but only because there are only though two things. When a third thing appears it will break again and the solution will be even more complex. The solution for this already exists though, suggesting model scale should just be rolled into the attributes gadget.

@sprunk
Copy link
Member

sprunk commented Dec 31, 2025

I kinda like it because now the customparam is pretending that the model itself (i.e. the s3o) has just always been at that scale, which addresses how s3o's are impossible to edit via tool-less text-only modding (as opposed to text-based tweakunits customparams). UnitModelRescale(unitID, 1) does reset to the initial scale the model was at before any UnitModelRescale calls, which only breaks the expectation if you're aware of all the sizes in the actual s3o's.

I agree that putting it in attributes sounds even better though.

@GoogleFrog
Copy link
Contributor

That's a good point and idk where else we would want multiplicative scaling. The artefact fix is also big.

@GoogleFrog GoogleFrog merged commit d52d653 into ZeroK-RTS:master Jan 1, 2026
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