Runtime Error TADS 3.1.3, adv3lite 1.6.1

While playing the Adv3Lite tutorial Heidi adventure, I received a Runtime Error when I used the command “>pu bird”. Will this always happen if the user enters a misspelled word? If so, do I need to add some code to Heidi.t to catch this?
I can play the game to the end with no problems if I use “>take bird”.

The msg box said “The TADS Runtime Error: index out of range”

A file was also opened with an arrow pointing to “if(gVerifyIobj == self)”
The file was “adv3Lite\thing.t”

I have screen snips but I don’t know how to include them in a post.

2 Likes

I’m not at a computer but I’ll check on this if someone doesn’t get to it first…

This appears to be a problem with the newest version of adv3lite.

The error occurs within “dobjFor(PutIn)” in thing.t, so it seems that “pu bird” is interpreted as “put bird (in …)”. That correction is not a problem in itself, but it leads subsequently to the error (directly entering “put bird” results in the same error).

Looking at the line which causes the problem: if(gVerifyIobj == self), we can follow the trail to gVerifyIobj, which is defined in advlite.h:

/* 
 *   the probable Action objects of the command being executed for use in verify routines when
 *   resolution of both objects may not be complete. If the gDobj or gIobj is non-nil, use that,
 *   otherwise use the first object in the tentative resolution list.
 */
#define gVerifyDobj (gDobj ?? gTentativeDobj[1])
#define gVerifyIobj (gIobj ?? gTentativeIobj[1])

So the error occurs because gIobj is nil and the program therefore looks at gTentativeIobj[1], but the index is out of range, which means that the list is empty (in TADS, the first element is at index 1).

This is the same error which has been discussed in the following thread:

Pinging @Eric_Eve so that he can take a look at the underlying issue.

3 Likes

Thanks!

Sorry, I got somewhat distracted by other events in my life (all good!) but I’ve now gone back and taken a further look and uploaded the results to GitHub. I’ve posted a fuller response to the original threat.

3 Likes