-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Spring.Get/SetUnitPosErrorEnabled
#1424
base: master
Are you sure you want to change the base?
Conversation
Extracted from Get/SetUnitPosErrorParams.
What's the use case for this? (curious) |
Generally beyond-all-reason/Beyond-All-Reason#3617, but it is useful anytime you don't want a unit to wobble for whatever reason. |
Maybe the the engine could do that itself for those? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok tested this and see a few issues:
- showstopper: When you disable radar wobble it takes effect also before you see the unit, but it's supposed to only stop wobbling once you see the unit (when you see the ghost), isn't it?
- Also, if the goal is disabling this for certain unitDefs, making it work for unitIDs makes it a bit unwieldy. Sounds like something at unitdef would likely be more practical.
- The api is a bit awkward, why have allyteam as 2nd par and enable as 3rd? Specifying an allyteam seems a bit niche, since usually you'd want to apply this to everyone.
Yeah that would be a good default.
The feature already exists and I'm just moving it to a different function. |
I don't think SetUnitPosErrorEnabled existed previously, and also looks like it wasn't there for a reason. The other concerns are also for that function and I think there's no reason to dismiss them. |
if (lua_isnumber(L, 9) && lua_isboolean(L, 10)) | ||
unit->SetPosErrorBit(std::clamp(lua_tointeger(L, 9), 0, teamHandler.ActiveAllyTeams()), lua_toboolean(L, 10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right XD, anyways I don't see the point of creating new methods just for setting smth that makes thing work badly tbh, this does't solve the use case you commented (making nanos not wobble when in ghost form).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality solves my use case and I am happy with it as a game dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But not the nanoturrets problem, what use case is that?
(sorry to ask so many questions XD)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the nanoturrets problem. I don't know what issues you see with it. https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/Gadgets/unit_radar_wobble.lua#L32-L45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, and we can do that, just need to decide how we want to do it, just checking non moving builder or have some customparam or unitdefparam. (i guess checking for non moving builder)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also.. do we have an issue of why nanoturret has to be a unit? Would like to know all the info and maybe look for solutions too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nanos could be a building if there was a nice way of distinguishing them from a factory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nanos could be a building if there was a nice way of distinguishing them from a factory.
Need more information, that doesn't really tell me a lot about what's going on, like... they can be distinguished with an unitdef param or whatever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also.. do we have an issue of why nanoturret has to be a unit? Would like to know all the info and maybe look for solutions too.
Extracted from Get/SetUnitPosErrorParams.