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

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