Chapter 10: Physics: Substances, Ropes, Energy and Weight
10.10. Magic (Breaking the Laws of Physics)

Every previous section of this chapter have been about adding further realism constraints to Inform, to give it a more advanced understanding of physics (and chemistry). But Inform has plenty of physical laws built into it already, even if they are more mundane: inanimate objects do not spontaneously move or change, one solid object cannot pass through another, there are opaque barriers through which light cannot pass, and so on. These rules stop many attempted actions. (GO EAST - "The oak door is closed." GET EMERALD - "You can't, since the glass display case is in the way.")

In the real world, physics is not negotiable. ("Gravity: it's not just a good idea, it's the law.") But in stories, magic can sometimes happen, and in these examples procedural rules are used to waive selected rules built into Inform which in effect cancel certain physical laws in certain cases. Very many other magical tricks could be achieved: if you want to make a given command work despite realism constraints, try typing ACTIONS - a testing command which reveals what is happening behind the scenes - and then typing the command you want. This should reveal which named rule is stopping it: you can then try suspending that rule, and seeing if the effect now works.

* See Magic Words for ways to create new single-word spell commands


227
* Example  Transmutations
A machine that turns objects into other, similar objects.

WI
216
* Example  Magneto's Revenge
Kitty Pryde of the X-Men is able to reach through solid objects, so we might implement her with special powers that the player does not have...

WI
390
* Example  Access All Areas
The Pointy Hat of Liminal Transgression allows its wearer to walk clean through closed doors.

WI
224
* Example  Interrogation
A wand which, when waved, reveals the concealed items carried by people the player can see.

WI

"Interrogation"

The X-Ray Vision Wand is carried by the player.

Instead of waving the X-Ray Vision Wand:
    say "Disappointingly, nothing happens."

Instead of waving the X-Ray Vision Wand when the player can see someone who is concealing something:
    say "The wand glows green. Immediately you see on the monitor [a list of things which are concealed by people who can be seen by the player]."

After printing the name of a thing (called target) which is carried by someone while waving the wand:
    say " (carried by [a random person who carries the target])"

The Interrogation Chamber is a room. "Despite its gothic name, this room is a rather civilized place for your work, with large plate-glass windows and a fitted carpet."

A thing can be secret or obvious. A thing is usually obvious.

Brian is in the Interrogation Chamber."Brian lounges against the wall." Brian carries a quantity of plastic explosive. The explosive is secret.

Janine is in the Interrogation Chamber. "Janine toys nervously with a laptop bag." Janine carries a chocolate biscuit, a laptop bag, and a microfilm. The microfilm is secret. The laptop bag is wearable. In the bag is a laptop computer.

Rule for deciding the concealed possessions of something: if the particular possession is secret, yes; otherwise no.

Instead of examining someone: say "[The noun] is openly carrying [a list of unconcealed things carried by the noun]."

Test me with "wave wand / examine janine / examine brian".


PreviousContentsNext