Acting Fast

I’m about to add some timekeeping code to my game because some scenes in it are time sensitive.

I’m looking at the example ‘Timeless’ in Chapter 4 of the Inform Recipe Book. It all makes good sense, but the way it works is by defining entire actions as ‘acting fast’ (they don’t make a turn pass) or not (they do).

How can I make different parts of the same action result in acting fast or not acting fast?

For instance - if the player bumps into a wall by accident, I want that to not take a turn. But if they move to a new room, that should take a turn. Stuff like that.

I tried to tighten the definition and make the definition of “going nowhere” somewhat conditional.

[code]Going nowhere is acting fast.

The take visual actions out of world rule is listed before the every turn stage rule in the turn sequence rules.
This is the take visual actions out of world rule: if acting fast, rule succeeds.

RoomOne is a room. RoomTwo is west of RoomOne. RoomThree is west of RoomTwo.

When play begins: now the right hand status line is “[time of day]”.[/code]
The result is interesting and sadly results the going action being frozen in time. Although my idea seemed far-fetched, I don’t understand how “going nowhere” can apply when, in fact, we’re manifestly going somewhere. Unless, of course, the direction hasn’t been parsed yet. :confused:

Curious.

I suspect the problem is that “nowhere” is not the kind of thing that gets parsed: what gets parsed is “north”, and it is up to the rules of the game to decide what effect that action has. This has probably not been decided before it is decided whether we are acting fast.

Whether this diagnosis is correct or not, you might want to use the following trick:

To take no time: (- meta = true; -).
and then add the phrase “take no time” to home-made version of the relevant check rules. In this case, however, because going has so many check rules, you might be better off just writing an after rule that checks whether the player has actually changed his location.

If you want to do a lot of this, I recommend Eric Eve’s Variable Time Control extension.

Thanks all.

Yeah, Variable…Control is what I need. I’d read the docs before but I forgot about its existence during the month away from working on my game.

  • Wade

I’ve added in Variable Time Control, and it works as far as the numerical turn counter is concerned. So if I walk into a wall, the turn counter in the upper right corner doesn’t move.

However, it doesn’t seem to be having any effect on the timed events, which is the important part.

If I say ‘typhoon strikes in 3 turns from now’, the typhoon will occur after you type 3 more commands, whether or not those commands eat up lots of moves/time or none at all (the [no-time] schtick, which is supposed to make a command happen as if it was out-of-world). The player could walk into a wall 3 times, and the displayed turn counter won’t move during that time, but the typhoon still happens after the third wall collision.

This potentially should go to the author, but I wanted to check if this is a known issue?

OK I worked out the issue here.

Variable Time Control works so long as you address all timing in terms of seconds, minutes, hours, etc - explicit amounts of time.

If you use the term ‘turns’ (which is interchangeable with ‘minutes’ in a default game setup) you get a different result.

Saying ‘Typhoon strikes in 3 minutes from now’ will play nice with your Variable Time assignments.

Saying ‘Typhoon strikes in 3 turns from now’ will not play nice. The typhoon will strike even if you perform a series of actions which are supposed to take no time.

Good! That actually sounds like a potentially useful distinction.

As Felix noted, that could be considered a feature, not a bug. Not sure when you’d want to use it, but it’s nice to have the flexibility.

Well, it could be a feature, but I’ve realised the extension doesn’t address ‘every turn’ rules at all.

Since you can’t write ‘every minute:’ - all rules that begin with ‘every turn:’ keep happening no matter what else you try to govern with this extension.

EDIT - OK! I concocted this little fix myself and am reasonably chuffed, given I still consider myself pretty new to Inform 7. With this in place, if the [no-time] tag is used at any time during a turn, the every turn rules will not fire at the end of that turn:

[code]
This is the NEW every turn stage rule:
if time-reset is true, do nothing;
otherwise follow the every turn rules.

The NEW every turn stage rule is listed instead of the every turn stage rule in the turn sequence rulebook.[/code]

:sunglasses: