Hi, Im new to inform 7 only been trying a couple of days now. I
ve looked online and cant find an answer even on the inform documentation and I just don
t get it. Ive got a piggy bank made of china with a key inside. I want to smash piggy bank so that you can pick the key up but I can
t work out how to make the command for smash
and get it to work. Any help apparated.
Some shards of china are nowhere. A small silver key is nowhere.
Instead of attacking the piggy bank:
say "CRASH! The piggy bank shatters!";
move the shards to the holder of the piggy bank;
move the key to the holder of the piggy bank;
remove the piggy bank from play.
Test me with "smash piggy bank / look / take key".
Thanks Daniel, works apart from one little problem. The piggy bank is in a cupboard so I pick it up smash in when in my inventory, there is nothing on the floor but the key and shards of china appear in my inventory ?
Fiddled round with a few things but I still can`t get anywhere.
“Holder of the piggy bank” means that the shards and the key will appear in whatever container or place the piggy bank was in:
If you want the shards and key to appear on the floor instead, you could replace “holder of the piggy bank” with “location” (which means the room where the player currently is).
That works perfectly. But could I ask one more question. I`ve been using if statements no problem e.g. “A solid steel chain with a padlock [if chained is true]which is wrapped around you ankle and locked.[otherwise]no use at all.”
If there is an exit north or a wardrobe in room how do I prevent leaving room or getting to wardrobe unless padlock is unlocked and how do I change chained to false after padlock is unlocked ? Cheers.
For the last part, you can just check if the padlock is unlocked instead of having a separate chained
boolean.
You can:
- establish certain actions as
chain-prevented
and make sure the player can’t do them when the padlock is locked - use
instead of opening the wardrobe when the padlock is locked
- use
check opening the wardrobe
…if the padlock is locked: stop the action;