Jump to content

Time nuclear explosion


Roycesraphim

Recommended Posts

So I have an XHeading marker in the distance, underwater pointing up.

 

A character is going to run up to me and have a speech, and then will set VTFIMQ2Subtrap to 1 in her dialog.

 

Ideally, I want 15 seconds to pass and then a nuclear blast to go off in the distance.

 

scn VTFIMQ2stage180boomscript

float VTFIMQ2Stage180Boomtimer
float fQuestDelayTime


begin gameMode
set fQuestDelayTime to 0.001

if VTFIMQ2Subtrap == 1
	if ( VTFIMQ2Stage180Boomtimer < 15)
		set VTFIMQ2Stage180Boomtimer + get seconds passed
	else
		VVTFIMQ2Stage180BoomTrigger.fireweapon WeapFatman
		set VTFIMQ2Subtrap == 2
	endif
endif

end

 

I adapted this code from a few different websites and hopefully it works.

Link to comment
Share on other sites

If it's timed, you will want it to run all the time. The best place for code that does that is in a Quest script, which it looks like you have.

 

So, when you end dialog, you can have a script run on dialog end that will set your quest variable. In Fallout you don't need the fQuestDelayTime, which I'm not even sure would work. There's now a function to set quest delay called, can you believe it SetQuestDelay. You actually won't need a quest delay lower than even the average (default is 5 seconds). The game keeps tracked of seconds passed and will remove them from the count with the function GetSecondsPassed.

 

So, you'd have your dialog set your explosion to start, and the timer variable to 15 or whatever time you want (you use a timer var so you can reuse it if you need another timer in your quest). You quest script, running at a nice, polite 5 second delay will have a section that looks like:

if doExplosion		;for an if statement 1=true, so you don't have to check for ==1 unless you really want to
if fTimer > 15	;fTimer is a float, and we'll count down from 15
	set fTimer to fTimer - GetSecondsPassed		;This ain't no C++, you can't do a set and an assignment at the same time :(
else
	;Do that fire weapon stuff or whatever you want to do
	;set any other things you want to set here.
	set doExplosion to 0	;or 2, or whatever you need it to 
				;be for anything else you use it for.
				;If you want to do something else after
				;these 15 seconds then you'd do something
				;like the next code block down.
endif
endif

 

To do more stuff:

if doExplosion		;for an if statement 1=true, so you don't have to check for ==1 unless you really want to
if fTimer > 15	;fTimer is a float, and we'll count down from 15
	set fTimer to fTimer - GetSecondsPassed		;This ain't no C++, you can't do a set and an assignment at the same time :(
else
	;Do that fire weapon stuff or whatever you want to do
	;set any other things you want to set here.
	set doExplosion to 2
	set fTimer to 5
endif
elseif doExplosion == 2
if fTimer > 5	;that 5 second delay
	set fTimer to fTimer - GetSecondsPassed
else
	;do some cool stuff 5 seconds after the nuke blows up
	;Maybe you could wait less time, and have the NPC
	;who initiated dialog go into flee mode because of
	;the explosion, as a reaction to the explosion.
	;Who knows what else you might do. You can string tons
	;of these things together.
	set doExplosion to 3	;set it to a final value, not back to 0.
				;By using a final value later on you can
				;check to see if this has been done or not
				;by checking if this variable equals 3
endif
endif

Link to comment
Share on other sites

  • Recently Browsing   0 members

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