Maybe something like this:
front yard is a room.
road is south of front yard.
car is enterable vehicle in front yard.
I’m using a check rule instead of before so that other before / instead rules
aren’t bypassed altogether… probably not necessary for this case, just
something I feel is a good habit.
Check going south from front yard when
the vehicle gone by is not the car:
The going action has several useful variables defined. From the Standard Rules:
The going action has a room called the room gone from (matched as "from").
The going action has an object called the room gone to (matched as "to").
The going action has an object called the door gone through (matched as "through").
The going action has an object called the vehicle gone by (matched as "by").
The going action has an object called the thing gone with (matched as "with").
So from front yard
is equivalent to when the room gone from is the front yard
. You can’t use that shorthand with a negative, i.e., you can’t say not by the car
, so I used when the vehicle gone by is not the car
. If there’s more than one possibility for the vehicle in the game, it’d be better to go with vehicle
like you had than to name the car
itself like I did.
if the car is in the front yard begin;
We make sure it’s really there so we don’t do something nonsensical!
silently try entering the car;
Try getting in, silently, to suppress the normal response.
if the holder of the player is the car begin;
Straightforward test that getting in succeeded: are we in the car?
say "(first entering the car)[line break]";
(Report the implicit entering car action.)
now the vehicle gone by is the car;
continue the action;
If we tried to continue the action without setting the vehicle gone by
, the “can’t travel in what’s not a vehicle rule” would end up stopping us. We could’ve said instead try going south
instead of now the vehicle gone by is the car; continue the action
. That would start over with a new going action that’d work this time: this check rule won’t run this time because we’re really in the car now.
end if;
end if;
instead say "You'll want a car to get on the road."
If the above didn’t work, we say the above and end this action in failure.
Altogether from the top for ease of cutting-pasting into borogove.app or whatever…
front yard is a room.
road is south of front yard.
car is enterable vehicle in front yard.
Check going south from front yard when the vehicle gone by is not the car:
if the car is in the front yard begin;
silently try entering the car;
if the holder of the player is the car begin;
say "(first entering the car)[line break]";
now the vehicle gone by is the car;
continue the action;
end if;
end if;
instead say "You'll want a car to get on the road."