Can someone please explain why this timer script doesn't wor

Post » Tue Mar 15, 2011 2:04 am

I've used timers dozens upon dozens of times and now this script does not work, the timer doesn't work. The action happens immediately.

scn Scriptshort timershort dooncebegin gamemodeif doonce != 1set timer to 60set doonce to 1endifif timer > 0set timer to timer - getsecondspassedelsestartconversation playerendifend


It's on an NPC. I'm stumped to the fact that I think I broke the CS, Oblivion, the internet, etc.
User avatar
Camden Unglesbee
 
Posts: 3467
Joined: Wed Aug 15, 2007 8:30 am

Post » Mon Mar 14, 2011 9:51 pm

scn ObjectScriptFloat fTimer ; Should be a float variableInt iStage ; Like a DoOnce with a tailBegin GameMode		If (iStage == 2)		Return ; Reduce 'cost' when NPC is loaded after the code has done its thing	ElseIf (iStage == 1)		If (fTimer <= 0) ; '<=' vs. '>' operator			Set fTimer to 0			Set iStage to 2			StartConversation Player		Else			Set fTimer to (fTimer - GetSecondsPassed) ; Count down from 60		End	Else		Set iStage to 1		Set fTimer to 60			EndIf	End


p.s. It appears the internet is still alive! :P
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Mon Mar 14, 2011 1:10 pm

I'm an idiot. Just changing the timer var to a float fixed everything. I'm up way too late.

Thanks!
User avatar
Rachel Briere
 
Posts: 3438
Joined: Thu Dec 28, 2006 9:09 am


Return to IV - Oblivion