Null object reference error in Adv3Lite

So, I’m working on some code that utilizes the adv3Lite library.
This particular chunk of code was originally written for the standard adv3 library. When I finally get it to compile and start up the game, I get this output:

Runtime error: nil object reference
-->english\grammar.t, line 3611
   doer.t, line 922
_main.t, line 417
_main.t, line 463
_main.t, line 581
_main.t, line 464
_main.t, line 550
_main.t, line 280
_main.t, line 75
_main.t, line 31

Anyone know what’s going on?

It’s hard to say what’s going on without having more details about your own code, but seeing that it seems to happen pretty soon in the execution of the game, before you’ve had the opportunity to interact in any way, then I’d say it depends only on what you have defined statically in your game, not on some particular weird state the game gets into at some point.

In other words, there must be something specific in your own code that’s causing this unconditionally. Would you be able to pinpoint it? Is there some part of your code which you added recently and, if you delete it, prevents this from happening? I would guess so since you’re speaking about “a particular chunk of code”. What’s the smallest part of it you can remove and get the code to run? That must be where the cause is.

Also, if you’re using Workbench on Windows, you may be able to put a breakpoint at line 3611 in grammar.t, and inspect the relevant variables by hovering the mouse over them. This line reads

    action.grammarTemplates += t.join(' ');

and the error message suggests that one of the variables involved there is nil though it shouldn’t. So it would be interesting to know whether action, or action.grammarTemplates, or t, is nil (that’s most probably one of those three); that may help in determining what in your code is causing this.

Cheers,

–Michel.