• Hi Guest!

    We have posted a new VaM2 dev log on Patreon, starting a monthly cadence of written progress updates between Beta releases. Highlights include the new Gizmos System, Selection Carousel, and Modes System with Context-Specific Editing. Beta1.2 is 15 of 21 items complete.

    Read the full post on Patreon, or follow progress on the public Trello roadmap.

how to click a button/UIButton or trigger a trigger in a plugin?

wjslsyx

New member
Joined
Apr 13, 2024
Messages
3
Reactions
0
hello, how to click a button/UIButton or trigger the trigger in a script, so that some animations can be added to a sequence? here is what they are like in the scene file:

{
"id" : "Button",
"on" : "true",
"type" : "Button",
"storables" : [
{
"id" : "Trigger",
"trigger" : {
"displayName" : "77",
"startActions" : [
{
"name" : "77",
"receiverAtom" : "Person",
"receiver" : "AnimationControl",
"receiverTargetName" : "AddAnimationToSequence",
"stringChooserActionChoice" : "Catwalk Heels - Twist R to Twist L"
}
],
"transitionActions" : [
],
"endActions" : [
]
}
}
]
},
{
"id" : "UIButton",
"on" : "true",
"type" : "UIButton",
"storables" : [
{
"id" : "Trigger",
"trigger" : {
"displayName" : "A_AddAnimationToSequence",
"startActions" : [
{
"name" : "A_AddAnimationToSequence",
"receiverAtom" : "Person",
"receiver" : "AnimationControl",
"receiverTargetName" : "AddAnimationToSequence",
"stringChooserActionChoice" : "Catwalk Heels - Twist L To Idle"
}
],
"transitionActions" : [
],
"endActions" : [
]
}
}
]
}
 
the formatted text
Untitled.png
 
You can add formatted text with a code block:
JSON:
{
    "key": "value"
}

1713036735261.png


hello, how to click a button/UIButton or trigger the trigger in a script, so that some animations can be added to a sequence?

Assuming your script is on the person atom

C#:
var animationControl = containingAtom.GetStorableByID("AnimationControl");
var stringChooserAction = animationControl.GetStringChooserAction("AddAnimationToSequence");
stringChooserAction.actionCallback("Catwalk Heels - Twist R to Twist L");

I highly recommend checking out the official discord's #scripting channel, specifically these getting started tips: https://discord.com/channels/363274293112602636/505398213675581453/1095986301314007080
 
You can add formatted text with a code block:
JSON:
{
    "key": "value"
}

View attachment 355520



Assuming your script is on the person atom

C#:
var animationControl = containingAtom.GetStorableByID("AnimationControl");
var stringChooserAction = animationControl.GetStringChooserAction("AddAnimationToSequence");
stringChooserAction.actionCallback("Catwalk Heels - Twist R to Twist L");

I highly recommend checking out the official discord's #scripting channel, specifically these getting started tips: https://discord.com/channels/363274293112602636/505398213675581453/1095986301314007080
Thank you very much for your help. I'll make sure to check the channel.
 
Back
Top Bottom