Tl;dr: How can I use (live:) to create 'pauses'? How can I make text disappear or change? How can I increase text size or position after it has been rendered? How do I correctly use transitions (particularly transition-time)? I am using Harlowe. Ty.
Hi all,
I am on day 2 (3?) of trying to create my story. I am using Harlowe on the latest version of Twine. I am still trying to create my first passage. I remember having similar troubles about six months ago. I am getting pretty frustrated to be honest with you all - it seems no matter what I try I can't create the behaviours I want. It's always 1 bug or bit of weirdness away from working.
So here's what I am trying to do:
I want the story to begin with your character dreaming: black background with text that slowly appears on the screen in "chunks" (I am guessing each would have a hook) that are different in style, particularly different colours. In part of the dream a character says the word "beep". After a short pause, the word "beep" turns red, begins pulsing, and the styles, colours etc. of other parts of the dream change (I may jumble them around too). The "beep" grows in intensity, becoming bolder and ideally larger and more central to the screen, as the rest of the dream warps and fades, until it is the only feature.
I had originally wanted "beep" to be a link but have given up on that idea - no matter which set of workarounds I employ it comes out blue (I can generally get it to exhibit one or two of the behaviours I want, but then I'll try and add something else and it reverts to blue), kind of the opposite of the effect I was going for. Indeed adding formatting options to a link has proved generally problematic so I made it a clickable named hook, which also didn't work. Observe:
(set: $alarm to ["Beep"])
(set: $alarmFont to (font:"monospace"))
(set: $alarmStyle to (colour:"red") + (text-style: "bold"))
(set: $x to 0)
(live: 2s)[(if: $x is 1)[(set: $x to $x -1)(set: $alarmFont to (font:"monospace"))]
(else:)[(set: $x to $x +1)(set: $alarmFont to (font:"Arial"))]]
(live: 2s)[$alarmStyle[$alarmFont[$alarm]]]
(click-replace:"Beep")[`7:00`
[[Get Up]] [[Snooze]]
]
Nb: the above code was some "test" code I wrote, I have written a few other versions but always encounter problems. The font isn't even the thing I really want to change, I just wanted to see what I could/couldn't do with live: (I want to change the size, redness, and possibly boldness... but the what is less important than the how)
A.) clickable beep is blue once I add click-replace:
B.) when you click it, the related text and links are quickly replaced by the ongoing 'live:' commands (which I would guess is actually not a hard problem to fix, I can think of a few solutions, but I can always think of a few solutions and none of them ever seem to work *sad coder face*).
(Before anyone points me to the venerable
greyelf's generally excellent harlowe passage tag based styling post post, it seems that while the code there is a wonder to behold, it stops working when you nest a link within a "live:" command... and some styling changes... and well, I am not sure exactly what stops it working but live: seems to be the problem)
Onto problem 2:
Having given myself a cluster-headache trying to wrestle with the dark and powerful magick that is (live:) I tried using transitions when writing my dream sequence. Headache A: (transition-time:) is not recognised as a command. Headache B:, a solution (once again proposed by greyelf,whose knowledge of code and willingness to share it with others suggests he may be some sort of time traveller as well as an all round goodun), namely giving transition/t8n: a string and a number resulted in the error "one too many values were given to the transition macro". Headache C: I tried to set a text-style variable that looked like this:
(set: $dreamStyle1 to (font: "papyrus") + (t8n: "dissolve", 1000ms) + (text-colour: (either: "magenta", "green", "blue")))
Along with the aforementioned t8n problem, this piece of code randomly chooses a colour.... once. I want it to do that every time it is invoked. I tried setting it to itself (nested within live commands) but that just returns a value of 0. I haven't even got close to doing a lot of the other stuff I mentioned:
*Weirding up the dream text once "beep" appears
*Fading the dream text
*Increasing the size and centralising "beep" once it does (as well as making it beep more.... insistently)
Thanks for reading, I realise this is a long post but I thought it made more sense to make one big post (partly just to take a break!) than come running back every 20 minutes asking why this or that new problem is happening.
Big love all,
J
P.S. I am happy to have answer to any or none of my problems. By "none" I mean telling me "this is a really complicated thing to do as a n00b (nb: I take no offence at being called a n00b - in fact, I was born as a n00b) to attempt, try something easier/go back to school". If I'm trying to climb Everest before I can walk, please let me know
Comments
Should work, instead I get the error:
'I can't run the macro 'transition-time' because it doesn't exist!'
Adjusting transition-times would really help me code my dream sequence in the way I want (with each new hook transitioning in a little more slowly than the last) but at the moment this functionality seems to not be present. Is this the case?
Based on the project's source repository it seems it is meant to be part of a future release (maybe 2.0.0) and its documentation has prematurely been added to the Harlowe Manual.
I had a quick look at your original post and it may take a while to workout solutions to all your issues.
One quick suggestion I have is to move each "chunk" into its own passage (a child passage), which you can then conditionally (display:) in the main (parent) passage at the correct time. Child passages can also contain code that manipulates the contents of the parent passage.
"One quick suggestion I have is to move each "chunk" into its own passage (a child passage), which you can then conditionally (display:) in the main (parent) passage at the correct time. Child passages can also contain code that manipulates the contents of the parent passage."
Can you explain how this is done :-/
The following is a very simple example that uses child passages to update a parent passage every two seconds.
1. Main passage (the parent)
It contains two named hooks which are being used as the targets for two of the three effects. 2. Effect 1 passage (child)
This passage inserts text into the parent. 3. Effect 2 passage (child)
This passage inserts text into the parent, that text contains a named hook which will be the target of the third effect. 4. Effect 3 passage (child)
This passage replaces text in the parent, it also contains the (stop:) macro which is used to indicate that there are no more effects after this one.
warning: It is very important in this example to include the (stop:) macro in the last effect, if you don't then the (live:) macro in the parent will fire again and try to display the Effect 4 passage which will result in an error because it does not exist.