In my battle system, I want to create a boss that needs certain requirement (e.g. Strength) to be met before player is allowed to encounter him. If player does not meet such requirement, they will be given a warning pop-up box to say something like "your strength does not meet 150" then after clicking OK, the player is automatically taken back to the passage which they came from.
(if: $jobclass is $Berserker and $Strength < 150)[
(set: $prompt to (confirm: "You do not have enough Strength (150) to face this opponent"))]
(if: $prompt is true).......
]
(note: the "......." just means I don't know what to write after that)
I've read up on some of the replies from this post "
https://twinery.org/forum/discussion/2910/back-or-return-in-harlowe" and did some more research on forum, but I do not seem to have found an answer to my problem.
If I want to be able to go to this passage which I called Passage "Sir. Oxóssi Mixcoatl", from Passage A, B, C & D, is there a macro which could determine which passage I came from and returns me to that passage automatically?
Attached is a picture of my story map, hope it helps clarify the problem a bit.
Thank you.
Comments
Why do you need to assign the return value of the (confirm:) dialog to a variables when you are always going to send the Reader to the previous passage if they are a $Berserker with a $Strength < 150?
You could simplify the code to:
Harlowe does not have a macro equivalent to SugarCube's <<back>> macro (which winds back history), although you can simulate the same effect by using Javascript to send a click event to the Undo link.
I've worked out the logic for the (history:) macro now, but I am still confused by the Javascript macro.
What I am confused about, is that when I tried testing what the macro does by simply copying and pasting what you wrote into the Story Javascript Sheet, the error in the attached picture comes up whenever I tried testing the game starting from any passage.
So would I be right to assume that I am missing a Javascript code which will tell the to be linked to an Undo icon/button which I've to create within a certain passage?
1. To go forward to the previous passage you would use the (go-to:) macro within the associated hook of the (if:) macro.
2. To undo history and go back to the previous passage you would replace the line containing the (go-to:) macro with the <script> example code.
Dear god that name though...
I will consider on your suggestion and see if I could make it a cleaner design
About the name, yeah it's quite long and probably hard to pronounce, but I did find it hilarious when I combined the 2 hunter gods together
If so, how would I build the code?
You could just use code like the following to show either a real link or a fake link depending on a condition. ... and use CSS like the following (which is based on Harlowe defaults) to style the fake link: