If/Begin/End If problem - please help!

Hi,
First of all this is my first post on this forum and I am a relatively new I7 user, so bear with me.

I am making a pretty simple(or atleast I think) conversation system. An NPC can have 4 different emotions “towards the player”(neutral, happy, mad, sad). Depending on the emotion(and in the case of my current NPC, whether it considers the player “noble enough”), and possibly other things(like if the player has done something) there will be a different response. Simple, eh?

Well, my problem is I get this error-

Here is my source(some things not having to do with the conversation are summed up so you can just paste it directly into I7)-

[code]
A person can be happy, mad, sad, or neutral.

The Gazebo is a room. Nobleman’s Robes being worn by the Player.

The Nobleman is a person in the Gazebo. The Nobleman is neutral.

After asking the Nobleman about [weather]:
if player is not wearing Nobleman’s Robes begin;
say “‘Ha! Me talk to a simpleton like you?’”.;
Now the Nobleman is mad.;
otherwise;
if Nobleman is neutral, say “‘It seems good.’”;
if Nobleman is happy, say “‘The weather is great!’”;
if Nobleman is mad, say “He seems to be ignoring you.”;
if Nobleman is sad, say “‘Horrible.’”;
end if.

After asking the Nobleman about [ugliness]:
if player is not wearing Nobleman’s Robes begin;
say “‘Why would I talk with YOU about THAT?’”.;
Now the Nobleman is mad.;
otherwise;
if Nobleman is neutral begin;
say “‘Are you saying I am ugly?’”;
Now the Nobleman is sad.;
end if.
if Nobleman is happy begin;
say “‘What is that supposed to mean?’”;
Now the Nobleman is neutral.;
end if.
if Nobleman is mad, say “He seems to be ignoring you.”;
if Nobleman is sad begin;
say “‘How dare you?’”;
Now the Nobleman is mad.;
end if.
end if.[/code]

I don’t know what is wrong, though I think there must be a more efficient way to do all the above.

Thanks ahead of time,

BRW<

You’re running into trouble nesting your if-statements.

The more efficient way to deal with this is to use a series of “otherwise if” constructs. The following compiles and (I think) does what you want:

[code]A person can be happy, mad, sad, or neutral.

The Gazebo is a room. Nobleman’s Robes are worn by the Player.

The Nobleman is a person in the Gazebo. The Nobleman is neutral.

After asking the Nobleman about “weather”:
if player is not wearing Nobleman’s Robes begin;
say “‘Ha! Me talk to a simpleton like you?’”;
Now the Nobleman is mad;
otherwise;
if Nobleman is neutral, say “‘It seems good.’”;
if Nobleman is happy, say “‘The weather is great!’”;
if Nobleman is mad, say “He seems to be ignoring you.”;
if Nobleman is sad, say “‘Horrible.’”;
end if.

After asking the Nobleman about “ugliness”:
if player is not wearing Nobleman’s Robes begin;
say “‘Why would I talk with YOU about THAT?’”.;
Now the Nobleman is mad;
otherwise if Nobleman is neutral;
say “‘Are you saying I am ugly?’”;
Now the Nobleman is sad.;
otherwise if Nobleman is happy;
say “‘What is that supposed to mean?’”;
Now the Nobleman is neutral.;
otherwise if Nobleman is mad;
say “He seems to be ignoring you.”;
otherwise if Nobleman is sad;
say “‘How dare you?’”;
Now the Nobleman is mad;
end if.[/code]

Works great!

Thanks very much,

BRW<