Skip to reading
Save Games & Inventory

Test both the success and failure paths

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView illustrations

Figure 17. Lubricated gear replaces Brass gear. One oil has been consumed; the rest of the stack remains.

Source table from Test both the success and failure paths, page 27
TestExpected result
Oil and gear are both carriedOne recipe result is added; the intended ingredients are removed.
Only oil is carriedNo result is added by the guarded script.
An unrelated item is selectedNo accidental recipe reward.
The result cannot be carried or is already at its limitHandle that condition before consumption in your recipe logic.
The rule is reachable from both directionsA single player attempt should run the recipe once.

The runtime can find a rule on the source item or on the target item, with legacy combination data also supported. Keep one obvious place for the recipe rather than maintaining two competing copies.

A combination’s result action can run a script or action list. Give it the same condition checks you would put in an ordinary puzzle. The GUI is the input surface; the recipe logic decides what is allowed.

Page 27 of 96Permalink
Go to page