Page 1 of 1

Sequencer custom variables?

Posted: Tue Sep 28, 2021 1:35 am
by VoodooDetective
I may have missed it, but I was wondering if there's a way to create custom variables (not hardcoded shortcuts) that can change, like entrytag, node to node?

I've got animated portraits and a different panel for left and right sides of the screen. Normally PC is on left, but sometimes NPCs are on the left too. The portrait animator is named NPC Portrait and PC portrait. I was just trying to contemplate the best way to do:

AnimatorPlayWait(current_speaker_portrait, Sniff);

Re: Sequencer custom variables?

Posted: Tue Sep 28, 2021 9:01 am
by Tony Li
Hi,

You may be able to get clever with [var=variable] and/or [lua(code)] tags.

For example, the variable Variable["ConversantIndex"] is the index into the Lua Actor[] table for the conversation's conversant. For example, if the conversation is between the actors "Player" and "Adam", Variable["ConversantIndex"] will be "Adam".

If Adam has a custom field "current_speaker_portrait" in the dialogue database, then you can get it like this:

Code: Select all

[lua(Actor[Variable["ConversantIndex"]].current_speaker_portrait)]
Sequences process [var] and [lua] tags, so you can use a sequence like this:

Code: Select all

AnimatorPlayWait([lua(Actor[Variable["ConversantIndex"]].current_speaker_portrait)], Sniff);

Re: Sequencer custom variables?

Posted: Tue Sep 28, 2021 3:24 pm
by VoodooDetective
Oh interesting! Thanks for all the information/example!
I'll see if I can get it to work this way, and if not I'll just write a custom SequencerCommand for the special portrait animations.

Thanks for your help!

Re: Sequencer custom variables?

Posted: Tue Sep 28, 2021 3:34 pm
by Tony Li
Glad to help!