A question to me got me thinking about object property arrays, and it occurred to me that'd be another reasonable way to handle rotation descriptions. The main perk of this method is that you wouldn't have to replace the routines if you have more than 5 descriptions to work with. The big question to Hugo coders is whether:
long_desc
Rotate
rotate_desc "It's a door." "It's still a door." "Stop looking at it." \
"I mean it." "I really do."
Is as acceptable as:
long_desc
{
rotate( "It's a door.", "It's still a door.", "Stop looking at it.", \
"I mean it.", "I really do.")
}
Anyhow, here is the entire code if anyone wants to see it!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Another thing that would be handy would be some kind of list manager like in TADS or Inform that would make it easier to make things that change descriptions every time you look at them. For example:
long_desc
{
rotate( "It's a door.", "It's still a door.", "Stop looking at it." )
}
Now, traditionally, you would do such a thing with code like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
But, of course, sure, some helper routines could be written for anyone who wants the functionality of the suggestion above. Following is some example code for doing such a thing. I guess I could add it to Roodylib if enough people think it'd be useful.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And examples of objects that use these would look like:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lately, I was looking at the code for a game that used constants and a global variable to keep track of scene changes, something I've done in at least one of my WIPs, too. It got me thinking that it'd be nice to have some code available for spitting scene stuff out so authors don't have to reinvent the wheel each time.
A room might check scene settings like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters