• 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.

Wiki Article 10. Triggers

Status
The first post in this thread is a WikiPost, and can be edited by anyone with the appropriate permissions.
VAM triggers:

cover for wiki post



Triggers are commands that perform an action on an atom's property.
that translates into:
something that does something on something



Triggers in VAM follow this basic structure:
Receiver Atom > Receiver > Receiver Target
a.k.a.
this atom > this thing in the atom > to do this




Examples of triggers

Person > AtomControl > On (checkbox unchecked = false)
This trigger will turn OFF a person atom named "Person"

Person > AtomControl > On (checkbox checked = true)
This trigger will turn ON a person atom named "Person"

InvisibleLight > Light > ToggleOn
This trigger will switch to ON or OFF a light atom dependding on the current state (toggle).
example shown in MacGruber's guide to triggers linked below

Special examples that people ask about a lot

Play music in a scene
  1. add a music file to Scene Audio
  2. add an audiosource atom to the scene
  3. use an UIButton or other means to trigger:
    AudioSource > AudioSource > Play(youroption) > URL > web > your music
Have a person say something
  1. add your speech audio file to Scene Audio
  2. add a person atom to the scene if not present yet
  3. use an UIButton or other means to trigger:
    Person > HeadAudioSource > Play(youroption) > URL > web > your speech audio

Some guides showing trigger uses



Using triggers in a scene
Please first check the above guides on how to make a trigger if you haven't yet.

Triggers allow you to execute actions on a scene when you use buttons, have animations that trigger the triggers (yes, get used to the verb+noun mix), plugins, etc.

An UIButton atom is probably the first atom you'll use when starting to peruse the world of triggers, just because it's so simple to add, put in a trigger in the button trigger tab, and click to see it working (hopefully).
If you never set a trigger in VAM, here's your first trigger exercise:
  1. In a new scene, add a person atom and an UIbutton atom
    • maybe some lights too to see anything
  2. Go to the UIButton options and select the "Button trigger" tab to add a new trigger
  3. Create a trigger with this format:
    • Person (default name of the person atom) > AtomControl > On (change the checkbox to be unchecked)
  4. Click the button to trigger your new trigger
The person should now be OFF because you set a trigger to turn it off. Clicking again will still leave it off as that is your instruction.
If you want to have the button turn the person On and Off, adapt your trigger to use the toggle option shown on "Examples of triggers".

Congratulations, you now know how to make triggers and deserve a biscuit. Treat yourself!


Triggers, triggers, triggers...

What's the difference between a trigger in a UIButton and a trigger in the Triggers track of Timeline?
Only their location, because the trigger system is a core VAM feature, not a property of an atom or plugin.*
*mostly


The trigger system and atom properties

As you probably suspect already, each atom type will have properties that are different from other atoms. A person atom will have receiver targets for the head for example, but a UIButton won't because it has no head. Makes sense, right? Even with all their differences, they will still share many receiver targets between them, like the AtomControl that can turn the atom on or off.
There is no list of all the receivers and receiver targets for each atom type. Such a list would be really big for some, especially the person atom, and no one made one. Also, objects in an atom can expand that list. Clothing, hair, plugins, they will often include new trigger options that the base atom did not include earlier. A full list of triggers is in a way infinite because it depends on what's in the scene, where, and what else you have beyond the scene.

But fear not, there's method to the madness here. As you start exploring people's scenes, and you should because that's how you best learn about triggers and implementations, you'll notice patterns for the base and dynamic targets. Those patterns are the key to make your scene triggers and understanding how to find them.


How to learn about what triggers exist and how to use them

Open and explore scenes, break them down, see how things work. This is by far the best way to get acquainted to triggers and how to implement them to make your scene.
There are also plugins that expand the range of VAM's built-in trigger system, like MacGruber's LogicBricks, hazmhox's VAMStory, and many more. Start small, make simple triggers that perform some actions, learn and expand on that.
And the last advice about triggers:
K.I.S.S.!
Keep It Simple, Stupid!
 
Last edited by a moderator:
Status
The first post in this thread is a WikiPost, and can be edited by anyone with the appropriate permissions.
Back
Top Bottom