It looks like you're new here. If you want to get involved, click one of these buttons!
<<if $Options is 1>> /* Time, Magic and Stamina will not increase */
<<else>>
<<set $Time += 1; $Stam -= 1; $Magic += 1>>
<</if>> /* Options if end */
<<if $Statmod is 0>> /* if Statmod */
<span id="STATMODSTAM">
<<click "Change Stamina">>
<<replace "#STATMODSTAM">> <<textbox "$Stam" "10" "Settings">> <</replace>>
<</click>>
</span>
|
<span id="STATMODSTAM">
<<click "Change Magic">>
<<replace "#STATMODSTAM">> <<textbox "$Magic" "10" "Settings">> <</replace>>
<</click>>
</span>
|
<span id="STATMODSandL">
<<click "Change Both">>
<<replace "#STATMODSandL">> <<textbox "$SandL" "10" "Settings">> <</replace>>
<</click>>
</span>
<<if $SandL gt 0>> <<set $Libido to $SandL; $Stam to $SandL; $SandL to 0>> <</if>>
<<endif>> /* if Statmod END */
This one stops adding 1 as a value to the variable, instead adds "1" as a text string to the variable $Magic. Making the number 10 become 101 and for each passage I click, it adds more becoming 1011, 10111 and so fourth.<<set $Magic += 1>>
Comments
Same for -= 1, use --.
I don't know if that'll solve the issue, and it's not a universal solution, but just a pointer.
Twine is iffy with variables in general I find, make sure you're setting $Magic to a number (and not a string) in your StoryInit.
So what you need to do is convert the input from the user to a number just after they input it. There are a number of different Javascript functions you can use Number, parseInt, and parseFloat depending on the type of number you are expecting them to enter. Because you cant control what the user actually typed into the text field you will need to first check if they actually entered a number instead of some letters or symbols, and you can do that using isNaN
So something like the following should work.
note: