Was working on sample game. Error found but cant locate. Platform: Informer6.33

Following is a program for 3 rooms. Initial room, Treasure room, Dragon room (As in instructables.) I find the key in Golden chest but I cant pick it. 2nd I meet the dragon but the dragon doesnt react well.
|| Please help me find the error in this following program.

Constant Headline "^A demo by ANJpunK^";
Constant No_score;
#Include "Parser";
#Include "VerbLib";
[Initialise;
print "^^This is a demo game written in Inform 6. Can you solve it ?^^";
location=InitialRoom;
move GoldKey to GoldenChest;
];
Include "Grammar";

object InitialRoom "Initial Room"
with
description "You are alone in a strange room.",
n_to TreasureRoom,
s_to WoodenDoor,
has light ;

Object -> WoodenDoor "wooden door"
with description "A big wooden door. It have a lock.",
name 'big' 'wooden' 'door' ,
when_closed "You can see a big wooden door, on the south. The door is
closed.",
when_open "The door is now open.",
door_to ExitRoom,
door_dir s_to,
with_key goldkey,
has static door openable lockable locked;

object TreasureRoom "TreasureRoom"
with
description "This room is quite the same as the previous one. You can go to the
initial room by walking in the south. There is an other room on the east.",
s_to InitialRoom,
e_to DragonRoom,
has light;

object DragonRoom "DragonRoom"
with
description "You can reach the Treasure room by walking on the west",
w_to TreasureRoom,
has light;

object SilverChest "Silver Chest"
with description "A beautiful silver chest.",
name 'silver' 'chest',
found_in TreasureRoom,
has static openable container;

object GoldenChest "Golden Chest"
with description "A beautiful Chest, made of Gold.",
name 'gold' 'golden' 'chest',
found_in TreasureRoom,
has static openable container;

object Goldkey "golden key"
with description "A small golden key.",
has female;

object ExitRoom "Exit Room"
with
description "You are free !",
has light ;

