Page 1 of 1

Help tracking down null Object reference in Lua exception

Posted: Wed May 31, 2023 9:27 pm
by LostTrainDude
[Unity 2021.3.26f1 - DS v2.2.37]

Hi Tony!

We write our conversations and a lot of our logic in Articy:Draft 2 and often have situations like the following:

Image

We often go back to a hub that checks which dialogue options to show or hide according to some variables.

With conversations like this one, I've suddenly started getting these Lua exceptions, and I can't track what Object is missing there, exactly.

Image

What confuses me more is that the variable checks and variable updates seem to be working properly throughout the conversation, regardless of the exception thrown.

The full stack of the error is here.

I tried debugging step by step but I couldn't find any answer. The only thing I noticed, but it's just a wild guess, is that the variable check includes additional whitespace between the variables and the keywords "and" and "not" ('return Variable["haralamb.asked_inn"] and not Variable["haralamb.asked_home"]')

I thought it was something related to the changes I had done to my SubtitlePanel but even commenting out the code nothing changes.

Do you have any suggestions?

Thanks a lot, as always!

Re: Help tracking down null Object reference in Lua exception

Posted: Wed May 31, 2023 9:45 pm
by Tony Li
Hi,

It's a bug in the Dialogue System's Lua parser. It's grouping the "not" keyword incorrectly. Anything of the form:

condition and not condition

will throw the error. But this will work:

condition and (not condition)

I'll post a fix by tomorrow.

Re: Help tracking down null Object reference in Lua exception

Posted: Wed May 31, 2023 10:04 pm
by LostTrainDude
Thanks a lot!

Re: Help tracking down null Object reference in Lua exception

Posted: Thu Jun 01, 2023 8:09 pm
by Tony Li
I'm running late on the fix. ETA is tomorrow.

Re: Help tracking down null Object reference in Lua exception

Posted: Thu Jun 01, 2023 8:27 pm
by LostTrainDude
No worries! Thanks again :)

Re: Help tracking down null Object reference in Lua exception

Posted: Sat Jun 03, 2023 11:27 pm
by Tony Li
This patch should fix the issue:

DS_LuaPatch_2023-06-03.unitypackage

Re: Help tracking down null Object reference in Lua exception

Posted: Mon Jun 05, 2023 5:23 am
by LostTrainDude
Hi Tony,

Thanks a lot! It seems to have fixed the issue!

Re: Help tracking down null Object reference in Lua exception

Posted: Mon Jun 05, 2023 7:50 am
by Tony Li
Glad to help! Thanks for letting me know about the issue.