"it is against the rules to try to use it"

I’m getting a runtime error every time I use SHOWME in my project.

It says the room I’m in (wherever I happen to be standing when I type SHOWME (anything)) “is not allowed to have the property wetness, so it is against the rules to try to use it”. If I stand in a room that is of the type which can and does have a wetness, I don’t get the error.

I don’t get why/how it’s referencing wetness in rooms that definitionally cannot have them.

The following code unfortunately does not reproduce the error in a new project, but sets up the base elements that lead to it. I’m just hoping someone can see something troubling, or that could be tighter, at this fundamental level, or can anticipate what problem thing I’ve done, before I go exploring all over the place:

a waterhole is a kind of room.

A waterhole can be brackish, murky, fresh (this is its wetness property).
A waterhole is usually fresh.

dry spot is a room.

wet spot is a waterhole. wet spot is east of dry spot.

test me with "showme me/e/showme me".

So imagine if you stood in dry spot, typed ‘SHOWME ME’, and it said '** Run-time problem P10: Since Dry Spot is not allowed the property “wetness”, it is against the rules to try to use it."* … but the error didn’t occur if you did that in wet spot. That’s the problem I’m having.

Thanks much to anyone with input.

-Wade

I can reproduce with the following:

a waterhole is a kind of room.

A waterhole can be brackish, murky, fresh (this is its wetness property).
A waterhole is usually fresh.

dry spot is a room.

wet spot is a waterhole. wet spot is east of dry spot.

The pond is in wet spot. 

The description of a thing is usually "[wet description of the item described]".

To say wet description of (item - a thing):
	if the item is in a waterhole:
		say "[The item] is in a [wetness of the location] place.";
	otherwise:
		say "[The item] is in a dry place."

test me with "showme pond/e/showme pond".

I believe a variation of the above is the most likely cause: you’re accidentally using “the location” to mean “the location of (something)”. It works during gameplay because the player is probably always in the same location as the thing that’s being checked in the rule that’s causing this.

You can narrow it down further by checking where the error message is shown. In the above example it’s

description: "The pond is in a 
*** Run-time problem P10: Since dry spot is not allowed the property "wetness", it is against the rules to try to use it.

<illegal wetness> place.

so the problem is with the item’s description. Or just scan the code for anything that uses wetness and the location in the same rule.

2 Likes

Probably not helpful but could you try
A room can be brackish, murky, fresh, or unwet (this is its wetness property). A room is usually unwet. A waterhole is usually fresh.

1 Like

@HanonO , I figure that in the beginning, the reason I made this a class of room, as opposed to doing it your way, was so that not all rooms had to have this flag. But doing it the way I’ve done it seems to invite the kind of problems Juhana has now helped me with.

So @Juhana, yes, your example helped me find the problem. To continue with your pond example, I had a line like:

Understand “weir” as pond when the location is murky.

The presence of this line in the source causes SHOWME to give the runtime errors.

I don’t have that many rooms that are brackish, murky, fresh, etc. So maybe a better way to do this is to use a ‘To decide’ phrase. Or just restructure with Hanon’s idea.

Thanks!

-Wade

1 Like

It’s a bit wordy, but you can also do

Understand “weir” as pond when the location provides the property wetness and the location is murky.

Another thing is that if you can ever look into a room that you’re not in, you’d want “location of the item described” rather than just “location.” If the player can refer to a pond in another room, you want to evaluate whether “weir” works based on the location of the pond rather than the location of the player.