Jump to content

Activation timing after enabling a reference.


mindboggles

Recommended Posts

I've got a sequence where the player enters a trigger box, a few effects are triggered and an activator is enabled. The activator is animated and doesn't start the animation until I tell it a little while later to activate, I got the timing working such that it runs reliably on my machine but my mod partner who is testing it is having issues with it not starting the animation. It appears to be this delay between enabling it and then triggering the animation as the issue.

Link to comment
Share on other sites

I'm setting the timing by incrementing a counter in the GameMode block and then triggering the various events when it hits certain values which I figured would sync it with the frame rate. I added an extra 10 before it triggers and he reported it triggering properly 50% of the time and after upping it another 10 it works reliably everytime.

 

Only thing I can think of is that maybe it is tied up with available memory???? the nif I made myself and it's about 500K with lots of keyframes. I'll try some stream lining, reduce the texture resolution and cull vertices see if that makes a difference.

Link to comment
Share on other sites

I'm counting frames wanting it to be reliable even if a machine was chugging.

 


Scn CRClaptrapFlightTriggerScript

Int bDoOnce
Int iCounter
Int bCleanup

Begin OnTriggerEnter Player

	If bDoOnce != 1
		Set bDoOnce to 1
	EndIf

End

Begin GameMode

	If bDoOnce == 1 && bCleanUp != 1
		Set iCounter to iCounter + 1

		If iCounter == 2
			CRClaptrapHowitzerPoint.PlaceAtMe CRClaptrapExplosion2 1
		EndIf

		If iCounter == 25
			CRClaptrapSoundPoint.PlaySound3D OBJCRClaptrapCannonFire
		EndIf

		If iCounter == 36
			CRClaptrapFlightRef.Enable
		EndIf

		If iCounter == 65
			CRClaptrapFlightRef.Activate Player
		EndIf

		If iCounter == 655
			CRClaptrapFlightRef.Disable
			ClaptrapDustSpot.PlaceAtMe CRClaptrapExplosion2 1
			CRClaptrapBarrelRef.Enable
			Set bCleanUp to 1
		EndIf

	EndIf

	If bCleanUp == 1
		Disable
		MarkForDelete
	EndIf

Link to comment
Share on other sites

I've found that using GetSecondsPassed works fine also. But when enabling or spawning objects, it's a good idea to make sure their 3D is loaded http://geck.bethsoft.com/index.php?title=HasLoaded3D before activating or performing animations, etc.


You can use Enable 0 to make it pop in, but I would also use HasLoaded3d to make the script wait after the enable before activating it in the next section.


In your script, at iCounter == 65, the object might not be ready on some people's computers. It's the same problem regardless of whether you use frames or seconds. You need to check the 3D but it would be easier in a staged or staged timer script format.




Begin GameMode

...<snip>

If Active ==1
if (GetDisabled)
enable 0
else
if (HasLoaded3D)
Playgroup Forward 0
Set Active to 2
endif
EndIf
EndIf

If Active ==2
If IsAnimPlaying Forward ==0
...<snip>

Link to comment
Share on other sites

Of course! Why didn't I think to check for 3D loaded, thank you. I was just a bit amazed since I thought I would have given it plenty of time to have loaded.....obviously not.

 

I can time it for optimum but have a failsafe in there.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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