Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sprunk
Copy link
Collaborator

@sprunk sprunk commented Apr 7, 2024

Extracted from Get/SetUnitPosErrorParams.

Extracted from Get/SetUnitPosErrorParams.
@sprunk sprunk added the status: candidate PRs that should be good to go or important for next release label Dec 17, 2024
@saurtron
Copy link
Collaborator

What's the use case for this? (curious)

@sprunk
Copy link
Collaborator Author

sprunk commented Dec 17, 2024

Generally beyond-all-reason/Beyond-All-Reason#3617, but it is useful anytime you don't want a unit to wobble for whatever reason.

@saurtron
Copy link
Collaborator

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?

Copy link
Collaborator

@saurtron saurtron left a 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.

@sprunk
Copy link
Collaborator Author

sprunk commented Dec 17, 2024

Maybe the the engine could do that itself for those?

Yeah that would be a good default.

a few issues

The feature already exists and I'm just moving it to a different function.

@saurtron
Copy link
Collaborator

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.

Comment on lines -3532 to -3533
if (lua_isnumber(L, 9) && lua_isboolean(L, 10))
unit->SetPosErrorBit(std::clamp(lua_tointeger(L, 9), 0, teamHandler.ActiveAllyTeams()), lua_toboolean(L, 10));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here

Copy link
Collaborator

@saurtron saurtron Dec 17, 2024

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).

Copy link
Collaborator Author

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.

Copy link
Collaborator

@saurtron saurtron Dec 17, 2024

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)

Copy link
Collaborator Author

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

Copy link
Collaborator

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)

Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Member

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.

#1597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Lua API status: candidate PRs that should be good to go or important for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants