Turning on RULES ON before play starts.

I have a set of rules that trigger after the banner is presented, but before LOOK is invoked on the first room. I want to turn the RULES ON diagnostic before that LOOK. By the time the first room is described, it is too late.

Some time ago, someone posted an arcane rule that started RULES ON before anything else.

Before play begins:
     RULES ON

does not work. Some special syntax was used.
Anyone know what I’m talking about?

Draconis offered the following solution (source):

To turn on rules tracing:
	(- RulesOnSub(); -);

When play begins:
	turn on rules tracing;
2 Likes

And if you want it to happen before all your other “when play begins” rules, you can make it be “first when play begins”.

The earlier hook is “after starting the virtual machine”, but it’s dangerous to print anything there, because that’s when Inform is still setting up the screen model.

1 Like

A nice feature in current dev Inform is that (in the Glulx case) a before starting the virtual machine rule starts capturing text and for starting the virtual machine rules open the initial windows and outputs any captured text, and you can know you’re free and clear to output text in any after starting the virtual machine rules. (Thanks to @Dannii !)

3 Likes

Thank you. This was the arcane syntax I saw before, and it worked beautifully!

1 Like

Thanks. This might be what I want, and fit better.