Timer script fails to reset

Post » Mon May 09, 2011 3:26 pm

I have this script set on a trigger under my http://www.fallout3nexus.com/downloads/file.php?id=13638 and it counts down the ten seconds fine the first time you step under the running shower, which gives you the "Showered" perk which lasts for 12 hours just like the Well Rested perk, but the next time you get in the shower it immediately gives you the Showered perk instead of counting down the ten seconds. What am I missing?

scn ShowerTriggerEffectScriptfloat showertimerBegin OnTrigger player	if player.HasPerk ShoweredPerk == 1	else   	if showertimer < 10   		set showertimer to showertimer + GetSecondsPassed	else      		player.CastImmediateOnSelf ShoweredSpell		set showertimer to 0   	endifendifend

User avatar
jessica breen
 
Posts: 3524
Joined: Thu Aug 03, 2006 1:04 am

Post » Mon May 09, 2011 2:08 am

Nevermind, too tired...
User avatar
James Baldwin
 
Posts: 3366
Joined: Tue Jun 05, 2007 11:11 am

Post » Mon May 09, 2011 1:02 pm

Does OnTrigger even return a value for GetSecondsPassed? You're probably better off using OnTriggerEnter and OnTriggerLeave to set a variable, and when it's set have a gamemode block check if the shower's been going long enough.
User avatar
Nichola Haynes
 
Posts: 3457
Joined: Tue Aug 01, 2006 4:54 pm

Post » Mon May 09, 2011 10:05 am

Does OnTrigger even return a value for GetSecondsPassed? You're probably better off using OnTriggerEnter and OnTriggerLeave to set a variable, and when it's set have a gamemode block check if the shower's been going long enough.


This works now; thanks TheTalkieToaster

scn ShowerTriggerEffectScriptfloat showertimershort showeredBegin OnTrigger player	if player.HasPerk ShoweredPerk == 1		else	set showered to 1endifendBegin GameMode	if showered == 1   		if showertimer < 10   			set showertimer to showertimer + GetSecondsPassed		else      			player.CastImmediateOnSelf ShoweredSpell			set showertimer to 0			set showered to 0   	endifendifend

User avatar
My blood
 
Posts: 3455
Joined: Fri Jun 16, 2006 8:09 am


Return to Fallout 3