Enemy blocking your way to the next room.

I remember when I read about doors, I could stop the player from going into the next room by placing the door en between the rooms and making it locked.

Kitchen   <---- (Locked Door) -----> Living Room

However I have not been able to read anything about an enemy blocking your way.

Since the idea is that you will have to fight the enemy, how do I have to define my enemy to be able to block my way?

Thanks for the help
Max

Write an instead rule that stops the player from going somewhere as long as the enemy is in the room.

Instead of going north from the antechamber when the enemy is in the antechamber: or something like it.

Mmm… I see the logic, but unfortunately is not working for me. There is no error when compiling, but I am still able to go south. Here is the code:

[code][South Entrance to the Forest]

South Entrance to the Forest is south of Kanemitsu. “[if unvisited]Here is one of the entrances to the Kanemitsu Forest. This forest is special since most of the wood here carries some kind of special property that allows you to awaken your kata. It is believed that this was once the scene of a gran magical battle, and the energy release during that event, was stored on the roots of the surviving trees. Years later, the wood born from new trees had that special property. [paragraph break][end if]Right now, nothing interesting can be seen here. The corridor in between plants and trees goes to north or south. [if Carni Plant is in South Entrance to the Forest]Unfortunately, a strange plant is blocking your way to the south. You believe this is a Carni Plant.[end if]”

A Carni Plant is in South Entrance to the Forest. Carni Plant is an animal. The description of the Carni Plant is “Carni Plants are very aggressive if pushed or attacked. Normally you would mind bothering this plant, however this specific carni plant has decided to stay in the middle of the passage blocking your way to the south.”

Instead of going south from the South Entrance to the Forest when Carni Plant is in South Entrance to the Forest:
say “Unfortunately, the Carni Plant is blocking my way. If I get too close, I will have to fight it.”
[/code]

Also there is no mention of the “say” when going south. What am I missing?

It’s having trouble with your room name, I believe. I replaced all instances of “South Entrance to the Forest” with something else, and it works properly:

[code]“Sample Game” by Somebody

Kanemitsu is a room.

WHAT is south of Kanemitsu. “[if unvisited]Here is one of the entrances to the Kanemitsu Forest. This forest is special since most of the wood here carries some kind of special property that allows you to awaken your kata. It is believed that this was once the scene of a gran magical battle, and the energy release during that event, was stored on the roots of the surviving trees. Years later, the wood born from new trees had that special property. [paragraph break][end if]Right now, nothing interesting can be seen here. The corridor in between plants and trees goes to north or south. [if Carni Plant is in WHAT]Unfortunately, a strange plant is blocking your way to the south. You believe this is a Carni Plant.[end if]”

Test is south of WHAT.

A Carni Plant is in WHAT. Carni Plant is an animal. The description of the Carni Plant is “Carni Plants are very aggressive if pushed or attacked. Normally you would mind bothering this plant, however this specific carni plant has decided to stay in the middle of the passage blocking your way to the south.”

Instead of going south from WHAT when Carni Plant is in WHAT:
say “Unfortunately, the Carni Plant is blocking my way. If I get too close, I will have to fight it.”

Test me with “s / s”[/code]

You could fix the issue by naming the room South-Entrance-to-the-Forest and doing this:

Rule for printing the name of South-Entrance-to-the-Forest: say "South Entrance to the Forest"

I’m going to guess that the word “to” is the culprit – “to” has a specific meaning in rules for going, so it’s interpreting “Instead of going south from the South Entrance to the Forest” as something like “Instead of going south from the South Entrance when the room gone to is The Forest.” And, depending on what other rooms you’ve defined, “south entrance” and “the forest” might both be being interpreted as the room you’ve dubbed “South Entrance to the Forest” (since Inform allows you to use parts of names in the code, so you can define an object called “the mysterious shimmering doorknob” and then refer to it later in your source code as “the doorknob”).

Ok, so it was the name of the room. However I am still not quite done unfortunately.

Now I get blocked by the enemy, but instead of the text in the “say” I am getting the standard “you cant go that way”

This is how it was changed:

[code][South Entrance to the Forest]

South Forest is south of Kanemitsu. “[if unvisited]Here is one of the entrances to the Kanemitsu Forest. This forest is special since most of the wood here carries some kind of special property that allows you to awaken your kata. It is believed that this was once the scene of a gran magical battle, and the energy released during that event, was stored on the roots of the surviving trees. Years later, the wood born from new trees had that special property. [paragraph break][end if]Right now, nothing interesting can be seen here. The corridor in between plants and trees goes to north or south. [if Carni Plant is in South Forest]Unfortunately, a strange plant is blocking your way to the south. You believe this is a Carni Plant.[end if]”

A Carni Plant is in South Forest. Carni Plant is an animal. The description of the Carni Plant is “Carni Plants are very aggressive if pushed or attacked. Normally you would mind bothering this plant, however this specific carni plant has decided to stay in the middle of the passage blocking your way to the south.”

Instead of going south from South Forest when Carni Plant is in South Forest:
say “Unfortunately, the Carni Plant is blocking my way. If I get too close, I will have to fight it.”[/code]

Wouldn’t the say “…” override the default “you cant go that way”?

Also, when I kill the enemy, it would still not let me through.

This may seem like a dumb question, but have you implemented the room that’s south of South Forest?

Disregard my last post. I found that I broke the map when replaced the name. I was getting the You can’t go that way message because there was no room linked to South Forest.

I was able to catch it with the Map created on the Index information. Once I fixed that, everything worked well.

Thanks for everybody’s help!!!