Page 1 of 1

Quest Npc Portrait in script

Posted: Thu Jul 20, 2023 1:49 am
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?

Re: Quest Npc Portrait in script

Posted: Thu Jul 20, 2023 8:30 am
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();