Quest Npc Portrait in script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
JeyWoo
Posts: 3
Joined: Thu Jul 20, 2023 1:44 am

Quest Npc Portrait in script

Post by JeyWoo »

hello
I want to get the NPC portrait sprite of each quest in the dialog system quest into the script.
What should I do?
Attachments
question0.jpg
question0.jpg (13.75 KiB) Viewed 115 times
User avatar
Tony Li
Posts: 22119
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Npc Portrait in script

Post by Tony Li »

Hello,

Since you have changed the Pictures field's type to Actor, it will contain the actor's ID. To get the portrait:

Code: Select all

int actorID = DialogueLua.GetActorField("Slay the Slime", "Pictures").asInt;
Actor actor = DialogueManager.masterDatabase.GetActor(actorID);
Sprite portrait = actor.GetPortraitSprite();
Post Reply