Page 1 of 1

Chaining Quest Timers

Posted: Thu Oct 05, 2017 3:33 am
by Interkarma
This is a new bit of script support I had to build for Sx012. It allows quest author to set a one-way clock timer based on distance to target from wherever player is at the time clock is started.

To use this, create a Place resource and Clock resource like so:

Code: Select all

Place _palace_ remote palace
Clock _2palace_ 00:00 0 flag 1 range 0 2
Note how the inner part of both symbols is just "palace". When creating a Clock resource with a 00:00 time value and the _2 prefix, the actual time is calculated as a one-way cautious trip to destination from wherever player is when clock is started.

If there is any text associated with the Clock, be sure to start the timer running before emitting any text:

Code: Select all

_S.03_ task:
	clicked npc _dispatcher_ 
	start timer _2palace_ 
	log 1011 step 1 
	say 1020
This would allow quest author to chain together timers from A -> B -> C and set appropriate travel time from point-to-point, even with random locations, as the travel time is only computed when the Clock is started.

It might also be a good idea to give player an extra bit of time at the other end. Sx012 does this by first starting the _2palace_ timer. When _2palace_ runs out, its target task starts another 2-day (fixed) timer and creates an NPC. When the fixed timer runs out, quest will end. This gives player another 2 days on top of their travel time to complete task at that location.

Code: Select all

_2palace_ task:
	start timer _S.07_ 
	place npc _messenger_ at _palace_ 

Re: Chaining Quest Timers

Posted: Thu Oct 05, 2017 3:36 am
by Jay_H
This is awesome! This'll be a great improvement on what I've been doing! Thank you! :D

Re: Chaining Quest Timers

Posted: Thu Oct 05, 2017 4:53 am
by Midknightprince
The man is a genius :D

Re: Chaining Quest Timers

Posted: Fri Mar 23, 2018 7:11 pm
by Jay_H
By the way, is there any existing explanation on how the timer variable works? I've just been copying and pasting up until now, but sometimes the time limits are really strict and other times more lenient. I don't know what the flag and range factors are.

Re: Chaining Quest Timers

Posted: Mon Jan 07, 2019 7:14 pm
by pango
Jay_H wrote: Fri Mar 23, 2018 7:11 pm By the way, is there any existing explanation on how the timer variable works? I've just been copying and pasting up until now, but sometimes the time limits are really strict and other times more lenient. I don't know what the flag and range factors are.
For the record, the best description to date is in https://forums.dfworkshop.net/viewtopic ... 384#p19383