Get Random Actor's property as var
Posted: Wed Aug 26, 2020 4:02 pm
Example.
Conversation nodes use generic actors, at run-time the actor/conversant are set via StartDialogue() or trigger etc.
Conversant:
Name = Fred Jackson
Display name = Freddy J.
Age = 22 (this is a custom field on the Actor template)
In conversation node I can access Fred's name using:
"And how are we feeling today, [var=Conversant]?"
That will display either the actor name or display name depending on if UseDisplayName is checked.
But what about other properties from the Conversant and more importantly custom template fields?
I get that I can access actor fields via the table index, eg. Actor["Fred_Jackson"].Age = 22
But in the conversation above I don't know the player index as it could be any actor set at runtime.
I'm expecting to be able to access properties in this way, but it doesn't work (nil is the value returned).
"And how are we feeling today, [var=Conversant.Age]?"
Also, is it possible to debug and step through Lua code?
Conversation nodes use generic actors, at run-time the actor/conversant are set via StartDialogue() or trigger etc.
Conversant:
Name = Fred Jackson
Display name = Freddy J.
Age = 22 (this is a custom field on the Actor template)
In conversation node I can access Fred's name using:
"And how are we feeling today, [var=Conversant]?"
That will display either the actor name or display name depending on if UseDisplayName is checked.
But what about other properties from the Conversant and more importantly custom template fields?
I get that I can access actor fields via the table index, eg. Actor["Fred_Jackson"].Age = 22
But in the conversation above I don't know the player index as it could be any actor set at runtime.
I'm expecting to be able to access properties in this way, but it doesn't work (nil is the value returned).
"And how are we feeling today, [var=Conversant.Age]?"
Also, is it possible to debug and step through Lua code?