Question Coding Question

DarkFantasy

Well-known member
Messages
129
Reactions
475
Points
63
Patreon
DarkFantasyVAM
This is probably a dumb question but rather than spending a lot of time browsing through others code to figure it out I figured I would ask here.

What determines whether an option in a plugin is available as a trigger action? I have looked through the code in a few plugins and can't seem to figure it out.
 
You need to register your JSONStorable with your plugin: RegisterAction, RegisterBool, RegisterFloat, etc.

Check out MacGruber_Utils.cs, its included in most of my plugins, e.g. LogicBricks. For example Utils.SetupSliderFloat creates the UI for you and exposes it also as triggerable.
 
Upvote 0
You need to register your JSONStorable with your plugin: RegisterAction, RegisterBool, RegisterFloat, etc.

Check out MacGruber_Utils.cs, its included in most of my plugins, e.g. LogicBricks. For example Utils.SetupSliderFloat creates the UI for you and exposes it also as triggerable.

Thank you! I will take a look and try that later today!
 
Upvote 0
Not a dumb question... I'll ask a real dumb question to show you how its done... how do I get started Coding in Virtamate, its hard to find tutorials or even find others code to see examples.
 
Upvote 0
@Nawen how to start doing something is not a dumb question either :)

Long story short: you have to learn C# and Unity. You can skip learning and fiddle, but you'll have a hard time figuring everything out from scratch!

I made a template to help you get started with vscode, it can get you started quicker (if you know how to use git it'll also be easier) https://github.com/acidbubbles/vam-plugin-template

Otherwise, just look at the Custom/Scripts/MeshedVR folder for simple .cs file examples, in the end a .cs file is the only thing you need (I just find it easier to work with autocomplete and validation as I code but it's not a necessity).

Keep in mind, VaM was not really built as a plugins system, so you have to be ready to poke around, try things, and see how others have solved problems. It's hard but very rewarding when you make something that works :D
 
Upvote 0
Oh wow thank you! , even provided a way to compile the code , Yeah messing around with old games like Neverwinter Nights and Secondlife is what taught me C++ and A bit of Python, their LSL and Java and many coding languages over time. I'm no coder really but I spend allot of time coding lol, the adventure begins again Thank you so much 😳🤗
 
Upvote 0
Back
Top Bottom