Raphiiko / OyasumiVR

🥽 VR Sleeping Utilities
MIT License
257 stars 20 forks source link

OSC Automation Data Type Suggestion #25

Closed daseincompiler closed 1 year ago

daseincompiler commented 1 year ago

Hello, I really like the OSC automation tab, but I feel like Chatbox OSC integration would be used more frequently than the other types. For example when "Oyasumi detects you are asleep based on your movement" or when "At specific time", more tech savvy users could make a Chatbox OSC automation that will display for how long they've been asleep for or/with any other custom text (maybe expose more variables to the user, since I assume it keeps track for how long your "sleep mode" is activated for).

Here's some resources around how to call Chatbox OSC address that I've found: VRChat change-logs mentioning variables for the endpoints very simple OSC Chatbox application & easy to understand

At last here's some simple graphical preview, that I made in Photoshop at how such feature could look like: Oyasumi_Up5yfIGLDv

Let me know your thoughts on this! I find this project really interesting not just from sleeping in VR pov.

Raphiiko commented 1 year ago

Hey! The OSC scripting does indeed come with some limitations:

Its initial purpose was only really to control avatar parameters for the sleeping animations feature, and to give users the option to add support for their own locomotion prefabs or avatar animations. Simple to use for beginners, but flexible enough to allow people to do custom stuff if they really wanted to.

I'd love to expand its capabilities some day, but the sad reality of it is that it's currently not a very high priority...

The scripting syntax would have to be expanded to support this, as well as the simple scripting view to support each new addition, which sadly aren't very trivial tasks. I hope to at some point at least get those two pain points I mentioned out of the way. The kind of templating you're describing is probably a lot further away, but I could see it being a really cool feature. If you or anyone you know is able to help out, I'd appreciate all the help!

If that templating (Chatbox that shows time asleep) is something you want to do right now though, It's something you could script:

Assuming you can script something that sits in between Oyasumi and VRChat, you can send 1 to /avatar/parameters/Oyasumi/Cmd, and Oyasumi will reply with a boolean value on /avatar/parameters/Oyasumi/SleepMode. If you send this once and then keep an eye on values coming from that last address, you can figure out when the sleep mode was enabled. From there, you can figure out how long you've been asleep and send the chatbox osc messages yourself. Here's some more info about interacting with Oyasumi over OSC: https://github.com/Raphiiko/Oyasumi/wiki/Controlling-Oyasumi-over-OSC#commands

Raphiiko commented 1 year ago

For now I'm closing this in favour of #26.