[I7] Including I6

[code]Foo is a truth state variable. Foo is true.

Include (-
Global fooward = (+ Foo +);
-).

There is a room.[/code]

Going by the manual, I thought this would compile on the latest version of I7. It fails during translation, though. Can anyone see what I’m doing wrong?

In I6 you can’t initialize a global variable from another global variable. Set the initial value in a “when play begins” rule.

Thank you. It’s odd though, I still can’t seem to get it to work under 6L02:

[code]
Foo is a truth state variable.
Include (- Global fooward = (+ Foo +); -).

When play begins: now Foo is true.

There is a room.[/code]

Again, you’re trying to initialize a global (fooward) from another global (Foo).

Apologies. I somehow got the impression I7 would do an inlining (which is ridiculous when it comes to a non-constant value, but there you go…)

To expand on what I’m trying to do: I’m trying to alter the in-game look of regular text under Glulx so that it changes dynamically in response to what happens in the game. I remember Photopia utilizing dynamic color changes, which seems to be what I have in mind.

I tried changing the pointer in the Typography section of the Glulx template, but apparently it’s not all that easy to expose it. Basically, I figured that if “dynamic_style_id” is a numeric value accessible from I7, I want to have something like

[ VM_Style sty; switch (sty) { NORMAL_VMSTY: glk_set_style( dynamic_style_id ); HEADER_VMSTY: glk_set_style(style_Header); SUBHEADER_VMSTY: glk_set_style(style_Subheader); NOTE_VMSTY: glk_set_style(style_Note); ALERT_VMSTY: glk_set_style(style_Alert); BLOCKQUOTE_VMSTY: glk_set_style(style_BlockQuote); INPUT_VMSTY: glk_set_style(style_Input); } ]; work, which might then be styled via the Glulx Text Effects extension.

Is that even possible, or do such things require restarting the VM?

Eleas, for your original case, how does what you’re trying to do differ from this?

[code]Include (- Global fooward = (+ true +); -) after “Definitions.i6t”.
Foo is a truth state that varies.
The Foo variable translates into I6 as “fooward”.

There is a room.

Before jumping:
If foo is true:
now foo is false;
otherwise:
now foo is true.

Every turn: say “Foo is [foo].”[/code]

(Coding follies: at one point I was getting an error that said I was trying to set true to false and thought this was something subtle about the I6. I had actually typed “now true is false” instead of “now foo is false.”)

Ah, I see. I saw that line in the manual, and didn’t twig to why placing it after a particular template would be that important. Thank you.