I'm digging around in existing code to see how VaM handles things like finding and using variables from another plugin. And, if I could find an example that already read these VAMMoan variables, even better. That's where Cue hopefully comes in.
I would not use Cue for this. It has a pretty complex porting layer to isolate VaM stuff from the main plugin, plus a lot of bullshit to be able to find parameters on the fly when new plugins are added.
You start by finding an
Atom
with
SuperController.singleton.GetAtomByUid()
and giving it the atom's name. You can also get all the atoms with
GetAtoms()
.
Given an
Atom
, the first function you want to use is
GetStorableByID()
. A
Person
atom, for example, has a bunch of storables: one for each controller, one for each rigidbody, one for each plugin, etc. You can see storables in the
Receiver list when you edit a trigger.
Once you have a storable, you call
GetXJSONParam()
, where X can be
Bool
,
Float
,
String
, etc. This gives you a specific parameter within that storable. You can see parameters in the
Receiver Target list when you edit a trigger. Storables will have a
val
property that you can use to get or set the value.
Finding a parameter from a plugin is a bit messy because the storable name will be something like
plugin#0_Cue.CueMain
. The
#0
is the order of the plugin in the list, which changes depending on the order in which the user adds plugins. Once you know the name of the plugin's main class (for example,
Cue.CueMain
) you can call
GetStorableByID()
in a loop with increasing indexes (
plugin#0_Cue.CueMain
,
plugin#1_Cue.CueMain
, etc.)
You can also use
GetStorableIDs()
and look for an ID that contains the plugin's class name.