Skip to content

#3 - Proposal for @getadjustheight #3

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

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

Conversation

KittyBarnett
Copy link
Owner

@KittyBarnett KittyBarnett commented Feb 12, 2025

Currently, scripts have no reliable way to determine the original hover height. For example, if a script plays an animation and adjusts the avatar’s height using @adjustheight, it has no means of restoring the original hover height once the animation ends. Most scripts attempt a best-effort restoration by issuing @adjustheight:1;0;0=force, but this is far from ideal.

This proposal would extend RLVa with a command to retrieve the active hover height, as well as a way for scripts to restore the previous hover height without needing a reply/listen round-trip.

@KittyBarnett KittyBarnett changed the title Draft proposal for @getadjustheight #3 - Draft proposal for @getadjustheight Feb 12, 2025
@KittyBarnett KittyBarnett changed the title #3 - Draft proposal for @getadjustheight #3 - Proposal for @getadjustheight Feb 13, 2025
@KrsityKu
Copy link

This is not directly related, but I would be interested in seeing hover height adjustments work more like a stack/queue. Let me give you an example:
We have items A, B, C and let's say our manually set hover height is "Base Height"

  1. Item A asks for 0.05 -> it gets set to 0.05
  2. Item B asks for 0.15 -> it gets set to 0.15
  3. Item C asks for 0.12 -> it gets set to 0.12
  4. Item C clears its HH restriction -> height returns to 0.15
  5. Item A clears its HH restriction -> 0.05 is removed, but height does not change, because B set height after A
  6. Item B clears its HH restriction -> height returns to Base Height, since B was the last entry on the stack.

If any of the items ask for new height, they get moved to the top of the stack with the new value.

If the user changes HH during any point where any item is requesting for it, it could either do one of the two:

  • It should edit the Base Height, but keep the actual height set to whatever is enforced
  • Discard the whole stack, effectively clearing the restrictions and reset HH to the new Base Height

The use cases I imagine for this would be - where you have a HUD that when you sit sets hover height to 0, and wants to restore it when you stand up and another HUD or script that manages hover height based on the shoes you're wearing.
So if the default HH is 0, you wear your shoes and it sets HH to 0.1, then you sit down, the other HUD sets it to 0, but when you stand up, instead of the losing the original HH value that was used by the shoes, it gets restored.

@KittyBarnett
Copy link
Owner Author

  1. Item A asks for 0.05 -> it gets set to 0.05
  2. Item B asks for 0.15 -> it gets set to 0.15
  3. Item C asks for 0.12 -> it gets set to 0.12
  4. Item C clears its HH restriction -> height returns to 0.15
  5. Item A clears its HH restriction -> 0.05 is removed, but height does not change, because B set height after A
  6. Item B clears its HH restriction -> height returns to Base Height, since B was the last entry on the stack.

@ajustheight is currently a force command though, which (ideally but not always) are throw-away commands that don't carry any state into the future.

I understand your example, but (4), (5) and (6) isn't possible since there is no 'hover height' restriction, so there is no way to clear it.

@adjustheight=force could be a way to do it but I don't like that with multi-object state since objects that issue single-use RLV commands aren't actually tracked by RLVa, only ones that have an active behaviour are.

That said, what if we introduce @adjustheight:=n with the understanding that "last set wins"? Then you have a queue, you have per-object state, and an inherent order of what to restore when the top item get popped (and order is maintained when non-active items get popped).

The only issue I see is that @adjustheight:=n kind of/sort of implies that the user shouldn't be able to make manual adjustments... but maybe that's just me being pedantic 😊.

Any thoughts on that?

The use cases I imagine for this would be - where you have a HUD that when you sit sets hover height to 0, and wants to restore it when you stand up and another HUD or script that manages hover height based on the shoes you're wearing. So if the default HH is 0, you wear your shoes and it sets HH to 0.1, then you sit down, the other HUD sets it to 0, but when you stand up, instead of the losing the original HH value that was used by the shoes, it gets restored.

Thanks, that example helped. I'm not sure I think it's realistic, but as a theoretical discussion point it works at least 😛 .

@ChloeConstantine
Copy link

I'm going to be purist in my comments! The proposal is for @getadjustheight! For me, I think that would be hugely useful. So, yes, please.

A lot of the proposal gets into the rat's nest of @adjustheight which I'd recommend carving off into a different proposal. Now, if I really wanted to use @getadjustheight then I wonder if I would want yet another extension to @notify to indicate that either the user (using the slider) or some other script has adjusted the height.

When I get back to things that care about poses/animations where height matters, I would really love to know the details @getadjustheight will give me!

@shadoskill
Copy link

Having a memory for the original height would solve quite a few issues for a few products i want to make, and to be able to do it without a listen would be wonderful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants