am i going insane or just a moron?

I’m new to this and I’m having a problem. I type:

Kicking is an action applying to things. Understand "kick[something]" as kicking.

And it returns the error: you wrote ‘understand “kick [something]” as kicking’ but understand as should be followed by a meaning. I’ve also tried adding kicking, punching, and hitting as behaviours and that also screws up. How is this any different from the examples? Aaaaaargh

Try “one thing” instead of “things.” Edit: Huh, no, tried “things” in my code and it compiled. Is there a space between “kick” and “[something]”? Edit: Ha ha, no, tried that and it compiled too. I had no idea Inform was this forgiving about things. One sec.

Okay. Yeah. I just pasted your code into a fresh new source with one room and one rock (for kicking) and it compiled fine. So the good news is, you are going insane.

I have already tried both of those things and it still fails.

Two things to try at this point:

  1. Copy-paste your code and the error message here exactly as they are. In the first post the code says “kick[something]” (without space) and the error message says “kick [something]” (with space) which means that you re-typed both or either one of them here, possibly fixing a typo you originally had. Or…

  2. When you get the error message, click on the orange arrow button next to it. It’ll show the spot in the source code that throws the error. It’s possible that the error is somewhere else in the code where you maybe duplicated the code by mistake.

Could one possible solution be that “kicking” is already declared somewhere else? In an extension? In the code itself?

I am having a similar problem. I am trying to make an action that allows the player to throw something a direction, but no matter how I word it, the compiler throws the same error:

Here is what I currently have

[code]Throwing it to is an action applying to one thing and one visible thing. Understand “Throw [something] to [a direction]” as throwing it to.

instead of Throwing it to:
If the noun is a smoke grenade:
Let further place be the room second noun of the location;
If further place is not nothing:
Say “You chuck a grenade [second noun], filling the further chamber with smoke.”;
Now the further place is dark;
Now the further place is smoky;
Record “throwing a grenade” as achieved;
Remove the noun from play;
Stop the action;
continue the action

[/code]

But it throws this

I have tried ‘throwing it directionally’ ‘throwing it a way’ and others, but always receive some version of the above.

But this rule works

Check throwing it to: Abide by the block throwing at rule;

EDIT Changing it to a check rule works for some reason.

Yeah, there’s some funkiness in the syntax there. Instead of throwing'' (without theit to’’) should work.

Try “instead of throwing something to”. Inform expects a noun there.

EDIT: This is preferable to eu’s only in that it won’t conflict with a separate “throwing” action if you have one.

Good point. Though be careful using the ``something’’ form with actions not applying to things.

Also, if you don’t see the problem fixed when the next build is out, please report it as a bug.

I do have a separate throwing action, that’s one of the things.

I’m not an expert, but here are the things that look problematic to me:

  1. It says “let further place be the room second noun of the location” but I’m pretty sure you want “the room second noun FROM the location”.

  2. Stopping the action is equivalent to failing the rule, which for an instead rule means the action as a whole fails, but the rest of the logic implies a successful action. That might matter if you later want to check on successful past actions.

  3. There is a big difference between instead rules and check rules. Check rules are bound to a specific action, while instead rules are not. This is why it is legal to have a rule start with “Check throwing it to”, which functionally means, “apply this rule to every single throwing it to action no matter what the noun and second noun are”. A rule preamble of “Instead of throwing it to” is not functioning because a complete action needs to be specified for the instead rule – in this case something of the form “throwing X to Y” (where X and Y don’t necessarily have to be specific things but can’t be “it” or absent) so that the action-processing rules can know when to apply the rule.

  4. A direction is a kind of object, and a thing is a kind of object, but a direction is not a kind of thing. This will matter when writing rule preambles like “Instead of throwing a smoke grenade to something…”, which can be written as a rule but will never be triggered because no such action can actually be generated from player input. This is because your defined syntax allows only a direction as the second noun, and “something” means a thing.

  5. You really don’t want to cram all of your action processing logic into instead rules like that. The other action-processing rulebooks exist for a reason and you’ll save yourself a lot of hassle if you work with them instead of against them.

You might try something like:

[code]A room can be smoky.

A smoke grenade is a kind of thing. The player carries a smoke grenade and a spyscope.

Place is a room.

Other-Place is east of Place.

Throwing it to is an action applying to one thing and one visible thing. Understand “throw [something] to [a direction]” or “throw [something] [a direction]” as throwing it to.

Definition: A direction is throwable rather than unthrowable if the room it from the location is a room that is not the location.

Check throwing something that is not a smoke grenade to a direction (this is the can’t throw things that aren’t smoke grenades rule):
say “Doing that couldn’t possibly be good for [the noun].” instead.

Check throwing a smoke grenade to an unthrowable direction (this is the can’t throw that way if you can’t go that way rule):
say “But then it would bounce off the [second noun] wall!” instead.

To smoke-blast (targeted room - a room):
now the targeted room is dark;
now the targeted room is smoky.

Carry out throwing a smoke grenade to a throwable direction (this is the smoke grenades are smoky rule):
let further place be the room second noun from the location;
smoke-blast further place.

Report throwing a smoke grenade to a throwable direction (this is the report successful smoke grenade throw rule):
say “You chuck [a noun] [second noun], filling the further chamber with smoke.”;

test me with “e / w / throw spyscope west / throw grenade west / throw spyscope east / throw grenade east / e / w”[/code]

The check rule could be an instead rule with similar function. The differences in the long-term are:

  1. Your instead rulebook is not littered with a ton of different rules, even those only applicable to certain actions like this one is.

  2. You don’t have to worry about rule ordering to keep a check rule from interfering with things like:

Instead of throwing something to south in Villain's Hideout when in the presence of Joey the Sidekick (this is the Joey prefers the indirect approach rule): say "Joey stays your hand. 'I have a better idea,' he says, reaching for his Hack-o-Matic 5000."; try Joey hacking the master computer with the Hack-o-Matic 5000.