Inform7 is setting Values arbitrarily

Hi guys, I have a problem that downright confuses me. Basically, I have a block of values that make up the games preferences, and Inform has decided that (of all the blocks like this in the game), this block should be totally fixed on specific options that I cannot change no matter what I do. The weird thing is that the only common trait between these blocks is that I use them for word replacement. Here is an example:

GoreMode is a kind of value.  The GoreModes are NoGore and SomeGore. GoreMode is NoGore.

As you can imagine, ingame it’s hard set to SomeGore and I can’t change it at all. :stuck_out_tongue:

I know this is a valid way of writing this, but unlike my other values Inform won’t let me print it using “[GoreMode]” or set it in any way. I have tried every variation of ‘GoreMode is NoGore.’ including ‘always’ but I can’t get it to work. Yet the only difference between that and every other value in the game is:

To say WoundedLeg: If the GoreMode is SomeGore: say " gushing blood"; otherwise: say "".

This is really confusing me as that is ALL the GoreMode script! :angry: It is not even attached to any object or person. Can anyone help?

Make it a value that varies.

How do I do that? I tried ‘GoreMode is a value that varies’ and ‘GoreMode is a kind of value that varies’. But it wouldn’t compile.

A kind is, as it’s name suggests, a type: a kind can’t itself vary: whatever it can be it always is, so if you say that “color is a kind of value. The colors are red, orange, yellow, and blue”, those are the possible colors, all of them.

A “blah that varies”, on the other hand, does what it says: it can take any value of blah that is possible in the world. So if the possible colors are as set out above, and “tint is a color that varies”, then tint can be red, orange, yellow or blue.

So for what you are looking to do, you have two options: you can make GoreMode a variable of a type (i.e. kind of value) already known to Inform (for instance, a number), or you can define a new type/kind, and then make GoreMode a variable of that type/kind. So this works

Gore-factor is a kind of value. The gore-factors are wimpish, robust, bloody, and revolting.

GoreMode is a gore-factor that varies. GoreMode is wimpish.

Gore-stating is an action out of world. Understand "show gore" as gore-stating. Carry out gore-stating: say "This game is [GoreMode].".

Gore-increasing is an action applying to one gore-factor. Understand "gore to [a gore-factor]" as gore-increasing. Carry out gore-increasing: now GoreMode is the gore-factor understood; say "Gore factor is now [GoreMode]."

If you have experience with other programming languages, what you’re doing now is something like this.

enum GoreMode {NoGore, SomeGore};

GoreMode = NoGore;

What you want is this.

enum GoreMode {NoGore, SomeGore};

GoreMode gMode;
gMode = NoGore;

In other words, you’re creating a kind of value, but not a variable that actually uses it.

A gore mode is a kind of value. The gore modes are no gore and some gore.
The current gore mode is a gore mode that varies.

Or, without creating a new enumeration:

Gore described is a truth state that varies.
if gore described is true, say...

Ok, this is really weird. This first one still gets totally stuck on ‘some gore’ no matter what I type to try and change it.

But this one works perfectly:

Can you help me make it work with the multiple choice one as I wanted to put in a third ‘fullgore’ option?

Sorry, that was my mistake. Inform is interpreting “some” as an indefinite article. Try this.

A gore mode is a kind of value. The gore modes are no gore, partial gore, and full gore.

Ok, this is really really weird. It turns out that it doesn’t matter what gore mode I have it set to, it will always trigger the first of these regardless of what order I have them in:

To say GoreTEST: If the gore mode is partial gore: say "BLOOOD."; otherwise if the gore mode is no gore: say "No Blood."; otherwise if the gore mode is full gore: say "TEST TEXT.".

Am I doing something wrong here? It does it in a blank test game with no extensions.

If your variable is “the current gore mode” then you should be testing “if the current gore mode is partial gore” and so on. I think “if the gore mode is partial gore” may be compiling to something like “If partial gore is a gore mode” which is always true.

In general if “gore mode” is a kind of value “the gore mode” will never do what you want it do, I think; it should always be the name of a variable that ranges over gore modes, or if you have given some object a “gore mode” as a property then you might write “the gore mode of the noun” or something like that. Inform’s Englishiness can trick us into writing things like “the gore mode” that English speakers can interpret from context, but it’s very rare that Inform can interpret them from context.

Oh thank you, it works! :laughing:

Wow, that was a lot of messing about for one tiny bit of script, lol.