0 votes
by (120 points)
Hi all!
I'm trying to make a game like Lifeline. There was a difficulty with the implementation of the timers after clicking on the link leading to the next passage.

Is it realistic to make the following logic:
1. Clicked on the link.
2. After pressing the progress bar and the timer showing how long it takes to reach the next passage. The buttons are gone.
3. After the expiry of the time-the next passage was opened.

Lifeline implemented a simple link structure-[[duration: 2h | passage_name]], but in Twinery or in Sugarcube I have not found such.

Please give an example!

PS. The time of the timer, thus, should be taken from the device real, from which would been the value of the remaining time.

PPS. Sorry for my English :)

1 Answer

0 votes
by (159k points)

I will assume that you're taking about Lifeline by 3 Minute Games which I haven't played, nor do I have access to the games source code to determine how it implemented it's progress bar based links.

You have stated that it uses standard Markup based Links (like [[duration: 2h | passage_name]] ) to trigger the progress bar based Passage Transitions. If you know this as fact then I can only assume that you do have access to the game's source code, in which case you could import that source code into the relevant Twine application (either 1.x or 2.x) and then look at how such links were implemented.

From memory (but I could be wrong because it is a long time ago) that iOS application included a server component which the application sent messages to, and which the server later replied to. If that is the case then the delay effect might be a result of the server waiting the required time before sending it's reply, which the application would process once it recieved it. Such a system is not trivial to implement and beyond the ability of this forum to answer in detail.

If I was going to do something similar in SugarCube without the use of a server component then I would use a <<link>> macro something like the following.

@@#links;
<<link "Option 1">>
	/* Hide the links. */
	<<run $('#links').hide()>>

	/* Show the Progress Bar. */
	....

	/* Start the timer (delay equals 5 seconds). */
	<<timed 5s>>
		/* Hide the Progress Bar. */
		...

		/* Move to the target passage. */
		<<goto "Library">>
	<</timed>>
<</link>>
<<link "Option 2">>
	/* Similar code to option 1. */
<</link>>
@@

WARNING: The above code was written from memory and has not been tested, it is also missing the code required to display a Progress Bar (which could be done using the Dialog API.)

...