Reference actor by id?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
namelesswc
Posts: 7
Joined: Wed Nov 22, 2017 9:01 am

Reference actor by id?

Post by namelesswc »

How can I get the actors name in a dialog by using the actors ID? Right now I am referencing a name like this [lua(Actor["Jimmy"].Name)], which doesn't make sense since I can just write Jimmy inside the text. If I change the name in the database everything would break.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Reference actor by id?

Post by Tony Li »

In the Dialogue Editor, you can tick Use Display Name. This will add a Display Name field to the actor, which you can set to something different such as "Big Jimmy the Snake" and even change at runtime. Then you can do this:
  • Dialogue Text: "I heard from [lua(Actor["Jimmy"].Display_Name)] that you offed the Capelli gang."
namelesswc
Posts: 7
Joined: Wed Nov 22, 2017 9:01 am

Re: Reference actor by id?

Post by namelesswc »

Thanks! I knew about display names but somehow haven't thought of this.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Reference actor by id?

Post by Tony Li »

Happy to help!
Post Reply