I’m working with Adv3 Lite or trying to, and a problem I keep encountering is when I try to create things, I get a stack error message, which points to a place in english.t. At first I thought maybe I had modified the file accidentally and tried to reinstall adv3 Lite, but I still get the problem.
Then I thought it’s related to my ‘thing’ so I tried to copy and paste a thing from an example changing only the location and I get the same following problem even though the Debug Log comes up fine.
Step 1. I write the code for the black crystal using the same structure as redball “Learning Tads 3”, the only thing I haven’t done is desc. there is no ; separating, because when I do that the entire thing shows up blank.
BlackCrystal: Thing
vocab = 'black crystal; glowing black crystal'
desc = "The small crystal glows black."
location = Cavern
;
vs.
redBall: Thing
vocab = 'red ball; small red hard round cricket'
location = frontLawn
desc = "It's quite small and hard; it looks much like a cricket ball. "
;
Step 2. I Press F5 to run the game. The game debug’s successfully, however english.t & stack file opens up, and the game either displays the object or it doesn’t. It points me to this in the stack file:
BlackCrystal.aNameFrom('black crystal') + 0x50 [b]<---Points out this line with yellow marker[/b]
BlackCrystal.aName() + 0x12
inventoryLister.listName(BlackCrystal) + 0xE
func#64f08(BlackCrystal) + 0x19
List [[BlackCrystal]].mapAll(obj#ca44 (AnonFuncPtr))
inventoryLister.showList([BlackCrystal], nil, 0) + 0x24
inventoryLister.show([BlackCrystal], 0, true) + 0x77
inventoryLister.show([BlackCrystal], 0) + 0x23
Inventory.execAction(obj#cabb (Command)) + 0x98
Inventory.execAction(obj#cabb (Command)) + 0xF
Inventory.execCycle(obj#cabb (Command)) + 0x98
Inventory.exec(obj#cabb (Command)) + 0x3F
default1Doer.execAction(obj#cabb (Command)) + 0x13
default1Doer.exec(obj#cabb (Command)) + 0x56
Command [cabb].execDoer([Inventory]) + 0x89
Command [cabb].execIter([Inventory]) + 0xF
Command [cabb].exec() + 0xD0
Parser.parse('i') + 0x422
mainCommandLoop() + 0x72
runGame(true) + 0x37
gameMain.newGame() + 0x35
mainCommon(&newGame) + 0x41
Step 3. In the game window I check to see if it’s the object is there, it appears to be there. It’s there with this particular code, I take the ‘crystal’ and it says “Taken”, I type i for inventory, the game window displays: "You are carrying " and brings me back to the english.t file, and points out this bit of code:
[code] /*
* if the first word is in our special-case list, use the special
* case handling
*/
local sc;
if (rexMatch(firstWordPat, str) //<–Red Marker starts here
&& (sc = specialAOrAn[rexGroup(1)[3]]) != nil)
return (sc == 1 ? 'a ’ : 'an ') + str;
/* get the first character of the name */
firstChar = inStr.substr(1, 1);
[/code]
Step 4. I repeat the steps, I check my inventory before I pick up the object, no crash, after, crash. I try different ways of creating the object: Thing, I add ( I remove (
in desc section, I add (.) and remove (.) in the description .
I even copy and paste from the Tads 3 Lite book (as maybe I have forgotten a comma or a period, putting in a period or removing it in the sentence effects whether it displays or not), no matter what I do, I still have this issue.
Step 5. I F5 again while the game is still running and it shows what’s in my inventory, and it shows what’s in the room. Making me think my code is fine, but I have to F5 it twice while the game window is still open before it shows.
I realize then the program is stopping in two places in the room: "You can see a " ,
and when you type inventory: “You are carrying a…”
It’s the first time I’ve struggled with creating an object using Tads 3; I am familiar with creating them using the regular adv3 library. I’m not sure what I’m doing wrong with the lite version.