Sequencer custom variables?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Sequencer custom variables?

Post 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);
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequencer custom variables?

Post 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);
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: Sequencer custom variables?

Post 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!
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequencer custom variables?

Post by Tony Li »

Glad to help!
Post Reply