Hello I am completely new to this and I have been pouring over forum links and the Harlowe wiki and for the life of me I can't figure out what is wrong.
I started with
this site which gave the the basics but its an array. I am going to use just word based things so I think a data set would be better (ds:) so i added that instead.
I would like to have a thing that only displays a link if you have something in your inventory.
here is my code:
"I dont know much, but I know I am feeling like spagetti. Here is a list of ingredients."
(set: $inv to $inv + ("list"))
[[Do you have any money?|money]]
(if: $inv is in ("some money"))[[Go outside|outside]]
and I keep getting
the number 0 cannot contain any values, let alone the string "list"
and I can't figure out how to fix it. Did i get the syntax wrong?
Comments
note: You don't include the initialisation of the $inv variable in your example so I will assume it is something like the following, and that for testing purposes you have added an "some money" item to your $inv dataset.
There are a number of syntax errors in your examples:
1. You are missing the ds macro name in your (set:) statement, which is needed when adding a new element to an existing dataset collection.
2. You have reversed the right and left sides of your is in operator.
3. Your (if:) macro is missing its associated unnamed hook.
4. [optional] You have unneeded parentheses around the String "some money"
Try the following:
In the future I will remember to post the version numbers but in this case I am using Harlowe 2.0.0
I gave it a shot and it works! thanks for the input