Hi there. I am not sure if this had been ask or not. But I can't find anything about it.
So, my question is, is it possible to change two variables at once instead of set them manually in every passage?
E.g. if the player choose "help to fight off a demon", add 1 to honor and minus 1 to infamous.
Basically it is like, if put +1 into $honor, then - 1 into $infamous
Obviously, the I can't code like above.
Comments
While you answer, I'll give you an example for Harlowe.
This is from one of my stories, the player can pick three options: Mage, Rogue, or Warrior.
As you can see I set different variables based on the player's selection: class, hit points, and content of the inventory.
I hope this helps
I am using Harlowe as well.
Maybe my question is not clear enough.
Let's say I have (set: $honor to 5), (set: $infamous to 5)
I want the variable will +1 into honor and -1 into infamous at the same time, like, whenever honor +1, infamous will get -1
So there is a passage and the player can choose "kill it" or "spare it"
And let's say the player choose "spare it", I will only need to code (set: $honor = $honor +1). And the $infamous will get -1 as well without coding.
F.e. you have your stats in the header, say "honor: 5, infamous 3".
And you may add a variable $honorchange. When you decide to "spare":
(set: $honorchange to 1)
And when your header would recalculate the values for $honor and $infamous on page change:
(if: $honorchange is not 0)[
(set: $honor to it + 1)
(set: $infamous to it - 1)
(set: $honorchange to 0)]
Also you could use the (display:) macro to execute some series of commands previously written on another passage.