ran into a little trouble with this section, I am creating inventory as follows and getting error must have *goto or *finish maybe missing something here but I believe I have that…
ie:
Not knowing how long the virus will last, nor what is really happening outside what will you take? (you can only take 6 items
It might have something to do with that *hide_reuse near the beginning, which is intended to be used within a *choice list in much the same way as *selectable_if, e.g.
*hide_reuse #Food and water (10lbs)
Unless of course you do want all the #options to be *hide_reuse, in which case you do want to leave that as it is.
Note also that *selectable_if should itself generally be used as follows (i.e. not a separate line):
*selectable_if (military_officer) #MREs and Canteen
Hmm. Best would be to post your code again but put < pre> before it and < /pre> after it (without those spaces), which will retain the indentation in the forum. It should then be much easier to spot what’s causing the problem.
Can’t spot anything there other than the fact that those #options using *selectable_if are not on the same line. You should correct those, if only because it makes bug-hunting something like this easier (i.e. easier to make sure you have all the *gotos in the right place).
There’s also an instance where you spell “millitary_officer” like so, and another case where you spell it correctly with a single L. One of those must be different to the spelling used in mygame.js so will need correcting.
Cool, heading in the right direction. Post it again please. And is it still the same error you mentioned previously?
Just a thought as well, if you’re deleting any lines from your actual script before posting it, I’d recommend not doing so. It’s hard to help if we can’t see the full picture.
*choice
*selectable_if (military_officer)
#MRE's and Canteen
*goto start
Try doing as I said above with it. and about the choices that use no *if or *selectable_if’s, put them on the same line with the *selectable_if’s and the *if’s, not on the same line with the choices; do this:
@Vendetta, Well, it works with the *if commands, and I never used the *selectable_if (mainly because of the errors encountered with it) so I don’t really know.
Anyways, why don’t you change the *selectable_ifs into *ifs, which would fix it? Just a suggestion…
Yep, you’re correct on that score–when used within a *choice statement the ordinary *if condition(s) should indeed be placed on their own line, followed on the next line (and indented again accordingly) by any ordinary #option, *hide_reuse or *selectable_if. This makes the *choice statement highly flexible, by allowing a variety of *if conditions to be pre-applied to any of the three types of options.
However, when *selectable_if is the only condition needed (as in this case), then it should simply be written as (and all on one line):
*selectable_if (military_officer) #MRE’s and Canteen
Concerning your last comment; it’s a fair question so I’ll answer in full for any future readers wondering the same thing!
He really doesn’t want to change his *selectable_ifs to ordinary *ifs in this case. Not only is it unnecessary to do so (he just needs to follow the example above), he has also chosen the correct option type for what he wants to achieve here, which is to “gray out” a *selectable option if the player does not qualify. By this means the player knows that when they play again and choose different options at an earlier stage, different options would then become available at this point (e.g. Military Officers get a canteen). He doesn’t want to hide the information in this case (which is what an ordinary *if would do) as it encourages replays to try those unselectable options.
To help explain what I meant in my previous post, I’ve knocked up the following example to demonstrate how the the different #options of a *choice statement should be laid out. Bear in mind that this is just a bit of nonsense as an example of the different things you can do, different ways you can use these elements together, and some things to bear in mind when doing so–such as the required indentation for each style, and where & when you need double parentheses, etc.
I’ve included the *temps so you can just copy & paste this into a current project and play around with it by changing the values, just to see what effect it has on the options displayed.
*temp shadowwalk
*set shadowwalk 30
*temp infravision
*set infravision 30
*temp lit_torch_held
*set lit_torch_held false
*temp agility
*set agility 50
*label throne_room
*choice
#Cross the throne room and exit through the doorway at the far side
*if shadowwalk > 20
You tip-toe across the throne room and head into a damp passageway.
*goto damp_passage
*else
You clumsily trip over the dragon's tail and promptly get eaten.
*ending
*if (shadowwalk > 30) and ((infravision > 30) or (lit_torch_held = true))
*hide_reuse #Search every nook and cranny of the throne room.
You search every nook and cranny . . . pointlessly.
*goto throne_room
*if (shadowwalk < 31) and ((infravision < 31) and (lit_torch_held = false))
#Search the throne room, avoiding the sleeping dragon.
You trip over the dragon's tail. She awakens and gobbles you up . . . Burp!
*ending
*selectable_if ((agility > 50) and (shadowwalk < 31)) #Leap for the balcony.
You reach the balcony, grab the treasure, and leave via an open window.
*goto castle_grounds
*if shadowwalk > 30
*selectable_if (agility < 50) #Quietly leap up to the crumbling balcony
You fail to reach the balcony but land softly, without awakening the dragon.
*goto throne_room
*hide_reuse #Dance a jig around the sleeping dragon . . . quietly!
You (somewhat pointlessly) dance a silent jig around the dragon. Zzzzzzz.
*goto throne_room
#Hack the head off the slumbering dragon.
Nice try . . . You succeed only in annoying her. Charred adventurer! Yummy!
*ending
*label damp_passage
Damp passageway blah blah blah
*ending
*label castle_grounds
Castle grounds blah blah blah
*ending
@Cristoph, I’ve tested your code, and it works just fine with the following edits:
all referenced variables are created and given initial values.
all *selectable_if’s and #SelectableOptions are placed on the same line.
millitary_officer is changed to military_officer
My version of firefox errors out with “Couldn’t parse the line after *selectable_if: (var_name)” where var name is something like “military_officer” whenever *selectable_if and #SelectableOptions are on separate lines. That’s the only serious issue I noticed.
Of course to really make it useful you’ll have to set item variables to true as @JimD has mentioned, and add some additional logic that will exit the loop once you equip 6 items. Currently it doesn’t end until the player selects “Done”.