Script repeating functions?

Post » Tue Oct 18, 2011 4:19 am

So, recently I've been trying to make a vampire mod and one of the scripts I'm using seems to repeat the first function (StartQuest), I realise that I'm trying to start the same quest each time but I need it to start at different times, hence this script. I've tried putting an or function insted of an and function on the time conditions but this seems to just make the second condition repeat itself too, if anyone could tell me what I'm doing wrong I'd be very appreciative.

Scn DSVampireTimeEffectsControllerQuestScriptShort DoOnceBegin GameMode	If ( GetGlobalValue GameHour >= 6 ) && ( GetGlobalValue GameHour < 18 )	If ( DoOnce != 1 )		StartQuest DSVampireTimeEffectsQuest		Set DoOnce to 1Else		StartQuest DSVampireTimeEffectsQuest		Set DoOnce to 0		Endif	EndifEnd

User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Tue Oct 18, 2011 5:09 am

Your conditional logic is completely flawed. What you currently have says the following:
if ( time of day is between 6 am and 6 pm )   do stuffendif

The inner DoOnce check is doing nothing, because it's simply flipping every cycle.

What you need would look more like this:
if ( time of day is between 6 am and 6 pm and DoOnce <= 0 )   do stuff   Set DoOnce to 1elseif ( time of day is between 6 pm and 6 am and DoOnce >= 0 )   do stuff   Set DoOnce to -1endif


This will tie your DoOnce check to your time of day check, so it only fires once each time the time of day switches.

Queue
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm


Return to Fallout: New Vegas