Friday, February 27, 2015

rotating descriptions (alternate method)

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!

Thursday, February 26, 2015

object description rotation

This suggestion was made to me:
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:


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.


And examples of objects that use these would look like:


So, yeah, let me know if you guys want it in Roodylib or what.

Sunday, February 8, 2015

Scene Managing

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:



And here is the actual scene routines and code:



Anyhow, not sure how useful this will be to most people so I probably won't add it to Roodylib, but there it is!