Hey does anyone know how to modify the “get” command in Inform 7? I wrote a bit in a game where a player is supposed to be unable to “take” a roadkill armadillo unless they’re holding a spatula:
instead of taking the roadkill armadillo for the first time:
if player is holding spatula, say “You jam the spatula between the asphalt and the armadillo and expertly flip it into the air like a flapjack. Nice, looks like you got it unstuck! You pocket the now loose armadillo.”;
if player is holding spatula, now player is holding armadillo;
if player is not holding spatula, say “It’s stuck to the asphalt; you’re not getting it loose without some sort of implement.”
Since Inform seems to understand “take” and “get” as synonymous, I stupidly assumed modifying one would automatically modify the other. But I guess it doesn’t. Yet trying to code in “instead of getting armadillo…” or “understand ‘get’ as taking” just breaks the whole game. Is there a way to disable getting?
That instead rule doesn’t apply after the first attempt to get the armadillo. Subsequent attempts will succeed with or without the spatula.
I don’t know if this is the best way to approach it, but I think this works:
The roadkill armadillo can be stuck. The roadkill armadillo is stuck.
Check taking the roadkill armadillo when the roadkill armadillo is stuck:
if the player is holding the spatula:
say "You jam the spatula between the asphalt and the armadillo and expertly flip it into the air like a flapjack. Nice, looks like you got it unstuck!";
now the roadkill armadillo is not stuck;
otherwise:
say "It’s stuck to the asphalt; you’re not getting it loose without some sort of implement.” instead.
Hi Bitter Karella. I was able to complete your game without ever obtaining the spatula. At first I wasn’t able to pick up the armadillo, and then suddenly I was. There was no special message to tell me how I’d done it, just the usual “taken”. I replayed the game and discovered that I was able to pick it up while holding the stick. I assumed that this was the solution to the puzzle and that the spatula was a red herring.