I have the following code, and I’m not sure why it doesn’t work:
A cloak is a wearable thing. The description of the cloak is “[The player] USE this cloak to sneak around at night undetected.” The cloak is on Levalia’s bed.
[the bed is an enterable scenery supporter that has nothing to do with this particular piece of code]
A person can be visible or invisible.
last carry out using the cloak:
now the player is invisible.
[using is a new action I created; that can be disregarded as well]
Book - some scratch testing
A guard is a kind of targetable person. Understand “guard” as a guard. The printed name of a guard is usually “GUARD”. A guard is privately-named. The indefinite article of a guard is “a”.
[targetable is also a new property, as created by this extension called Basic Combat by B David Paulsen]
G1 is a guard in Wkitch.
Check going to EKitch:
if the guard is not dead and the player is visible:
say “[The g1] stands in your way.”;
the rule fails;
continue the action.[/code]
The issue I have is that even if I’m wearing the cloak (making me invisible), the guard still stands in my way. If I replace “the player is visible” with “the player is not wearing the cloak”, it works fine. I just would like to understand why using visible/invisible properties won’t work.
The second issue I have is one that I’ve had for a long time, and I think it’s time I finally get it tackled. When printing the paragraph about the guard, the parser says “You can see GUARD here”. Obviously, I want it to say “You can see a GUARD here.” (there’s no issue if there’s two guards in the room). I’m 100% sure I have some misconception about how to properly use “The indefinite article of… is…”, or if it’s even appropriate in this regard.