Hello and Happy Thanksgiving all,
I’ve read up to chapter 7 in the Inform manual, and have been trying to get a better handle on the grammar rules. Every now and again I will try to implement some random example of either my own or the manual’s making in order to see if I’ve gotten a somewhat firm grip on what I just read.
I wrote this small bit in response to Chapter 7.13.
Lab is a room. The description of the Lab is "A pristine white lab, completely empty." East of the Lab is the Storage Room. Trolly is in the lab. Trolly is a vehicle. Instead of going to the Storage Room: if the player is not in a trolly, say "You can't enter there without a vehicle"; if the player is in a trolly begin; say "You roll faster than your average turtle, for all of a few boring seconds."; move trolly to the Storage Room; try looking; end if.
The idea is that I want to prevent the player from entering the Storage Room, unless he is in a vehicle. Which the code above does just fine. But, I feel what I wrote is a bit verbose, and there probably is a shorter way of accomplishing the same using some kind of negative modifier. For example,
Instead of going to the Storage Room in other than the Trolly: say, "You can't enter there without a vehicle."; Instead of going to the Storage Room: say "You roll faster than your average turtle, for all of a few boring seconds."; move trolly to the Storage Room; try looking;
Which, does not work. I suspect it is because there might not be such a negative modifier. But I could be wrong. If there is, I’m curious if there is one or if there is a more efficient way of writing what I wrote out.
On a side note, when I tried doing,
(the first code listed, up until the move line) try going east; // instead of move trolly to the Storage Room; (the rest)
I manage to bring up a bunch of errors in inform 7. Then I realized it was because my rule for “going to the Storage Room” was recursively calling itself. Is “Moving” a more conventional means of moving the player or would trying directions be more conventional?