Jump to content

Script help needed


Dracomies

Recommended Posts

It depends on how you want to do it, with a quest or with a trigger volume. The latter is better if this dialogue is always going to occur in the same cell as you can just disable and delete the volume to stop the script from running, as well as it only running if your in the same cell. With a quest it will bog down the quest chain, but you can always start and stop the quest too, it depends on how you want to implement it.

 

For a quest it will be a quest script, and for a trigger volume it will be an object script. If you use a trigger, it just has to be in the same cell and out of the way somewhere. I set them to 2 units wide to cut down on collision checking overhead.

 

The scripting is fairly simple, it some cascaded stages to run the image space modifiers and a timer to let the fade out complete before doing your npc stuff. Hope this helps.

scn fadetoblackscript

int iStage
float fTimer

begin gamemode

	if iStage == 1				; if iStage is 1 start fade out, set timer and set next stage
		imod FadeToBlack2sISFX
		set iStage to 2
		set fTimer to 2
	endif
	
	if iStage == 2				; if iStage is 2 wait for time out then do NPC stuff and set next stage
		if fTimer < 0
			; do npc stuff
			set iStage to 3
		else
			set fTimer to fTimer - GetSecondsPassed
		endif
	endif
	
	if iStage == 3				; if iStage is 3 start fade in and set next stage to comeplete sequence
		imod FadeInFromBlack2sISFX
		set iStage to 4
		;disable			; uncomment this if you use a trigger volume instead of a quest
		;markfordelete
	endif
	
End
Link to comment
Share on other sites

  • Recently Browsing   0 members

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