Chaining Quest Timers
Posted: Thu Oct 05, 2017 3:33 am
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:
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:
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.
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
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
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_