In my game I need to create a Bomb which can be diffused when the player types in a certain code. The bomb is in an aircraft (which is coded as a vehicle) in a hangar( coded as a room). I do not know how to design the bomb in such a way that he can diffuse it. Any suggestions >
What system are you writing with?
Inform 7
You could start by having a look at example 287 in the Inform Recipe Book, although it’s about entering a code to safe, not to a bomb, but it’s close enough.
(To find this, go to the Documentation tab and look for the “Numerical Index of Examples” - or search for “spin safe”)
You never said what makes your bomb go off - a timer? Some event? Either way, instead of “now the safe is open”… you’ll need to somehow stop the bomb from going off.
It is a bomb with a code. The persons objective is to type the code in so the bomb goes off. Ill try the safe thing. Is there any other way though ?
I’m sure there is, but if you want more specific suggestions you’ll need to give us a bit more to go on. The safe example, mutatis mutandis, really looks like the natural way to implement that.
Ps. What the player needs to do is “defuse” the bomb, not “diffuse” it. The bomb will eventually diffuse itself (and everything nearby) just fine on its own.
If you would like the player to actually type in the code directly, there are two ways I can think to do it.
The first and easiest is the already mentioned “safe” method. Note that that the safe example in the handbook only works if your code is a number. You will have to modify it a little if you also want letters in the code.
Second (and also more complicated) is to “hijack” the command line to make it become an “enter the code” prompt. For example, the player could issue the command “defuse bomb” and the command prompt will change to ask for the code. The player would then enter the code directly on the prompt without having to use a command like “defuse with xxxx.”
I believe the second method looks more “professional” in a manner of speaking, but in practice it’s not that different.