How can I script a timer?

Post » Thu Mar 27, 2014 1:21 pm

Hi all.

I've seen this done somewhere on the Wiki but just can't find it now. I'd like a timer to start at a specific stage in a quest - the quest is as follows. Player has entered an inn looking for a thief. Innkeeper says "Yes, he is upstairs", at this point the upstairs door can be heard opening and closing. Player says "Was that the upstairs door just opening and closing?" (player is on the ball eh!), Innkeeper replies "Yes it was, maybe he has gone for some fresh air." Player says "Or he is running for it." Objective displays "Catch the thief before he gets away."

Now here is the point where the player could have a drink, sleep the night and whenever he decides to leave the inn the thief spawns outside. There are other ways to do this but I'd like to learn about making a timer for future use. The timer needs to start, IMO, when the objective displays and if the player doesn't leave the inn in the allotted time period then quest fails.

Advice, help and suggestions needed please.

User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm

Post » Thu Mar 27, 2014 12:35 am

If I understood correctly, I can suggest you to start a scene when you scripted the display objective.

In the start scene script add a simple wait() function and next check if the player has caught the thief. If not, fail the quest.

User avatar
Sarah Bishop
 
Posts: 3387
Joined: Wed Oct 04, 2006 9:59 pm

Post » Thu Mar 27, 2014 3:55 am

I had a timer in my auto-cast mod a while back. It took into account waiting, fast travel etc. though this was a year ago so there might be a more elegant method now.

User avatar
Justin Hankins
 
Posts: 3348
Joined: Fri Oct 26, 2007 12:36 pm


Return to V - Skyrim