Alchemy Poison & Item Crafting Engine
version 1 by Philip Black
Chapter: Tool Use - Using a Tool to Modify An Object
Section: Crafting Objects With Tools
A tool is a specially marked object that does not disappear when it is used and remains available after use. This means we can create a knife that whittles a spear. Just like with basic alchemy, you can also require an tool such as a pestle and mortar to require a container such as a bottle. (NOTE: Do not label the tool as 'Needs a Vessel' otherwise it may cause bugs - you should only ever label consumable items this way)
Forest is a room.
knife is a kind of Craft Tool.
There is a knife in the forest. Every knife becomes the spear.
Large Branch is a kind of thing.
There is a Large Branch in the forest. Every large branch becomes the spear.
Test me with "use knife on branch".
Since the knife is unique in this example, we don't technically have to say that it is a 'kind of thing' or that 'Every knife becomes the spear'. However: You should always say that it IS a kind of thing when scripting just in case (even for unique items), as doing anything else can cause you bugs and problems if you change your mind or get into the habit of writing items this way.
To help you and the player, the script has also been set up to understand this:
Understand "Cut" and "Stab" and "Sharpen" as the knife.
Test me with "Sharpen Spear".
Tools like this will always send the result to the player and leave the tool where it is. This is different to how machines work: