Working on a bit of code (skeleton for now) where you will enter a "room" that actually serves two purposes (which is originally determined by "path"). In later sections, the variable "lastSpecial" (originally set to 0 at game start) will be set to the path you discovered. If you come in that way again, you'll get a simple statement that you've been here before. I don't want to use the "if seen" deal, because in following sections, the same section will be used, just with a different path. It is anticipated that this room will eventually have a lot of paths. I want you to random down different paths, but not do the same path back to back).
For testing, you'll note I've overridden path to always be 1, to test the second-time-cant-do-it-again bit.
Everything works fine, except that on the first time through (when you get the "[[continue]](room6a)" part, THAT piece of display comes back in a light blue box (if simply "run") and in an odd font (if "built"). So, I've counted brackets, checked spacing, all that. For the life of me, I can't understand why that final line (which works perfectly find) is "indicated" with the font and box. Ideas?
[[room6]]:
@dec minutes 10
@set done = 0
var path = Math.ceil(Math.random() * 2);
squiffy.set("path",path);
squiffy.set("path",1); //TESTING MOD TO FORCE PATH
if (squiffy.get("lastSpecial") == squiffy.get("path"))
{squiffy.set("path",0);}
{if path=0:
You are in a dark stone chamber. You realize that you've been here before
[[So move on.]](central hall)
}
{else:
{if path=1:
<img src="room1.gif" alt="room1" height=200 width=200>
This is the description of room 1. Possible treasure
}
{if path=2:
<img src="room2.gif" alt="room2" height=200 width=261>
This is the description of room two. Possible traps
}
[[continue]](room6a)
}