Hi,
How do you give something a ‘cuttable’ attribute, like ‘edible’ for stuff that can be eaten. Cuttable doesn’t work, nor does 'removeable.
There isn’t any standard behaviour for this, so you’ll have to create your own.
Your main issue here is probably the block cutting rule. When an action isn’t working as you’d expect it to, look it up in the Index, and maybe in the Standard Rules as well. Often you’ll find that Inform is doing something a little more fiddly than you might expect.
[code]A thing can be cuttable or uncuttable. A thing is usually uncuttable.
The block cutting rule is not listed in any rulebook.
Check cutting:
if the noun is uncuttable begin;
say “Cutting [the noun] up would achieve little.”;
stop the action;
end if.
[/code]
Then you would probably want to do an Instead rule for each cuttable thing.
Thanks, that did the trick . Now I’ll know about adding rules for next time
Creating new verbs is fun. Careful though, once you start it can be hard to stop.
You can also write out the check rule like this.
Check cutting:
if the noun is uncuttable, say "Cutting [the noun] up would achieve little." instead.
Just like pringles! Actually, come to think of it, one game I made had a whopping 82 properties of this form!
I’d probably suggest using named check rules rather than instead rules. That way you can use “actions on” to get the name of the rule that is stopping the action if thing aren’t quite going to plan. So, something like this.
Check cutting (this is the can't cut uncuttable things rule):
if the noun is uncuttable, say "Cutting [the noun] up would achieve little." instead.
If you are thinking of fully implementing a cutting action is this way, you may want to divert attacking a cuttable thing to cutting it. So, something like this.
A first check attacking rule (this is the convert attack to cut rule):
if the noun is cuttable, try cutting the noun instead.
I’m emphasising “may” here since you may want to allow attacking cuttable items as well. I figure that many players will try attacking rather than cutting.
Hope this helps.
Here is another method as well:
[ACTION - CUTTING]
A blade is a kind of thing. CutVuln is a kind of thing. Cutting it with is an action applying to two things.
Understand "cut [something] with [something]" as cutting it with.
Understand "saw [something] with [something]" as cutting it with.
Check cutting it with (this is the can't cut with a nonblade rule):
if the second noun is not a blade, say "You can't cut anything with that!" instead;
Check cutting something with a blade:
if the noun is not a CutVuln, say "You can not cut that.";
Check cutting the log with the butcher knife:
say "There's no way in hell you are going to cut a log with a butcher knife.";
do nothing instead;
Carry out cutting the log with the chainsaw:
say "Wirrr! You saw through the log.";
continue the action;
Instead of cutting the squash with chainsaw:
say "You should use a smaller blade than that.";
Carry out cutting a noun with something:
If the noun is the log and the blade is the chainsaw begin;
now the log is cut;
else if the noun is the squash and the blade is the butcher knife;
move squash to Game Limbo;
move slicesofsquash to Test Room;
end if;
You could also of course add or move things to ‘After cutting a noun with something:’.