Hi there! I decided maybe it was time to finish that game I started in 2005 (oops), and now I’m facing the added difficulty of learning Inform 7. (The unpleasant alternative: relearning Inform 6.) I’ve been getting by on a combination of hammering on the documentation and pestering experienced IF writers over instant message, but I thought I’d try asking for help in a way that’s less frustrating to myself (in the former case) and my friends (in the latter).
So I’m trying to understand randomness, and sticky-randomness in particular. As best I understand it, “[at random]” is great for things that should change every time they’re invoked, and “[sticky random]” for things that shouldn’t ever change. But what if you want things to stay constant until told otherwise? For instance, suppose I want a newspaper headline that doesn’t change throughout the day, insofar as newspapers are static items in the real world, but which does change from day to day, insofar as new newspapers get delivered each morning:
[code]“Newspaper Headlines”
Your House is a room. The description is “This is a boring little house. Someone has brought in the newspaper already; its headline is ‘[headline]’.”
Instead of sleeping:
say “You go to sleep. In the morning, a new newspaper has arrived.”;
redeliver;
move player to the house.
The headline is a text that varies.
To redeliver:
now the headline is “[one of]Land War in Asia[or]Pope Admits Fallibility; Experts Consider It An Error[or]Newspapers Collapse; More Tomorrow[at random]”.
When play begins:
redeliver.
Test me with “sleep / look / sleep / look / sleep / look / sleep”
[/code]
The sad result of this story is that every time you look at the room, the room description calls [headline], and headline is “one of these three things at random”, so every time you look at the room you get a headline at random. I thought “sticky random” would fix this, but replacing “[at random]” with “[sticky random]” means that the headline never changes, not even when “redeliver” is called.
Is there some way to assign text at random to “headlne”, and have it stay that way, but still be changed later?