Page 1 of 1

Korman - random animation

PostPosted: Sun Mar 22, 2020 11:10 am
by ametist
Me again :) with Another question - I have an object with three different animations I want to be played randomly when entering a region. Is this possible? Or should I have three objects, each with one separate animaton, enabled randomly? I think there is one or another global python script to handle random things, but I am not at that stage yet. Just want to know how to set it up for now.

Re: Korman - random animation

PostPosted: Sun Mar 22, 2020 11:25 am
by Deledrius
Off the top of my head, I'd say the best way is to have a single object, with multiple states. Have those animations be triggered by a responder that activates on the state, and just randomize that state value.

The Integer State List Responder script is probably what you want to use, in a Python File node.

The existing randomizer is boolean only, for handling whether an object (like the bahro stones) are visible), but it should be trivial to create something similar for your needs.

Re: Korman - random animation

PostPosted: Mon Mar 23, 2020 2:53 am
by ametist
Thanks Deledrius! I will use it as is then, one object with three animations. I will also look further into those python scripts when the time comes, thanks again! :)

Re: Korman - random animation

PostPosted: Mon Mar 23, 2020 10:21 am
by Deledrius
ametist wrote:Thanks Deledrius! I will use it as is then, one object with three animations. I will also look further into those python scripts when the time comes, thanks again! :)

Fortunately, the cool thing about the Global scripts is that you don't have to worry too much about the insides of the script, you just plug things in and let them handle the magic. As time permits, I hope to add example node trees for common cases. When you get to needing this one, let me know.