Breaking and smashing

I try to add rules for breaking and smashing but i get what I assume is an automatic response programmed into using some actions: “Violence isn’t the answer to this one.”

Is there a way to override this automatic response? I have pasted sample code below, but have tried it in several different ways:

breaking is an action applying to one thing.   understand "break [something]" as breaking.  

instead of breaking pottery jar:
		say "You smash the pottery jar hard against the wooden cross below you.  It shatters into several large shards and manage to keep ahold of one as the others drop to the ground";
		now pottery jar is nowhere;
		now play has potteryshard;
		increase score by one.
2 Likes

The problem is that Inform already has verbs ‘break’ and ‘smash’, meaning the same as ‘attack’.

You need to get rid of these existing meanings to give yours a chance to work:

Understand the command "break" as something new.
Understand the command "smash" as something new.

See documentation 17.3

3 Likes

@drpeterbatesuk already answered your question, but as an aside, there’s a small bit that might not compile in your second to last line:

now play has potteryshard

I suspect Inform might not recognize play as player, but I haven’t tested it to know for sure.

2 Likes

Or you could just use the existing Attacking action rather than trying to make a new action.

Instead of attacking the pottery jar: [...]
7 Likes

Thank you!

1 Like

This is the best way to go, in my opinion - it’s less work for you, and it’s better from a player perspective since it makes the game’s behavior more consistent (if nothing else, there are a lot of other built in synonyms for attack that you’d need to remap to avoid player confusion).

3 Likes

Thank you for providing this advice, it is greatly appreciated.

2 Likes

Sure! Here’s what that would look like, if that’s helpful:


the block attacking rule does nothing when the noun is the pottery jar.

carry out attacking the pottery jar:
	say "You smash the pottery jar hard against the wooden cross below you.  It shatters into several large shards and manage to keep ahold of one as the others drop to the ground.";
	now pottery jar is nowhere…

3 Likes

If you want to see the synonyms that are defined for ‘attack’, you can either look on the right hand pane under the Index tab → Actions Index → Commands and search for all the words listed as ‘same as “attack”’ or, more conveniently, in play you can type at the prompt showverb attack(or showverb break etc.), which by default displays this:

>showverb break
Verb ‘attack’ ‘break’ ‘crack’ ‘destroy’ ‘fight’ ‘hit’ ‘kill’ ‘murder’ ‘punch’ ‘smash’ ‘thump’ ‘torture’ ‘wreck’
* noun → Attack

You don’t need to worry about the * noun -> Attack bit, but after Verb on the top line are listed all the synonyms of ‘attack’

This is also a really quick and easy way to check whether your new verb is already being used: if not you’ll for example get the response:

>showverb brush
Try typing “showverb” and then the name of a verb.

4 Likes

Thank you!

1 Like