Issues with turn and turn on

In my game I have a valve which is a device.

Turn off valve and turn on valve work fine as they should, but I’d also like the player to be able to type 'turn valve".

So something like understand ‘turn valve’ as turn on valve (if valve is switched off) or turn off valve (if valve is switched on).

I’m unclear what ‘turn’ normally does, is it the same as twist? It just returns ‘that’s fixed in place’ if you type ‘turn valve’.

Am confused!

The Index explains that the turning action is normally for twisting stuff:

Turning is the act of rotating something - say, a dial.
In the Standard Rules there are no carry out rules for this action because nothing in the standard Inform world model which reacts to it. The action is provided for authors to hang more interesting behaviour onto for special cases: say, turning a capstan.

You can easily redirect ‘turning the valve’ to ‘turning the valve off and on,’ but the action for ‘turning [off or on]’ is ‘switch.’ Like so:

Instead of turning the valve:
	if the valve is switched off:
		try switching on the valve;
	otherwise:
		try switching off the valve.
4 Likes

Perfect, thank you, I’d got myself stupidly confused!