Delighted to discover Chris's text adventure tutorial at
https://retrogamecoders.com/c64-adventure-programming/
but running the completed BASIC example in VICE produces
dank basement
objects visible:
?next without for error in 13
The original relevant code snippet (since converted to lower case for pasting into VICE) is
11 FOR I = 0 TO OC-1 : REM CHECK OBJECT LOCATIONS FROM THE FIRST OBJECT TO OBJECT COUNT
12 IF OL(I) = PL THEN PRINT ". ";OB$(I) : REM IF THE OBJECT IS IN CURRENT LOCATION PRINT IT
13 NEXT I
14 PRINT ""
Any ideas why that happens? With thanks in anticipation.
My guess is line-lengths, easiest test would be to delete or trim the REM statements I added for explaination :)
The online IDE tokenises so doesn't have the same limitation if you want to try/download from there https://ide.retrogamecoders.com/?file=adventure.bas&platform=c64
That worked. Terrific. The tutorial opened my eyes to the many benefits of linked lists over arrays when writing text adventures. Any chance of supplementing the original tutorial with a walkthrough explaning how the BASIC room/object/location/inventory routines work, because all the Copilot and other online primers on linked lists are fairly impenetrable for a newbie and anyway major on low-level code such as C++ and Python.
John Ransley for sure! Any particular part/aspect?
Brilliant. Actually, having spent more time studying the tutorial listing, I'm beginning to get it. Only I'm not clear what this does and how the values are determined:
168 REM N E S W U D
169 DIM EX$(20)
170 EX$(1)="000002000000"
171 EX$(2)="010000000300"
172 EX$(3)="000000000002"
John Ransley ah so it is better to visualise it as a table:
N E S W U D would be the headings at the top
Edit: Ugh it throws the formatting off, image instead

Then the numbers relate to which room that exit leads to, so Room 1 has a South exit to Room 02. Room 02 has a North exit that takes you back to room 01, and also can go Up to room 03, which has an exit back down to Room 02
Got it. Most helpful. Thanks very much.