Having a TEST like command in Inform released version

For reasons that I’m not going to go into in detail I want to allow players in my latest game to use a secret command to shortcut things in a certain situation.

I have a TEST command in there already which would be perfect, but obviously TEST doesn’t work in a release not for testing. And I don’t want to release a for testing version publicly that would allow too much access to other secret commands like PURLOIN etc.

Is there an easy way I could implement a test like command in a release version? I’m thinking something that would take a string like the test command takes e.g. “NORTH / GET BOTTLE / EAST / CLIMB TREE” which represent a series of commands. Is there any way to get Inform to parse these as commands and then execute them like TEST does? Maybe lower level than I understand (Inform 6?)?

The alternative would be for me to fiddle with some variables and move the player etc. But it might require quite a bit of juggling with scenes. Probably doable though if need be.

Thanks folks!

1 Like

Dunno if this does everything you need, but you could always use the “try” syntax as part of the test action:

try going north;
try taking the bottle;

Though this is fairly fragile if the player does anything substantive before invoking the command; personally I’d probably lean more to directly shifting the needed variables than trying to script out the exact action sequence (especially if there’s any randomness involved at any point in your game…)

1 Like

Just tried that, but if I put the equivalent try command sequence in it doesn’t fire scene changes properly and breaks.

I am probably just going to have to fiddle with variables etc.

Thanks for the help!

Ah, right - if you’ve got every turn rules or scene changes, those won’t fire. You could manually follow the turn sequence rules after each try statement, but yeah, the direct approach is probably best.

1 Like

Thanks! Yup I think the direct approach is going to be best. Will just have to put my thinking hat on a bit more.

Thanks for your help!

1 Like

At the end of a losing play, you could just ask, “Would you like another try?” and then move the player to where you want them to be if they consent. That might be easier than the TEST idea. Because I don’t know who came up with that weird idea.

1 Like

Haha! Thanks, yup that’s the sort of thing I’m going to go with.

Thanks folks for helping me work through this.

1 Like

I gave an example of implementing something like test manually here: Test script text case changed - #8 by Zed

2 Likes

Cool! Thanks :slight_smile:

1 Like

Depending on your version of Inform, I wrote an extension years ago for this. Shouldn’t be too hard to update for 10.1 either, I just need to install Inform on the new laptop and I haven’t yet.

3 Likes

Thanks again everyone for your help. All coded up now. Using a changing variables option plus getting the scenes ok. Happy!

2 Likes