It looks like you're new here. If you want to get involved, click one of these buttons!
You find yourself sitting on the patio of a small coffee shop. You have a <<cyclinglink $cupsize "small" "medium" "large">> <<cyclinglink $cupkind "paper cup" "ceramic mug" "teacup">> of <<cyclinglink $cupdrink "hot coffee" "hot chocolate" "hot tea">> in your hands.
[[Take a drink.|Drink]]
<<nobr>>
<<if $cupsize = "small">> <<set $Camron = $Camron + 1>>
<<elseif $cupsize = "medium">> <<set $Zion = $Zion + 1>>
<<elseif $cupsize = "large">> <<set $Lalia = $Lalia +1>> <<endif>>
<<if $cupkind = "paper cup">> <<set $Lalia +=1>>
<<elseif $cupkind = "ceramic mug">> <<set $Camron +=1>>
<<elseif $cupkind = "teacup">> <<set $Zion +=1>> <<endif>>
<<if $cupdrink = "hot coffee">> <<set $Camron +=1>>
<<elseif $cupdrink = "hot chocolate">> <<set $Lalia +=1>>
<<elseif $cupdrink = "hot tea">> <<set $Zion +=1>> <<endif>>
<<endnobr>>
No matter what I set the cycling links to, the amounts of the variables stay the same, and I cannot figure out why.
Comments
The reason it doesn't work is because the variable isn't set until you go to the next passage.
Attached is your code fixed.
Hope that helps!
I do that kind of thing all the time.
EDIT: Also also, a lot of the time you're doing this: That may or may not work, but it just needs to be:
I fixed the other things you said, as well, but now $identity will only return the initial set value of 0 and I have absolutely no idea why.
I put in a check via the "print" function to see where points are being allocated for the cycling links, and none of those are working the way I intended either. ((I think I might just be terrible at coding))
Next, notice I created the new entry titled "Set" with the "nobr" tag. The "nobr" tag removes the need to use "<<nobr>><<endnobr>>" in that passage. You can use "<br>" HTML tags inside such a passage to create white space. Pretty cool, huh?
I also added the "nobr" tag to a couple other places as well as <<set $identity = "Error">> to Start.
Again, Like I said, the cyclinglink variable must be set in the next passage, so I created a second "Set" passage as well.
As for the values being equal, I was lazy and just set the conditional branch to "gte" rather than "gt" and then figuring it out after that. I let you mess with that if you want. After reviewing my code, you should be able to do so.
Seems to work perfectly. I played it about six times all the way through and the results always were what they should be.
Attached is the TWS and HTML files.
Hope that helps . . . and I hope you read and follow my instructions and code this time before asking another question. Not trying to brow beat you, but it annoys me when I take the time to write an answer and post a TWS file, and then it gets ignored. Understood? Cool.