Object dragon "dragon"
with name 'red' 'dragon' 'animal',
description "A red dragon is standing here. He doesn't stop looking at you.",
initial "A red dragon is here.",
found_in DragonRoom,
life [ word1 word2;
Tell : print "The dragon doesn't listen you.^"; rtrue;
Attack : print "You should not. He can split fire.^"; rtrue ;
Kiss : print "Hmm..no.^";rtrue;
Answer , Ask :
word1 = noun;
word2 = second;
if (word1==33) {word1=word2;}
switch (word1) {
'hi', 'hello' : "~Hello, stranger.~";
'key', 'help' : "~The exit door is locked. To find the key, you must answer an
enigma. If you are ready, I can sing it.~";
'hi', 'hello' : "~Hello, stranger.~";
'door', 'exit', 'lock': "~Hmmm. I can help you to find the key.~";
'enigma', 'game' , 'song' : "~Here is the enigma : On the morning, it have four
legs. At noon, it have two legs; on the night ; it have three. What is it ?~";
'man', 'boy', 'girl', 'human', 'men', 'lady' : "~You found the solution of the enigma.
Congratulations ! The key is inside the golden Chest. Watch out, don't try to
open the other one !~^";
'solution' : "You must find the answer by yourself.";
default : print "No answer.^"; rtrue;
}
],
has animate static ; ```

The key has no name. I add the third line in and it can be picked up now.

object Goldkey "golden key"
with description "A small golden key.",
name 'key' 'golden' 'key',
has female;


I got responses out of the dragon:

Click here to see story transcript sample

This is a demo game written in Inform 6. Can you solve it ?

A demo by ANJpunK
Release 1 / Serial number 170719 / Inform v6.31 Library 6/11 S

Initial Room
You are alone in a strange room.

You can see a big wooden door, on the south. The door is closed.

>n

TreasureRoom
This room is quite the same as the previous one. You can go to the initial room by walking in the south. There is an other room on the east.

You can see a Golden Chest (which is closed) and a Silver Chest (which is closed) here.

>open golden
You open the Golden Chest, revealing a golden key.

>get key
Taken.

e

DragonRoom
You can reach the Treasure room by walking on the west

A red dragon is here.

>ask dragon about game
"Here is the enigma : On the morning, it have four legs. At noon, it have two legs; on the night ; it have three. What is it ?"

>man
That's not a verb I recognise.

>say man
(to the dragon)
"You found the solution of the enigma. Congratulations ! The key is inside the golden Chest. Watch out, don't try to open the other one !"

>n
You can't go that way.

>l

DragonRoom
You can reach the Treasure room by walking on the west

A red dragon is here.

>w

TreasureRoom

You can see a Golden Chest (which is empty) and a Silver Chest (which is closed) here.

>l

TreasureRoom
This room is quite the same as the previous one. You can go to the initial room by walking in the south. There is an other room on the east.

You can see a Golden Chest (which is empty) and a Silver Chest (which is closed) here.

>s

Initial Room

You can see a big wooden door, on the south. The door is closed.

>s
You can't, since the wooden door is in the way.

>open door
It seems to be locked.

>unlock door with key
You unlock the wooden door.

>s

Initial Room

You can see a big wooden door, on the south. The door is closed.

>s
You can't, since the wooden door is in the way.

>open door
You open the wooden door.

>s

Exit Room
You are free !

>


By the way,
Have you tried Inform 7?

It has an IDE and everything, and you can write in code that is basically comprised of English sentences.


The Golden Key is in the Golden Chest. the description is "A small golden key".

That's the entire code to set up the key.

Check out this link to the Inform 7 site's DOWNLOADS page if that sounds enticing.


Here's the game written in the Inform 7 format:


"a demo" by ANJpunK 


when play begins: say "This is a demo game written in Inform 6. Can you solve it ?".
Initial Room is a room. "You are alone in a strange room.[paragraph break]There is an exit on the north.[paragraph break]You can see a big wooden door, on the south. [line break]The wooden door is [if wooden door is closed]closed.[else]open.[end if]"


The Wooden Door is a closed locked openable door. wooden door is scenery. description is "A big wooden door. It is locked.".

Wooden door is south from initial.

The Treasure Room is a room."This room is quite the same as the previous one. [paragraph break]You can go to the
initial room by walking in the south. [line break]There is an other room on the east."
 Treasure room is north from initial.

The Golden Chest is closed openable container in treasure room. description is  "A beautiful Chest, made of Gold.".

The Golden Key is in Golden Chest. description is  "a small golden key".

the golden key unlocks the wooden door.

The Silver Chest is closed openable container in treasure room. description is "A beautiful silver chest".

Instead of opening Silver Chest, end the story saying "You open the silver chest, and a Grue pops out and kills you.[paragraph break]YOU HAVE DIED".

ExitRoom is a room. exitroom is south from wooden door.

After going to exitroom, end the story saying "You are free !".

DragonRoom is a room. "You can reach the Treasure room by walking on the west"

DragonRoom is east from treasure room. printed name of dragonroom is "Dragon Room".

Dragon is a person in dragonroom. description is "A red dragon is standing here. He doesn't stop looking at you.".

instead of asking dragon about something:
	if the player's command includes "key/help":
		say "'The exit door is locked. To find the key, you must answer an enigma. If you are ready, I can sing it.'";
	else if the player's command includes "hi/hello":
		say "'Hello, stranger.'";
	else if the player's command includes "enigma/game/song":
		say "'Here is the enigma : On the morning, it have four
legs. At noon, it have two legs; on the night ; it have three. What is it ?'";
		now player is riddled;
	else if the player's command includes "door/exit/lock":
		say "'Hmm... I can help you to find the key.'";
	else if the player's command includes "solution":
		say "'You must find the answer by yourself.'".

instead of asking dragon for something:
	if the player's command includes "key/help":
		say "'The exit door is locked. To find the key, you must answer an enigma. If you are ready, I can sing it.'";
	else if the player's command includes "hi/hello":
		say "'Hello, stranger.'";
	else if the player's command includes "enigma/game/song":
		say "'Here is the enigma : On the morning, it have four
legs. At noon, it have two legs; on the night ; it have three. What is it ?'";
		now player is riddled;
	else if the player's command includes "door/exit/lock":
		say "'Hmm... I can help you to find the key.'";
	else if the player's command includes "solution":
		say "'You must find the answer by yourself.'".

instead of telling dragon about something:
	say "The dragon doesn't listen to you."
		
A person can be riddled.

after reading a command when the player is riddled and dragon is in the location of the player:
	if the player's command includes "man/boy/girl/human/men/lady":
		say "'You found the solution of the enigma. Congratulations! The key is inside the golden Chest. Watch out, don't try to open the other one !'";
		now player is not riddled;
		reject the player's command;
	else:
		say "'That is incorrect.[paragraph break]'Would you like to stop trying to guess so you can do something else?'";
                    if player consents:
                        say "Okay. Just ask me about the enigma again if you want help.";
                        now player is not riddled;
                    else:
                        say "Okay. Keep guessing then.";
		reject the player's command.

instead of attacking dragon, say "You should not. He can split fire.".

instead of kissing dragon, say "Hmm..no.".

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums