Room (location) display problem
Posted: Sat Nov 16, 2019 6:37 am
I'm not sure what is being done wrong but I welcome any suggestions.
I started a new game which I am calling The Librarian. I used the "new" shell from RoodyLib¹ and made substantial modifucations, but when I compile and run the game, on startup there is no description of the room and the LOOK command doesn't work either even though the room has a long_desc property.
I thought, maybe I'm doing something wrong as I wanted the player to start the game waking up on their bed, and maybe placing the player on an object (instead of a room) caused problems. So I had him arrive in the room, and still no description.
So I thought I'd check, so I compiled a vanilla (stock, unmodified) Roodylib shell (rdyshell.hug) to check it compiles, then modify it to add a long_desc to the only room, and save, compile and run. Curiously, it also shows no information.
So then I went to the Hugo supplied template (shell.hug) compiled a vanilla copy, then added long_desc, save, compile and run. Guess what the result was? If you said, "it also didn't show descriptions" you're absolutely right!
But it gets more interesting. I downloaded hugozork.hug from hugo source code on IF Atchive. This is Kent Tessman's port of a TADS port of the Fortran release of Dungeon, the predecessor to what would become Zork I.
Other than correcting two lines having minor errors due to language changes (the code says its written for version 2.7, we're using 3.1), it's essentially vanilla. And this almost stock copy works perfectly, when the game starts, it shows the description of the clearing at the mailbox in front of the white house.
So clearly it's possible to get room descriptions to show but I'm not sure why they don't. I'm asking for any suggestions. Failing to find one, I'll use the "great artist" method². Take HugoZork, rip out every room, object, fuse, and daemon (except for the initial room), and be sure the description function still works, then save that as a template to build games. Then slowly add pieces from my current game, being sure that I don't break functionality in the process, then continue building from there. Or possibly leave some complex pieces as templates to show how to use those features (like doors, rooms whose directions change, daemons, and fuses,)
Thank you for your time reading this message.
- - - -
¹ I want to give a shout out to Roody Yogurt for his work on RoodyLib, especially having read his code. One really devious piece of work was to find a way to have some objects specially reinitialized differently from what the RESTORE command does. But since all user variables and objects are reinitialized, how do you save anything? You use a system variable that is not saved or restored. So each object that wants to survive restore becomes part of the init_instructions family and type settings, then before restore, the object indicates it wants to survive RESTORE, so its name is saved in the system array word[], (which is not restored) then after restore the object's execute property is called to allow it to do whatever it needs. A brilliant solution. Very slick.
² "Good artists borrow, great artists steal."
I started a new game which I am calling The Librarian. I used the "new" shell from RoodyLib¹ and made substantial modifucations, but when I compile and run the game, on startup there is no description of the room and the LOOK command doesn't work either even though the room has a long_desc property.
I thought, maybe I'm doing something wrong as I wanted the player to start the game waking up on their bed, and maybe placing the player on an object (instead of a room) caused problems. So I had him arrive in the room, and still no description.
So I thought I'd check, so I compiled a vanilla (stock, unmodified) Roodylib shell (rdyshell.hug) to check it compiles, then modify it to add a long_desc to the only room, and save, compile and run. Curiously, it also shows no information.
So then I went to the Hugo supplied template (shell.hug) compiled a vanilla copy, then added long_desc, save, compile and run. Guess what the result was? If you said, "it also didn't show descriptions" you're absolutely right!
But it gets more interesting. I downloaded hugozork.hug from hugo source code on IF Atchive. This is Kent Tessman's port of a TADS port of the Fortran release of Dungeon, the predecessor to what would become Zork I.
Other than correcting two lines having minor errors due to language changes (the code says its written for version 2.7, we're using 3.1), it's essentially vanilla. And this almost stock copy works perfectly, when the game starts, it shows the description of the clearing at the mailbox in front of the white house.
So clearly it's possible to get room descriptions to show but I'm not sure why they don't. I'm asking for any suggestions. Failing to find one, I'll use the "great artist" method². Take HugoZork, rip out every room, object, fuse, and daemon (except for the initial room), and be sure the description function still works, then save that as a template to build games. Then slowly add pieces from my current game, being sure that I don't break functionality in the process, then continue building from there. Or possibly leave some complex pieces as templates to show how to use those features (like doors, rooms whose directions change, daemons, and fuses,)
Thank you for your time reading this message.
- - - -
¹ I want to give a shout out to Roody Yogurt for his work on RoodyLib, especially having read his code. One really devious piece of work was to find a way to have some objects specially reinitialized differently from what the RESTORE command does. But since all user variables and objects are reinitialized, how do you save anything? You use a system variable that is not saved or restored. So each object that wants to survive restore becomes part of the init_instructions family and type settings, then before restore, the object indicates it wants to survive RESTORE, so its name is saved in the system array word[], (which is not restored) then after restore the object's execute property is called to allow it to do whatever it needs. A brilliant solution. Very slick.
² "Good artists borrow, great artists steal."