It looks like you're new here. If you want to get involved, click one of these buttons!
"<<if $drinks = 0>>
She looks at your drink and says "I don't handle alchool well..."
However, she finds it better to just to as you say and starts drinking.
She makes a very disgusted face as she lets the drink go down her throat and you wonder if she has ever drank before.
<<set $drinks = $drinks +1>>
<<else>>
This time around, she drinks it better, still making a disgusted expression but less than before.
<<set $drinks = $drinks +1>>
<</if>>
<<print $drinks>>
What do you tell her now?"
Comments
You're using an assignment operator (
=
) inside a conditional expression (see:<<if>>
macro), which if that's what you needed and wanted to do there would be fine, except that it's not. You should be doing something like the following:However the variable never goes above 0. Shouldnt the snippet: add 1 to the number stored in $drinks?
Edit:
Just tried again: works correctly
No, because now you're using a conditional (equality) operator (
eq
) inside an assignment expression. What you had previously was correct there. You should be doing something like one of the following.Using the TwineScript
to
operator (equivalent to the JavaScript assignment operator; see:<<set>>
macro): Or the JavaScript=
(assignment) operator: Or the JavaScript+=
(addition assignment) operator: