Every turn during Prologue:
if the protagonist is in the Palace Gate:
if Broad Walk is unvisited or if Flower Walk is unvisited:
...
The idea here is that if either the Broad Walk *or* the Flower Walk
has not been visited when this condition is run, a prompt to the
player will be displayed. If either has been visited, then this prompt
should not display since the player has at least moved around a bit.
However, the code above gives an error about how the condition, as
stated, couldn't be broken down into smaller conditions. What I have
there seems logical to me but I'm clearly missing how to do this in a
way that isn't programmatically verbose.
Any ideas?
- Jeff
It's very simple: you have written one "if" too many. :) Just take out
the "if" before "Flower Walk" and everything will work.
Regards,
Victor
Thanks, Victor. I did try that originally. The problem is that if I
remove the second "if", while it does compile, the condition actually
isn't checked. Meaning, the my response text will print *even if* the
Broad Walk or Flower Walk is visited.
If I just leave one condition in, the logic works as expected.
So originally I thought that was because it wasn't recognizing the
second clause ("Flower Walk is unvisited") as an if condition, which
is why I put in the second "if" term. I should have indicated that in
my original post.
- Jeff
I'm not sure I understand the problem? The behaviour you describe here
is the expected behaviour: your response text should print even if the
Broad Walk or the Flower Walk is visited, it just shouldn't print when
they are _both_ visited. Thus, this program works as expected:
==============
"Visitation" by Victor Gijsbers
The Church is a room. The player is in The Church.
The Chapel is west of the Church. The Graveyard is east of the Church.
Every turn:
if the Chapel is unvisited or the Graveyard is unvisited:
say "There is still a location you have not visited!".
===============
If you want the description to be printed only when _neither_ of the
locations is visited, you need to write this:
=============
"Visitation" by Victor Gijsbers
The Church is a room. The player is in The Church.
The Chapel is west of the Church. The Graveyard is east of the Church.
Every turn:
if the Chapel is unvisited and the Graveyard is unvisited:
say "There are still two locations you have not visited!".
==============
Notice the "and" instead of "or" in the second program. Both programs
work for me.
Kind regards,
Victor
> If you want the description to be printed only when _neither_ of the
> locations is visited, you need to write this:
Correct, indeed, Victor.
I wasn't thinking it through correctly. Basically the idea is that if
neither the Broad Walk nor the Flower Walk have been visited, a "scene
prod" should occur. If one or both has been visited, no such scene
prod should occur.
Thanks for the assist and jump-starting my brain.
- Jeff