Testing commands for managing blindness not working

I’m working on a game where the player starts off blind, and then, after a short scene, gains the ability to see. (That sounds weird, but I couldn’t think of a better way to phrase it.) I’ve got looking rules and examining rules down (I think, I’ve tested most of it but the problem is occurring while I attempt to test the rest of the details). I’ve been trying to create two testing actions: turning blindness on, turning blindness off, and blindness-checking. First, here’s the code for my “To decide whether we are blind” and “To decide whether we can see” rules, because they’re used in all three actions:

To decide whether we are blind:
if yourself is blind, yes;
no.

To decide whether we can see:
if yourself is blind, no;
yes.

And here’s what each action does/should do, the code I have for it, and how it’s working (NOTE: I didn’t include “blindness on” and “blindness off” and “turn blindness on” and “turn blindness off” for turning blindness on and off respectively because that was causing issues):

Turning blindness on. This one makes use of my phrase “make the player blind”. The code for that is as follows:

To make the player blind:
now the you-can-also-see rule response (D) is "[regarding the player][can] also [sense] ";
now the you-can-also-see rule response (E) is "[regarding the player][can] [sense] ";
now yourself is blind.

(To sense is a verb in my game, and yourself can be “seeing” or “blind”. It has to be yourself because the player is a variable, and I don’t intend to have it change throughout the game.)
The code for the action itself:


Check turning blindness on (this is the can't turn blindness on if we are already blind rule):
if we are blind, say "You're already blind!" instead.

Carry out turning blindness on (this is the turning on blindness rule):
give the player sight.

Report turning blindness on (this is the standard report turning blindness on rule):
say "Blindness is now on."

It seems to work. Since the player is blind at the beginning of the game, when I type in “make me blind”, I get “You’re already blind!”

Turning blindness off. This action uses my “give the player sight” phrase:

To give the player sight:
now the you-can-also-see rule response (D) is "[regarding the player][can] also see (see! [We] [can] SEE!) ";
now the you-can-also-see rule response (E) is "[regarding the player][can] see (see! [We] [can] SEE!) ";
now yourself is seeing.

The action’s code:

Turning blindness off is an action out of world. Understand "give me/yourself/us/myself sight" or "give the/-- player sight" or "make me/yourself/us/myself see" or "make the/-- player see" or "allow me/yourself/us/myself to/-- see" or "allow the/-- player to/-- see" as turning blindness off. Understand the command "let" as "allow".

Check turning blindness off (this is the can't turn blindness off if we aren't blind rule):
if we can see, say "You can already see!" instead.

Carry out turning blindness off (this is the turning off blindness rule):
make the player blind.
	
Report turning blindness off (this is the standard report turning blindness off rule):
say "Blindness is now off."

(There are a lot more ways to phrase this because, well, there are simply a lot more ways to phrase it.)
This action is causing issues. When I type in “give me sight”, it says “Blindness is now off.” This appears to be working right, but it’s not. When I type the same thing in again (to test my Check rule), it says the same thing. And when I try my blindness-checking action (see below), it says “You are currently blind.” Plus, when I try looking after using this, it says “You can sense” when it should be saying “you can see.” So something must be going wrong with either my “To decide if we can see” rule or my “give the player sight” phrase. I don’t think it could be going wrong with the action itself, since it just calls those two things.

Blindness-checking. This action is quite simple:

Blindness-checking is an action out of world. Understand "am i blind" or "check blindness/blind" or "blindness-check" or "blind-check" or "is the/-- player blind" or "are we/you blind" as blindness-checking.

Carry out blindness-checking (this is the checking blindness rule):
say "You are [if we can see]not [end if]currently blind."

I’m not sure whether this is working or not. It says “You are currently blind” whether I’ve just used the turning blindness off action or not, but since there are problems with that action, I’m not sure.

If anyone can help me try to fix this, that would be awesome! Thank you!

Use Markdown: three ``` backticks before and after code blocks is the best way to format it. I’ve fixed your post. :slight_smile:

1 Like

I might be reading it wrong, but if you want to turn off blindness, wouldn’t you want to say

Carry out turning blindness off (this is the turning off blindness rule):
    give the player sight.

Above, instead, your code says

Carry out turning blindness off (this is the turning off blindness rule):
    make the player blind.

Similarly, for turning on blindness, your code has–

Carry out turning blindness on (this is the turning on blindness rule):
    give the player sight.

When it should probably be–

Carry out turning blindness on (this is the turning on blindness rule):
    make the player blind.

Forgive me for sticking my nose in, if I am wrong.

2 Likes

@Dannii Thank you! I didn’t know that.

@EpicIFer Oh… ah… silly me. facepalms I fixed it! Wooooo!

>blind-check
You are currently blind.

>make me blind
You're already blind!

>give me sight
Blindness is now off.

>g
You can already see!

>blind-check
You are not currently blind.

>make me blind
Blindness is now on.

>g
You're already blind!

>blind-check
You are currently blind.
2 Likes

I know the feeling! Done that many times!

One example-- in my game Bullhockey!, I once had a single line of code–

Instead of doing anything to the computer, try examining the computer.

I missed this line during subsequent edits, and my testers missed the error because they didn’t try anything with the computer (which was just scenery and a prop). It wasn’t touched until after I entered the game into IFComp 2018(!). Players started complaining that the game crashed when they tried to EXAMINE COMPUTER, etc. It was that innocent looking line that caused a ‘stack overflow error’. The compiler didn’t catch it because you can write stuff like

Instead of doing anything to the computer, say 'It's not good to mess with stuff you don't understand.'

Correcting it was the first edit I made to a game during a Comp.

I’m glad you got it worked out!

2 Likes