• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Question Saving Event Trigger Values in First Plugin

XPlay

New member
Joined
Mar 19, 2024
Messages
1
Reactions
0
Hi everyone

I'm creating my first plugin and I'm having trouble figuring out how to store the event trigger values.

My plugin retrieves real-world data from an Arduino and uses it to set the "Force Factor" of a "Cycle Force" (or what the user is willing to do).

I adapted code from MeshedVR/TriggerControlSimple.cs to access the "Trigger Event UI." I can set it up and everything works until I load a new scene. Unfortunately, the values are lost at that point.

Other values in my plugin are saved because I register them using RegisterFloat(float value). However, I'm unsure how to register the trigger value. The only JSONStorable variable I've found is "JSONStorableAction OpenTriggerDetailPanelAction;" and attempts to use "RegisterAction(OpenTriggerDetailPanelAction);" haven't been successful.

Could someone please help me with this?
 
Back
Top Bottom