Changing a global truth state

I’m a programmer working on my first Inform project and trying to figure out the language as I go. It’s mostly going well, but I’ve run into a problem that I just can’t seem to find documentation on. (Maybe my programming background is making me search for the wrong things?)

I’m using Eric Eve’s Conversation Suggestions extension and I don’t want it to list suggested topics when the player first greets an interlocutor. According to the extension’s documentation, I need to change suggest-on-greeting to false. Seems easy enough. But I can’t get it to work.

When I try, “Change suggest-on-greeting to false.” the compiler complains that it can’t find a verb that it knows how to deal with. This is particularly frustrating, as “change” is used throughout the documentation for Inform 7.

When I say “Now suggest-on-greeting is false.”, the compiler complains that I’m trying to say that a thing is a value. From what I can tell, the compiler thinks I’m creating an object called suggest-on-greeting, rather than referring to the existing global variable. But the global variable definitely exists; it shows up under the Contents Index.

I imagine this is an unbelievably simple mistake for me to be making, but I’ve been searching for hours for an answer and I’m either using the wrong terms or looking in the wrong places. Any help would be hugely appreciated! Thanks!

I can’t tell exactly without seeing your actual code, but I have a feeling you’re trying to make an imperative statement without a context; frequently things like ‘Now the…’ or ‘Change the…’ type statements need a context for them to work, such as an activity, rule check, condition, and so on.

For an easy example, maybe try something like:

When play begins: change suggest-on-greeting to false. 

“Change” phrases don’t work on their own. You need to place the command inside a rule.

When play begins: change suggest-on-greeting to false.

Everything that doesn’t set up the initial state of the world (i.e. every change to the world state) must go into a “function” (a rule or such). Here the extension sets up the initial state (suggest-on greeting is true), so every change to that variable must be done inside a rule.

Edit: Damn! Again 2 minutes too slow :slight_smile:

Ah! Okay, now I understand. It wasn’t clear to me that I needed context to make imperative statements, and I wasn’t familiar with the “When play begins” rule book. I made that change and it works exactly the way I had hoped. Perfect!

Thanks for your quick replies, both of you! (Even Nitku!)

I should add that ‘all imperative statements need a context’ probably is more a rule of thumb than something hard and fast, but if you think of I7 as a declarative language things make more sense.