I am so afraid this is the silliest mistake ever, but I genuinely can’t figure out what is wrong.
I am trying to implement a cooking system for my game. Luckily, I found the following post. Trying to make a cooking system? - #4 by matt_weiner
I want my game to have a decent amount of recipes, so I decided to follow matt w’s example of using a table to store the recipes so I can easily add recipes to the game.
I’ll add my version of the code.
[code]Some mashed potatoes with steak is a thing.
A power switch is a device. It is part of the oven.
Table of Cooking
ingredients result report
{steak, mysterious milk, lonely potato} mashed potatoes with steak “The steak still oozes with juices even after being cooked, making the mashed potatoes look dry in comparison.”
To decide whether (listone - list of values) is identical to (listtwo - list of values):
repeat with item running through listone:
if item is not listed in listtwo, no;
repeat with item running through listtwo:
if item is not listed in listone, no;
yes.
Instead of switching on the power switch:
let L be the list of things in the oven;
repeat through the Table of Cooking:
if L is identical to the ingredients entry:
now everything in the oven is nowhere;
now the result entry is in the oven;
say the report entry;
say line break;
rule succeeds; [this ends the whole rule]
say "You won't get anything by cooking [if the number of entries in L is less than 3]just [end if][L].”[/code]
(The three food items and the oven are a bit farther down in the section of the code describing the kitchen, with a fridge and the oven this code references inside that location.)
I tried my very best to copy matt’s code identically but maybe I made a very stupid typo. Whatever it is, when I try to run this code, I get the following error.
Problem: In 'Table of Cooking', I'm reading the text 'mashed potatoes with steak' in column 2 (result) of row 1, but I don't know what this means.
This should usually be a value, like a number or a piece of text, or a blank entry marker '--', but in some circumstances it can also be an action (such as 'taking the box'), or a kind (such as 'a number') to show what sort of values will go into an otherwise blank row.
Problem: Column 2 (result) of 'Table of Cooking' contains no values and doesn't tell me anything about its kind.
Anyways, I don’t understand why it can’t recognize that the mashed potatoes and steak are in column 2 of the table. What’s going wrong here? The mashed potatoes and steak are a thing that exist. Did I go wrong somewhere making the table? Like with the indenting? This one is stumping me.