Page 1 of 1

DialogueLua.GetActorField giving wrong value

Posted: Tue Apr 04, 2023 10:06 am
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?

Re: DialogueLua.GetActorField giving wrong value

Posted: Tue Apr 04, 2023 12:39 pm
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?

Re: DialogueLua.GetActorField giving wrong value

Posted: Tue Apr 04, 2023 4:04 pm
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 

Re: DialogueLua.GetActorField giving wrong value

Posted: Tue Apr 04, 2023 5:21 pm
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?