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

Each shocker's settings should have a Max Shock and Max Vibe slider #118

Open
nullstalgia opened this issue Dec 22, 2023 · 3 comments
Open

Comments

@nullstalgia
Copy link
Member

nullstalgia commented Dec 22, 2023

While this functionality does currently exist with Share Links, there is no such protection when using a script, game mod, or other API control methods.

As such, there should be a setting for each individual shocker that lets you set a maximum that the backend will under no circumstance send a value above.

When I implemented this into Legacy OpenShock, I also started to scale any input given by that maximum value so scripts and other control methods don't need to be aware of that limit, and can send 100% expecting it to reach 100% of my maximum.

In addition to that, I added a bool to say if I'm sending an absolute value, to avoid the scaling but still get capped by the maximum.

This helps a lot with people who are extremely sensitive and want the peace of mind that a script mishap or bad sharelink won't ruin their night.


Examples:

Maximum Shock: 100%
Sent Value: 50%
Hub Received Value: 50%

Maximum Shock: 50%
Sent Value: 50%
Hub Received Value: 25%

Maximum Shock: 50%
Sent Value: 55% (Absolute)
Hub Received Value: 50%

My Legacy implementation:

https://github.com/nullstalgia/OpenShock-ESP-Legacy/blob/main/src/shockertasks.h#L16

@LucHeart
Copy link
Member

So what you really want is, API Tokens to have a limit? Im not a fan of lerping those values+ this is not related to WebUi.

@LucHeart
Copy link
Member

What can be done is a limit on a shocker globally, but that is also more so related to backend

@nullstalgia
Copy link
Member Author

nullstalgia commented Dec 23, 2023

@LucHeart

Well any input to have a limit, but the main target is the API, yes.

I would like to keep some lerping, as if I have someone who has a limit of 20%, I then need to adjust my set-up to scale from 0-20%, not from 0-100% as it would hit 20% very quickly.

Being able to keep it generic, maybe optionally instead, would be very helpful.

We can transfer the issue to the API, but this also requires a UI option, so I just put it here for now.

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

No branches or pull requests

2 participants