Inform keeps replacing an action I want to create with a default that I can't seem to replace

I’m trying to create an action where you clean up a pool of blood (which I have set as an object). This action is supposed to give you some flavor text, and then remove the pool of blood from the room.

This is the code I have relating to this:

Instead of cleaning something:
say “You scrub and scrub at the floor, making sure to clean up every last drop of blood from the cracks in the floor. It wouldn’t be good if the police found it- even though the DNA in it belongs to someone who died almost twenty years ago.”;
now the pool of blood is in Elsewhere.

Inform keeps giving me an error of “You wrote ‘Instead of cleaning something’ , which seems to introduce a rule taking effect only ‘cleaning something’. But this does not look like an action, since there is no sign of a participle ending ‘-ing’ (as in ‘taking the brick’, say) - which makes me think I have badly misunderstood what you intended.”

Seems like the thing I need to do is to add a “cleaning” action, but for some reason there is already one in as a default, and I cannot figure out how to replace it.

When I do what should replace it, it just gives me the same error, and if I get rid of all related code entirely, cleaning the pool of blood just ends with the text “You rub the pool of blood” and nothing happening.

Help?

Cleaning is a synonym for rubbing in the standard rules.

So you could say

instead of rubbing:
	say "something to say";
	now the pool of blood is in elsewhere.

Note that saying “rubbing something” is redundant because something is already part of the definition of rubbing. If you have a specific noun in mind, you can use it instead.

Verb definitions and synonyms are listed in the “Commands” section of the “Actions” index.

If you really want to get rid of rubbing, you can redefine clean.

Understand the command "clean" as something new

But unless something is broken It’s not worth the hassle changing defaults (and keeping track of those changes)

5 Likes

When the player types CLEAN FOO, the default action Inform associates that command with is the rubbing action (you can test this with the ACTIONS debugging command, which is super useful for seeing how the game is actually parsing your input). So you can either engage with the rules associated with the rubbing action (so change to “instead of rubbing something…”), or use the line:

Understand the command “clean” as something new.

And then you can define your new cleaning action with Understand “clean [something]” as cleaning.”, and it should work.

Edit: ninja’d!

2 Likes

You’ll definitely want to use a more specific rule, because it will display that message any time you clean anything in any place, even after the pool of blood has been removed.

1 Like

The reason I am specifying “something” is because I actually wanted to specify that that specific thing only happens when you try to clean this specific pool of blood. I will test this out and tell you if it worked!

1 Like

I changed it back to that pool of blood- that was just leftover from one of the other solutions I tried.

This worked! I do not have need for a different action entirely- it works fine as is for my purposes, because anything like that the characters will have to clean is going to have a custom description, so i can just use this same concept now that I understand how it works.

1 Like

You can use the ACTIONS testing command to see what Inform thinks about a particular phrasing. Type ACTIONS, then CLEAN BLOOD, and it’ll tell you that it understood that as “rubbing”.