Accessing entry field from sequence

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
arnevandamme
Posts: 1
Joined: Wed Jan 19, 2022 4:12 am

Accessing entry field from sequence

Post by arnevandamme »

Is it possible to access a field value of the current dialogue entry from the sequence of that entry?

I want to add a voice over file field to my dialogue entry and then have a default sequence (eg. {{voice}}) that plays the voice over file and does some extra stuff like send a message when done.

I don't want to drag/drop the audio file to the sequence directly because I don't know how the actual audio playing will change and I prefer to have the file value separately anyways. I also would prefer not to use the entrytag at the moment because I want to reuse the same voice over file for several dialogue entries; and i use the entrytag for sending out a unique message related to the actual entry.

So I was wondering what the easiest way would be to achieve this?

I found LUA

Code: Select all

GetEntryText()
but that requires me to know the entryID which in turn I don't find how to access (at least I don't seem to find it in the documentation).
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Accessing entry field from sequence

Post by Tony Li »

Hi,

You can still use entrytags. Set the Dialogue Manager's Camera & Cutscenes > Entrytag Format to VoiceOverFile. Then add a field to your dialogue entries named "VoiceOverFile". Since it's just a plain text field, multiple entries can have the same VoiceOverFile value.

If you want to access other fields (not voice over), the current dialogue entry sets a Lua variable named thisID]. Note that thisID is not part of the Variable[] table. You can use it like this in Lua:

Code: Select all

GetEntryText(thisID, "Some Field")
Or, using the [lua(code)] tag, like this in a sequence:

Code: Select all

AnimatorPlay( [lua( GetEntryText(thisID, "Some Field") )] )
Post Reply