Jump to content

problem with SetQuestDelay


stevie70

Recommended Posts

edit: SOLVED

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 

i'm having a problem with SetQuestDelay:

i basically have a scripted activator as a switch and a quest to control stuff using a gamemode quest script.

"switch on" starts the quest with a delay 10 seconds which is enough for what it does.

"switch off" should set the delay to 0.1 (or something alike) because i need to react the "off"-function immediately, and then stop the quest.

 

everything in the whole setup works perfectly, except one thing: the delay is obviously never set to 0.1, it takes up to 10sec until the actual "switching off", whatever i do (changing the delay value in the quest data tab works, the whole thing uses whatever i set there or 5sec if i set nothing, but it don't want to have it running at 0.1 all the time, runs pretty long)

it _does_ stop the quest like it should though, and that's the same if-block, so my conditioning should be alright.

 

i'm posting the activator script as well as the quest script, stripped them down of anything but quest-relevant commands and conditioning, marked deleted parts with (...) just in case you're wondering what this should do.

hope somebody can help, i'm all clueless by now.

 

the activator script (it's the third if-block where it sets the delay):

scn s7oIFP01actiReyGeneratorSCRIPT

int GeneratorDiesel
int GeneratorPower


begin OnActivate 
if ( IsActionRef player == 1 )
	set GeneratorDiesel to s7oIFP01masterReyGeneratorQuest.GeneratorDiesel
	set GeneratorPower to s7oIFP01masterReyGeneratorQuest.GeneratorPower

	if ( GeneratorPower == 0 ) && ( GeneratorDiesel == 0 )
		(...)
		endif

	elseif ( GeneratorPower == 0 ) && ( GeneratorDiesel > 0 )
		set GeneratorPower to 1
		set s7oIFP01masterReyGeneratorQuest.GeneratorPower to 1
		(...)
		SetQuestDelay s7oIFP01masterReyGeneratorQuest 10
		StartQuest s7oIFP01masterReyGeneratorQuest

	elseif ( GeneratorPower == 1 )
		SetQuestDelay s7oIFP01masterReyGeneratorQuest 0.1
		set s7oIFP01masterReyGeneratorQuest.GeneratorPower to 0
		(...)
	endif
endif
end

 

and the quest script:

scn s7oIFP01masterReyGeneratorQuestSCRIPT


int GeneratorPower
int GeneratorDiesel


begin GameMode
if ( GeneratorPower == 1 ) && ( GeneratorDiesel > 0 )
	(...)
	endif
endif

if ( GeneratorPower == 1 ) && ( GeneratorDiesel == 0 )
	(...)
	set GeneratorPower to 0
endif

if ( GeneratorPower == 0 )
	set s7oIFP01actiReyGeneratorREF.GeneratorPower to 0
	(...)
	SetQuestDelay s7oIFP01masterReyGeneratorQuest 10
	StopQuest s7oIFP01masterReyGeneratorQuest
endif
end

Edited by stevie70
Link to comment
Share on other sites

Declare a float called fQuestDelayTime with the rest of your variables and change this value directly with set statements. The engine uses this variable to determine quest delays and defaults to 5 if it is not declared.

cool, works, thanks a lot :-) - i'd pretty sure _never_ have come up with that.

and works with the variable settings in exactly the same places the setquestdelay-commands were and all the rest of the script untouched, can't say i understood that, but anyway, spent more than enough time thinking about that particular thingie already, thx again

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...