Hello. I am very new to both Twine 2 and coding in general. Like... picked it up a day ago. Trying to create a simple adventure game with the program and have run into a problem with combat. I found a guide online to shows you how to set up a simple 50/50 combat system, but seems to be out of date or something and I have not been able to find another guide.
Problem is as follows: Followed the guide to set this up, and the first part works for being attacked. Without the second part it runs perfectly. It's once I get to the (else:) for the 50/50 chance that I get an error. This is what I have written below, and any help would be appreciated.
(if: (either: 0, 1) is 0)[
The giant rat leaps up and bites you!]
(set: $hp to $hp - (either: 1,2,3))
(if: $hp < 1)[ You have been [[defeated by the giant rat]]! ]
(else:)[ Your health is $hp.
[[Fight the giant rat!]]
]
(else:)[ You slash the giant rat with your sword!]
(set:$monster_hp = $monster_hp - 1, 2)
(if: $monster_hp < 1)[ [[You have killed the giant rat]]! ]
(else:)[
Its health is $rat_hp.
[[Fight the giant rat!]]
]
The problem I get with the second part, past the (else:) after the break, is I get an error telling me: (set:)'s 2nd value is the number 2, but should be a 'to' or 'into' expression.â–ºThe (set:) macro must only be given a 'to' or 'into' expression.
And another problem is this supposed to run both outcomes at the same time? I'm really over my head and just trying to get something simple done to work up a bit of know how... but this is frustrating me beyond belief. Any help would be greatly appreciated... and remember, really knew so don't know a lot; especially when it comes to jargon.