(if: (document.title = "Wowie") is 1)(which does nothing except change the window title to "Wowie") or writing
(set: $a = 1)instead of
(set: $a to 1).
Then it would be nice to simply have a
<script> // after the escalation hack, not gonna say how to do this lol var variable1 = harlowe.State.variables['var1']; // do stuff with variable1, like even just alerting it alert(variable1); // you could also directly reference that in the print statement, but... alert(harlowe.State.variables['var1']); // just sucks // and setting the story variable would be harlowe.State.variables['var1'] = "whatever"; </script>
^As you can see, that is an absolute disaster.
Now the question is, how would we make this
- We could try using a CodeHook. Now, the question is: where do we put it?
- We could use a string argument. We could simply do something like
harlowe.State.variables['a'](or however it's actually accessed by the engine). This would also easily allow dynamic JS in the story. Problem: that's a terrible idea and is basically JS
eval()all over again.
- We could just override the new macro-running code and treat it the old way. But that makes it into a syntax tree, then makes it into a string, then uses the funny
eval()command, which this entire process is both slow as hell and sketchy.
- We scrap the idea of a
story.variables['var1'], like we do in the scope escalation hack, but without the need of doing the actual hack.