The game I’m currently working on is a) huge and b) relies heavily on time, so this is going to be a bit of a bugaboo if I can’t get it working. What I’m trying to do is make it so certain actions that can’t/shouldn’t be done (like, in the thing i’m specifically working on, putting something besides your bike on a bike rack) not take up a turn.
There seems to be no easy way to do this though. The “instead” modifier doesn’t actually keep a turn from passing, of course. I already used the “Timeless” example code to make a bunch of other, broader actions take up no time, but trying to write something like
Putting something that is not your bike on the bicycle rack is acting fast.
throws a “two different things can’t be the same thing” error on compilation. About the only thing I can think of that could work would be an incredibly long, tedious “After reading the command” function, but since I’d rather avoid that, can anyone help me figure this out?
This is likely to get searched for a more general solution, so I included 2 approaches that work in 6g.
To decide whether the current action is no-timely: (- meta -)
to decide whether the action is turn-ignoring:
if the current action is no-timely, yes;
if pushing:
if noun is chuck, yes;
no;
if saying yes, yes;
if saying no, yes;
skip-turn-rules is a truth state that varies.
before pushing dave:
say "Dave pushed.";
now skip-turn-rules is true;
the rule succeeds;
the special skip turn rules rule is listed instead of the advance time rule in the turn sequence rules.
this is the special skip turn rules rule:
if action is turn-ignoring:
say "definition-ignored.";
the rule succeeds;
if skip-turn-rules is true:
say "Skip.";
now skip-turn-rules is false;
the rule succeeds;
follow the advance time rule;
PUSH CHUCK won’t hit the turn-counter and neither will PUSH DAVE, but PUSH ED will.
Both methods require maintenance, of course, and I prefer the first, since you can specify everything in one big rule. I am sure there are others.
Is there any chance that the compiler is just reading that declaration incorrectly? You may be able to help it out through the use of parentheses, e.g.
(Putting something that is not your bike on the bicycle rack) is acting fast.
or
Putting (something that is not your bike) on the bicycle rack is acting fast.
This is not correct syntax (see @StJohnLimbo 's post below for the probable actual explanation) as hinted at in the error message: “two different things can’t be the same thing.” This tells you Inform isn’t recognizing your phrasing as an action.
Since it looks like you’re basing your code on ex. 408, try:
Definition: a thing is nonbike:
if it is your bike, decide no;
decide yes.
Putting a nonbike thing on the bicycle rack is acting fast.
If the bike is directly defined as “your bike”, then the OP’s version already works for me (in v10.1.2), without parentheses:
The player carries your bike.
Putting something that is not your bike on the bicycle rack is acting fast.
If it’s introduced as “a bike” or “the bike” (and given the “article” “your” for nicer output), then we can’t use “your bike” in the description of the action, but “the bike” works fine:
The player carries a bike. The indefinite article of the bike is "your".
Putting something that is not the bike on the bicycle rack is acting fast.
Its workings aren’t that different to what’s already been offered, but there’s an extension that sets time-skipping up in a good framework. I use it in every game I make. Then I never have to reinvent or re-ask about this particular wheel.