Monday, June 25, 2012

DescribePlace musings

Tonight, I was working on my "Frankenstein monster" version of DescribePlace (http://hugo.gerynarsabode.org/index.php?title=Replace_DescribePlace). Beyond the things already listed by DescribePlace, I was thinking it'd be cool to add two additional configurable things to check, so conceivably, you could put one right after the room description to call routines like YouCanGo ("You can go east to the lake or north to the parking lot.") without having to edit each room's long_desc to call it. On the other end of the spectrum, you could call routines like score notifications or footnote stuff so they are printed after all room description stuff but before event/script stuff.

My test code was working great until I remembered that YouCanGo, my test routine, prints messages every time and that my code wasn't prepared for situations where something may or may not be printed (btw, sorry I'm so italics-intensive). To do proper spacing, there are parts of DescribePlace where one should only print a new line if something else is going to be printed, so it's important to know whether something will print before you call it. I tried to get around this uncertainty by using "text to <array>" to hide all text when the routine is called, using its return value to determine whether it was successful- and if so, running the routine again once I stopped writing to array. Unfortunately, even when writing to an array, carriage returns are processed normally, so there was no way to avoid ugly, extra space in my game.

Anyhow, I'm not really happy with my options at the moment. For the meantime, I'm throwing my whole idea to the backburner until I come up with something more appealing.

No comments:

Post a Comment