[I7] Kissing

So, Inform 7 automatically blocks kissing. Can’t imagine why… But the action does already exist. So, would this work?

“Example”

The Lair is a room.

The witch is a woman in the Lair.

The frog is an animal in the Lair.

The block kissing rule is not listed in the check kissing rules.

Carry out kissing someone:
if the noun is an animal;
say “Why bother?”
otherwise;
if the noun is a woman;
say “A deadly choice.”;
end the game saying “Flirting with witches will get you killed!”.

Once you fix your semi-colons and indents, then yes, it will.

Ah, I might have mixed that up a bit, sorry. :slight_smile: If I unblock kissing but don’t put in a carry out response, what is the default response?

Either nothing at all (not even a blank line) if the noun is a person, or “You can only do that to something animate.” if it isn’t a person.

Got it. So I need to ensure to write a carry out rule. Got it. Thank you!

The “block ing” rules don’t actually mean the action is blocked, btw. They are just pre-set default rules for various reasonable actions that might not be relevant to the game in question, even though they are common enough actions to warrant being already defined in the standard rules for you - and if they’re not relevant, they don’t actually cause anything to happen; therefore, the action is blocked outright with a suitable default response.

As you can see from the other replies, it’s trivial to override that if indeed you wish the action to be meaningful.

In fact, in games where it doesn’t really make much of a difference, you don’t need to “unblock” it at all. If you make your rule an “Instead” rule, instead of a carry out rule, it’ll get called instead of the blocking rule. Indeed, your “carry out” rule for kissing the animal is effectively blocking the action as well.

Just for clarification. It doesn’t make much difference, as long as you pick the programming style you like best.

So, this would work, spacing notwithstanding.

“Example”

Lair is a room.

The witch is a woman in Lair.

Instead of kissing the witch:
say “Bad idea.”;
end the game in death.

Did when I tried it. :slight_smile: In fact, just to be sure, I tried your example code (with proper tabs and semi-colons, you really have to watch that) removing the “unblocking” rule and substituting “carry out” for “Instead”, and it worked great.

I’d encourage you to try things for yourself, though. Get dirty. Muck it up a bit. It’ll help you see how I7 does its magic.

Just a note–if you want to get the proper spacing in your code, use code tags (the “code” button that appears above the text window where you type your post) and paste the code in from Inform.

Mucking about would be a good way to learn, but I am totally blind, and I write my code on a braille device, then transfer it to Inform. So it’s a lot easier for me to just have the right code than to have to open up the braille device, edit the code, translate it into a viable file format, put it on my computer, open it, then copy/paste it into Inform. As far as code spacing online goes, I’m afraid my braille device doesn’t care much for the code button or other format buttons. Sorry for the inconvenience.

Yes, I can understand why the code buttons would not work for you then! It’s not a big issue anyway; if using tab stops presents problems for you you can also mark out code blocks using “begin” and “end,” as discussed in section 11.7 of the manual.

Not an inconvenience, so don’t apologise, it’s what this place is for. Best of luck with your project. I second Matt’s suggestion about “begin” and “end”, btw.