0 votes
by (150 points)

I'm kind of new to this, so please bear with me and my really awful syntax.

I'm using Harlowe 2.1.0 to make an inventory with descriptions that appear when you click on the object's name. This is what I have:

(set: $inv to (a: "apple"))
I have an (print: $inv)!

|apple)[It's crispy and delicious.
Close (click: "Close")[(replace: ?apple)[]]]

(if: $inv has "apple")[(replace: "apple")[(link-repeat: "apple")[(show: ?apple)]]]

(link-goto: "go back", (history:)'s last)

It works as it should, but I get the error "missing ] after element list". This error is specifically tied to the last bit of code with the (if:). I'm not sure why it appears and how I can fix it? And also, is there a cleaner way to write it out? I can't really have the inventory link anywhere else because I also want to include a way to get back to the original passage. Any help and suggestions are appreciated.

1 Answer

0 votes
by (23.6k points)
selected by
 
Best answer

After changing

(if: $inv has "apple")

to

(if: $inv contains "apple")

I don't encounter any more problems on my end.

by (150 points)
Oh my god, I didn't think it'd be that simple... I guess I still have quite a bit to learn. Thank you!
...