DialogueLua.GetActorField giving wrong value

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
crossgoune
Posts: 2
Joined: Tue Apr 04, 2023 10:03 am

DialogueLua.GetActorField giving wrong value

Post by crossgoune »

Hello, the GetActorField method keeps giving me the value of a field as empty even though in the database has a value. At first I thought I was giving the field name wrong but after debugging I found out that the Actor Lua table actually had the value as null. Why does this happen?
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialogueLua.GetActorField giving wrong value

Post by Tony Li »

Hi,

What's the C# code you're using?

Please temporarily add a Lua Console to your scene. Then play the scene and press ~+L to open the Lua Console. Enter:

Code: Select all

return Actor["name"]
where "name" is the name of the actor, replacing spaces and punctuation with underscores (e.g., Actor["Private_Hart"]).

Does it show the field you're looking for?
crossgoune
Posts: 2
Joined: Tue Apr 04, 2023 10:03 am

Re: DialogueLua.GetActorField giving wrong value

Post by crossgoune »

Thanks for the reply, the lua console doesn't show me the value but the field name is right.
"ImageName = null" is what is giving me and it should give me "signature" instead.
The C# code I'm using is:

Code: Select all

DialogueLua.GetActorField("Character", "ImageName").AsString 
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialogueLua.GetActorField giving wrong value

Post by Tony Li »

If the Lua Console doesn’t show the value, then it’s not there. I think the first step is to get it to show in the Lua Console. How are you setting the value? In the dialogue database? Via DialogueLua.SetActorField?
Post Reply