Help tracking down null Object reference in Lua exception

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
LostTrainDude
Posts: 61
Joined: Wed Mar 21, 2018 2:14 pm

Help tracking down null Object reference in Lua exception

Post 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!
User avatar
Tony Li
Posts: 21051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help tracking down null Object reference in Lua exception

Post 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.
LostTrainDude
Posts: 61
Joined: Wed Mar 21, 2018 2:14 pm

Re: Help tracking down null Object reference in Lua exception

Post by LostTrainDude »

Thanks a lot!
User avatar
Tony Li
Posts: 21051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help tracking down null Object reference in Lua exception

Post by Tony Li »

I'm running late on the fix. ETA is tomorrow.
LostTrainDude
Posts: 61
Joined: Wed Mar 21, 2018 2:14 pm

Re: Help tracking down null Object reference in Lua exception

Post by LostTrainDude »

No worries! Thanks again :)
User avatar
Tony Li
Posts: 21051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help tracking down null Object reference in Lua exception

Post by Tony Li »

This patch should fix the issue:

DS_LuaPatch_2023-06-03.unitypackage
LostTrainDude
Posts: 61
Joined: Wed Mar 21, 2018 2:14 pm

Re: Help tracking down null Object reference in Lua exception

Post by LostTrainDude »

Hi Tony,

Thanks a lot! It seems to have fixed the issue!
User avatar
Tony Li
Posts: 21051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help tracking down null Object reference in Lua exception

Post by Tony Li »

Glad to help! Thanks for letting me know about the issue.
Post Reply