Hello, I am very new to twine- I’m doing this for a school project and this is my first time coding like… anything. So please bear with me
I am making a dating sim like game, and I want to make an animation for when the player picks the wrong answer to a question. I wanted it to look like a flickering heart that then goes away and I attached an image of what I thought would work- the idea is it goes from big heart to small heart to big to small and then disappears, but it only goes from big heart to small heart and then the player is sent to the next page. I’m really not sure what the issue is but I just don’t know any of this stuff to work… </3
I think that’s because you replace the _heart
variable, but then the heart variable isn’t there anymore. I think have two variables, big_heart and small_heart and keep replacing one with the other. Also, put a (stop:)
after each (replace:)
if you don’t want it to keep happening…
Oh thanks!! That makes a lot of sense haha. I tried what you said and it worked perfectly
and @wonderouswraith
There is no need for a variable at all, because the Text Search variant of the (replace:) macro is being used. And the (stop:) macro should be called as soon as possible within the associated Hook of a (live:)
macro call.
(live: 3s)[(go-to: "They look happy together.")]
=><=
(text-size: 6)[♡]
(live: 1000ms)[(stop:)(replace: "♡")[♥]]
(live: 1100ms)[(stop:)(replace: "♥")[♡]]
(live: 1200ms)[(stop:)(replace: "♡")[♥]]
(live: 1300ms)[(stop:)(replace: "♥")[♡]]
(live: 1400ms)[(stop:)(replace: "♡")[]]
However, as Text searching through the contents of a web-page is very slow, a better implementation would be to use a Named Hook to identify where the hearts should appear, and to use the HookName search variant of (replace:)
instead.
(live: 3s)[(go-to: "They look happy together.")]
=><=
(text-size: 6)[♡]<heart|
(live: 1000ms)[(stop:)(replace: ?heart)[♥]]
(live: 1100ms)[(stop:)(replace: ?heart)[♡]]
(live: 1200ms)[(stop:)(replace: ?heart)[♥]]
(live: 1300ms)[(stop:)(replace: ?heart)[♡]]
(live: 1400ms)[(stop:)(replace: ?heart)[]]