AGT Programming (2) - Death When a player dies in an AGT adventure, it's easy to program in an option for him to be resurrected. However, there are drawbacks to this. The player is merely moved to a particular room, designated as the 'resurrection room' by the programmer (the default is the start location), still carrying/wearing all the objects he had when he died, which may be inconvenient. No flags, variables or counters seem to be reset or zeroed so if the player had previously moved through a one-way, flag-controlled exit, for example, and died on the opposite side, he may not be able to get back there. When programming Oklib's Revenge, the resurrection option caused me all sorts of problems. The idea of just killing the player and chucking him out of the game is very unfriendly so I worked out a 'death room' option. When the player dies in Oklib, he is moved to the 'death room' (I made it ROOM 100 so it was easy to remember). The room has no exits and the only commands permitted in there are RESTORE and QUIT. Add something similar to this to your .DAT file: ROOM 100 Oh Dear! END_ROOM ROOM_DESCR 100 You appear to be dead. All you can do now is RESTORE a saved game or QUIT. END_ROOM_DESCR Say you've written an SF adventure. In it, if the player moves NORTH in a certain location, not wearing a disguise of some sort, accompanied by his loyal robot and carrying a bomb which he is intending to drop on the bridge of an alien vessel to destroy the ship's computer, the lack of the disguise alerts the aliens that he isn't one of them. Put the following in your .CMD file:- COMMAND NORTH AtLocation 97 (* by entrance to ship's bridge *) NOT IsWearing 205 (* disguise *) IsCarrying 210 (* bomb *) CounterGT 3 1 (* bomb is ticking *) PrintMessage 12 (* discovered! *) BlankLine PrintMessage 17 (* Greebles take over the world *) BlankLine RemoveEverything DropEverything Destroy 302 (* your faithful robot *) TurnCounterOFF 3 (* bomb *) GoToRoom 100 (* dead *) DoneWithTurn END_COMMAND You'll have to destroy the robot and reset the bomb counter otherwise any messages relating to these will still be printed after entering the 'death room' eg 'Fred the robot trundles behind you.' and 'The bomb continues its countdown.'. I also REMOVE and DROP everything to be on the safe side but I'm sure it isn't necessary! Now add the relevant messages. MESSAGE 12 The Greebles look up from their computers and control panels as you enter. "An intruder!", one burbles. The others cheer and slither towards you. You see their stalked eyes light up at the thought of taking a prisoner - you! END_MESSAGE MESSAGE 17 You've failed. The Greebles take over Earth. The rest of the Federation falls soon after. END_MESSAGE Remember to tell the player in the introduction or at the start of the game to SAVE his position as soon as possible, otherwise if he dies he won't be able to RESTORE. Sue