Page 1 of 1

Reference actor by id?

Posted: Wed Nov 22, 2017 11:16 am
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.

Re: Reference actor by id?

Posted: Wed Nov 22, 2017 1:38 pm
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."

Re: Reference actor by id?

Posted: Wed Nov 22, 2017 3:33 pm
by namelesswc
Thanks! I knew about display names but somehow haven't thought of this.

Re: Reference actor by id?

Posted: Wed Nov 22, 2017 3:45 pm
by Tony Li
Happy to help!