Jump to content

Help! Can't get trigger script to work. :(


Guest Messenjah

Recommended Posts

Guest Messenjah

So, what I am trying to accomplish, is I want some stage lights to turn on when Hadrian walks onto the stage for his comedy performance and for the lights to then turn off when he exits the stage and remain off no matter what, unless he returns to the stage.

 

I've tried setting up a GameHours script to turn the lights on and off between certain hours but that doesn't seem to work. The light simply remains on. So, I tried poking around inside the TopsPerformar scripts and quests. I found that it is a very complicated system so I opted for a simple solution. I would create a trigger on-stage that when Hadrian enters, the trigger would enable a light and when he exits, the light would become disabled. The light will enable when he walks on the stage but it remains on and WILL NOT SHUT OFF!!

 

Here is my current script:

 

scn WranglerStageLights

Begin OnTriggerEnter HadrianREF

If (IsActionREF HadrianREF == 1)
	WStageLightsREF.enable

else

WStageLightsREF.disable

Endif
End


 

 

I'm not sure why this won't work.

Link to comment
Share on other sites

Guest Messenjah

Wow! Quick reply!

 

 

I tried it but it won't allow me to save the script. :(

 

I did get this to work but there is a problem:

 

scn WranglerStageLights

begin OnTriggerEnter Player

If WStageLightsREF.getdisabled
WStageLightsREF.Enable
SetOpenState 1

else

WStageLightsREF.disable
SetOpenState 0
endif

End

 

The PROBLEM is that now, it will activate when he walks on stage but it will not disable the light when he walks off. However, if the player walks on stage, the light will disable. :\

Link to comment
Share on other sites

You are getting mixed results with both Hadrian and the player activating your trigger, I would say, because you've been changing your script so much. Have you started over your testing with a clean save? I think you should to get a clear response to what you have done last. And you need to rewrite your script again if you want Hadrian to be the one activating it and I would do that before the clean save so you can see what he does. This last version has the player doing it:

 

begin OnTriggerEnter Player

 

:) llama

Link to comment
Share on other sites

Guest Messenjah

Yeah, I finally figured out what was wrong. I rewrote the script so many times today I felt like I was going insane lol. Turns out Quetzlsacatanango was correct but there was error in his script. Instead of: Begin OnTriggerExit HadrianRef

it was supposed to be: Begin OnTriggerLeave HadrianREF

 

Works a lot better now. :) Thanks guys! I have another script I've got to get going though, this one was a modified script written by Drayk_Cannon for this mod. It is a custom disco ball script.

 

 

 scn DBDiscoBallScript

short LightSwitch
short LightsOn
float MyPosX
float MyPosY
float MyPosZ
float MyGround
ref Myself

;bounding box for Spots
short Xmin
short Xmax
short Ymin
short Ymax
short Zmin
short Zmax

;use integer 3D space for transforms
short CurrentSpot
short CurrentSpotX
short CurrentSpotY
short CurrentSpotZ
short CurrentTrackLight
short CurrentTrackLight2
short CurrentTrackLight3
short CurrentTrackX
short CurrentTrackY
short CurrentTrackZ
short CurrentTrackRandomAngle
short CurrentTrackTransform
short CurrentTrackTransformDirection

float TrackTimeMax
float CurrentTrackTime
float CurrentTrackTime2
float CurrentTrackTime3
float TrackTime
float TrackTime2
float TrackTime3

begin Gamemode


if LightSwitch == 0
if LightsOn == 1 ; Clean-Up
	DBDiscoLights1.Disable
	DBDiscoLights1.Moveto DBXMarker
	DBLightBeamBlue0.Disable
	DBLightBeamGreen0.Disable
	DBLightBeamOrange0.Disable
	DBLightBeamPink0.Disable
	DBLightBeamPurple0.Disable
	DBLightBeamRed0.Disable
	DBLightBeamTeal0.Disable
	DBLightBeamYellow0.Disable
	DBLightBeamBlue0.Moveto DBXMarker
	DBLightBeamGreen0.Moveto DBXMarker
	DBLightBeamOrange0.Moveto DBXMarker
	DBLightBeamPink0.Moveto DBXMarker
	DBLightBeamPurple0.Moveto DBXMarker
	DBLightBeamRed0.Moveto DBXMarker
	DBLightBeamTeal0.Moveto DBXMarker
	DBLightBeamYellow0.Moveto DBXMarker
	DBSpotLightRed0.Disable
	DBSpotLightGreen0.Disable
	DBSpotLightBlue0.Disable
	DBSpotLightYellow0.Disable
	DBSpotLightOrange0.Disable
	DBSpotLightPurple0.Disable
	DBSpotLightTeal0.Disable
	DBSpotLightPink0.Disable
	DBSpotLightRed0.Moveto DBXMarker
	DBSpotLightGreen0.Moveto DBXMarker
	DBSpotLightBlue0.Moveto DBXMarker
	DBSpotLightYellow0.Moveto DBXMarker
	DBSpotLightOrange0.Moveto DBXMarker
	DBSpotLightPurple0.Moveto DBXMarker
	DBSpotLightTeal0.Moveto DBXMarker
	DBSpotLightPink0.Moveto DBXMarker
	set LightsOn to 0
elseif getdistance Player < 1280
	set LightSwitch to 1
endif
endif

if LightSwitch == 0
return
elseif LightSwitch == 1

; Initial Setup
Set Myself to GetSelf
Set MyPosX to ( GetPos X )
Set MyPosY to ( GetPos Y )
Set MyPosZ to ( GetPos Z )
if isininterior == 0
	Set MyGround to ( MyPosZ - 200 )
	set Zmin to ( MyPosZ - 200 )
else
	set MyGround to ( MyPosZ - 150 )
	set Zmin to ( MyPosZ - 150 )
endif
Set Xmin to ( MyPosX - 640 )
Set Xmax to ( MyPosX + 640 )
Set Ymin to ( MyPosY - 640 )
Set Ymax to ( MyPosY + 640 )
Set Zmax to ( MyPosZ + 240 )
Set TrackTimeMax to 0.03

; This makes the Disco Ball "Glow"
DBLightWhiteGlow0.MoveTo Myself
DBLightWhiteGlow0.Enable

; These Light Beams rotate with the Disco Ball
DBDiscoLights1.MoveTo Myself
DBDiscoLights1.Enable

Set LightsOn to 1
Set LightSwitch to 2
endif

; When LightsOn is 1, we are animating the light beams and moving the spot lights
if LightsOn == 1
	if CurrentTrackTime < TrackTime
		Set CurrentTrackTime to CurrentTrackTime + GetSecondsPassed
	else
		if CurrentTrackLight == 0
			DBLightBeamBlue0.Disable
			DBLightBeamBlue0.MoveTo DBXMarker
		elseif CurrentTrackLight == 1
			DBLightBeamGreen0.Disable
			DBLightBeamGreen0.MoveTo DBXMarker
		elseif CurrentTrackLight == 2
			DBLightBeamOrange0.Disable
			DBLightBeamOrange0.MoveTo DBXMarker
		elseif CurrentTrackLight == 3
			DBLightBeamPink0.Disable
			DBLightBeamPink0.MoveTo DBXMarker
		elseif CurrentTrackLight == 4
			DBLightBeamPurple0.Disable
			DBLightBeamPurple0.MoveTo DBXMarker
		elseif CurrentTrackLight == 5
			DBLightBeamRed0.Disable
			DBLightBeamRed0.MoveTo DBXMarker
		elseif CurrentTrackLight == 6
			DBLightBeamTeal0.Disable
			DBLightBeamTeal0.MoveTo DBXMarker
		elseif CurrentTrackLight == 7
			DBLightBeamYellow0.Disable
			DBLightBeamYellow0.MoveTo DBXMarker
		endif
		Set TrackTime to ( TrackTimeMax * GetRandomPercent )
		Set CurrentTrackTime to 0
		Set CurrentTrackLight to ( 0.081 * GetRandomPercent )
		Set CurrentTrackTransform to GetRandomPercent ;X/Y/Z/XYZ, 5/5/5/85%
		Set CurrentTrackTransformDirection to GetRandomPercent ;+/-, 50%
	endif

	if CurrentTrackTime2 < TrackTime2
		Set CurrentTrackTime2 to CurrentTrackTime2 + GetSecondsPassed
	else
		if CurrentTrackLight2 == 0
			DBLightBeamBlue0.Disable
			DBLightBeamBlue0.MoveTo DBXMarker
		elseif CurrentTrackLight2 == 1
			DBLightBeamGreen0.Disable
			DBLightBeamGreen0.MoveTo DBXMarker
		elseif CurrentTrackLight2 == 2
			DBLightBeamOrange0.Disable
			DBLightBeamOrange0.MoveTo DBXMarker
		elseif CurrentTrackLight2 == 3
			DBLightBeamPink0.Disable
			DBLightBeamPink0.MoveTo DBXMarker
		elseif CurrentTrackLight2 == 4
			DBLightBeamPurple0.Disable
			DBLightBeamPurple0.MoveTo DBXMarker
		elseif CurrentTrackLight2 == 5
			DBLightBeamRed0.Disable
			DBLightBeamRed0.MoveTo DBXMarker
		elseif CurrentTrackLight2 == 6
			DBLightBeamTeal0.Disable
			DBLightBeamTeal0.MoveTo DBXMarker
		elseif CurrentTrackLight2 == 7
			DBLightBeamYellow0.Disable
			DBLightBeamYellow0.MoveTo DBXMarker
		endif
		Set TrackTime2 to ( TrackTimeMax * GetRandomPercent )
		Set CurrentTrackTime2 to 0
		Set CurrentTrackLight2 to ( 0.081 * GetRandomPercent )
		Set CurrentTrackTransform to GetRandomPercent
		Set CurrentTrackTransformDirection to GetRandomPercent
	endif

	if CurrentTrackTime3 < TrackTime3
		Set CurrentTrackTime3 to CurrentTrackTime3 + GetSecondsPassed
	else
		if CurrentTrackLight3 == 0
			DBLightBeamBlue0.Disable
			DBLightBeamBlue0.MoveTo DBXMarker
		elseif CurrentTrackLight3 == 1
			DBLightBeamGreen0.Disable
			DBLightBeamGreen0.MoveTo DBXMarker
		elseif CurrentTrackLight3 == 2
			DBLightBeamOrange0.Disable
			DBLightBeamOrange0.MoveTo DBXMarker
		elseif CurrentTrackLight3 == 3
			DBLightBeamPink0.Disable
			DBLightBeamPink0.MoveTo DBXMarker
		elseif CurrentTrackLight3 == 4
			DBLightBeamPurple0.Disable
			DBLightBeamPurple0.MoveTo DBXMarker
		elseif CurrentTrackLight3 == 5
			DBLightBeamRed0.Disable
			DBLightBeamRed0.MoveTo DBXMarker
		elseif CurrentTrackLight3 == 6
			DBLightBeamTeal0.Disable
			DBLightBeamTeal0.MoveTo DBXMarker
		elseif CurrentTrackLight3 == 7
			DBLightBeamYellow0.Disable
			DBLightBeamYellow0.MoveTo DBXMarker
		endif
		Set TrackTime3 to ( TrackTimeMax * GetRandomPercent )
		Set CurrentTrackTime3 to 0
		Set CurrentTrackLight3 to ( 0.081 * GetRandomPercent )
		Set CurrentTrackTransform to GetRandomPercent
		Set CurrentTrackTransformDirection to GetRandomPercent
	endif

	if CurrentTrackLight == 0 || CurrentTrackLight2 == 0 || CurrentTrackLight3 == 0
		if DBLightBeamBlue0.GetDisabled == 1
			DBLightBeamBlue0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamBlue0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamBlue0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamBlue0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamBlue0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamBlue0.GetAngle X + 1
				DBLightBeamBlue0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamBlue0.GetAngle X - 1
				DBLightBeamBlue0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamBlue0.GetAngle Y + 1
				DBLightBeamBlue0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamBlue0.GetAngle Y - 1
				DBLightBeamBlue0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamBlue0.GetAngle Z + 1
				DBLightBeamBlue0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamBlue0.GetAngle Z - 1
				DBLightBeamBlue0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamBlue0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamBlue0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamBlue0.GetAngle Z + 1
				DBLightBeamBlue0.SetAngle X CurrentTrackX
				DBLightBeamBlue0.SetAngle Y CurrentTrackY
				DBLightBeamBlue0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamBlue0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamBlue0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamBlue0.GetAngle Z - 1
				DBLightBeamBlue0.SetAngle X CurrentTrackX
				DBLightBeamBlue0.SetAngle Y CurrentTrackY
				DBLightBeamBlue0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	if CurrentTrackLight == 1 || CurrentTrackLight2 == 1 || CurrentTrackLight3 == 1
		if DBLightBeamGreen0.GetDisabled == 1
			DBLightBeamGreen0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamGreen0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamGreen0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamGreen0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamGreen0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamGreen0.GetAngle X + 1
				DBLightBeamGreen0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamGreen0.GetAngle X - 1
				DBLightBeamGreen0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamGreen0.GetAngle Y + 1
				DBLightBeamGreen0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamGreen0.GetAngle Y - 1
				DBLightBeamGreen0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamGreen0.GetAngle Z + 1
				DBLightBeamGreen0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamGreen0.GetAngle Z - 1
				DBLightBeamGreen0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamGreen0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamGreen0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamGreen0.GetAngle Z - 1
				DBLightBeamGreen0.SetAngle X CurrentTrackX
				DBLightBeamGreen0.SetAngle Y CurrentTrackY
				DBLightBeamGreen0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamGreen0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamGreen0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamGreen0.GetAngle Z + 1
				DBLightBeamGreen0.SetAngle X CurrentTrackX
				DBLightBeamGreen0.SetAngle Y CurrentTrackY
				DBLightBeamGreen0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	if CurrentTrackLight == 2 || CurrentTrackLight2 == 2 || CurrentTrackLight3 == 2
		if DBLightBeamOrange0.GetDisabled == 1
			DBLightBeamOrange0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamOrange0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamOrange0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamOrange0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamOrange0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamOrange0.GetAngle X + 1
				DBLightBeamOrange0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamOrange0.GetAngle X - 1
				DBLightBeamOrange0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamOrange0.GetAngle Y + 1
				DBLightBeamOrange0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamOrange0.GetAngle Y - 1
				DBLightBeamOrange0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamOrange0.GetAngle Z + 1
				DBLightBeamOrange0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamOrange0.GetAngle Z - 1
				DBLightBeamOrange0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamOrange0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamOrange0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamOrange0.GetAngle Z + 1
				DBLightBeamOrange0.SetAngle X CurrentTrackX
				DBLightBeamOrange0.SetAngle Y CurrentTrackY
				DBLightBeamOrange0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamOrange0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamOrange0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamOrange0.GetAngle Z - 1
				DBLightBeamOrange0.SetAngle X CurrentTrackX
				DBLightBeamOrange0.SetAngle Y CurrentTrackY
				DBLightBeamOrange0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	if CurrentTrackLight == 3 || CurrentTrackLight2 == 3 || CurrentTrackLight3 == 3
		if DBLightBeamPink0.GetDisabled == 1
			DBLightBeamPink0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamPink0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamPink0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamPink0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamPink0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamPink0.GetAngle X + 1
				DBLightBeamPink0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamPink0.GetAngle X - 1
				DBLightBeamPink0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamPink0.GetAngle Y + 1
				DBLightBeamPink0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamPink0.GetAngle Y - 1
				DBLightBeamPink0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamPink0.GetAngle Z + 1
				DBLightBeamPink0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamPink0.GetAngle Z - 1
				DBLightBeamPink0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamPink0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamPink0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamPink0.GetAngle Z - 1
				DBLightBeamPink0.SetAngle X CurrentTrackX
				DBLightBeamPink0.SetAngle Y CurrentTrackY
				DBLightBeamPink0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamPink0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamPink0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamPink0.GetAngle Z + 1
				DBLightBeamPink0.SetAngle X CurrentTrackX
				DBLightBeamPink0.SetAngle Y CurrentTrackY
				DBLightBeamPink0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	if CurrentTrackLight == 4 || CurrentTrackLight2 == 4 || CurrentTrackLight3 == 4
		if DBLightBeamPurple0.GetDisabled == 1
			DBLightBeamPurple0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamPurple0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamPurple0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamPurple0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamPurple0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamPurple0.GetAngle X + 1
				DBLightBeamPurple0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamPurple0.GetAngle X - 1
				DBLightBeamPurple0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamPurple0.GetAngle Y + 1
				DBLightBeamPurple0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamPurple0.GetAngle Y - 1
				DBLightBeamPurple0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamPurple0.GetAngle Z + 1
				DBLightBeamPurple0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamPurple0.GetAngle Z - 1
				DBLightBeamPurple0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamPurple0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamPurple0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamPurple0.GetAngle Z + 1
				DBLightBeamPurple0.SetAngle X CurrentTrackX
				DBLightBeamPurple0.SetAngle Y CurrentTrackY
				DBLightBeamPurple0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamPurple0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamPurple0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamPurple0.GetAngle Z - 1
				DBLightBeamPurple0.SetAngle X CurrentTrackX
				DBLightBeamPurple0.SetAngle Y CurrentTrackY
				DBLightBeamPurple0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	if CurrentTrackLight == 5 || CurrentTrackLight2 == 5 || CurrentTrackLight3 == 5
		if DBLightBeamRed0.GetDisabled == 1
			DBLightBeamRed0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamRed0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamRed0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamRed0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamRed0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamRed0.GetAngle X + 1
				DBLightBeamRed0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamRed0.GetAngle X - 1
				DBLightBeamRed0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamRed0.GetAngle Y + 1
				DBLightBeamRed0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamRed0.GetAngle Y - 1
				DBLightBeamRed0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamRed0.GetAngle Z + 1
				DBLightBeamRed0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamRed0.GetAngle Z - 1
				DBLightBeamRed0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamRed0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamRed0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamRed0.GetAngle Z - 1
				DBLightBeamRed0.SetAngle X CurrentTrackX
				DBLightBeamRed0.SetAngle Y CurrentTrackY
				DBLightBeamRed0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamRed0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamRed0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamRed0.GetAngle Z + 1
				DBLightBeamRed0.SetAngle X CurrentTrackX
				DBLightBeamRed0.SetAngle Y CurrentTrackY
				DBLightBeamRed0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	if CurrentTrackLight == 6 || CurrentTrackLight2 == 6 || CurrentTrackLight3 == 6
		if DBLightBeamTeal0.GetDisabled == 1
			DBLightBeamTeal0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamTeal0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamTeal0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamTeal0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamTeal0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamTeal0.GetAngle X + 1
				DBLightBeamTeal0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamTeal0.GetAngle X - 1
				DBLightBeamTeal0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamTeal0.GetAngle Y + 1
				DBLightBeamTeal0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamTeal0.GetAngle Y - 1
				DBLightBeamTeal0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamTeal0.GetAngle Z + 1
				DBLightBeamTeal0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamTeal0.GetAngle Z - 1
				DBLightBeamTeal0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamTeal0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamTeal0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamTeal0.GetAngle Z + 1
				DBLightBeamTeal0.SetAngle X CurrentTrackX
				DBLightBeamTeal0.SetAngle Y CurrentTrackY
				DBLightBeamTeal0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamTeal0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamTeal0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamTeal0.GetAngle Z - 1
				DBLightBeamTeal0.SetAngle X CurrentTrackX
				DBLightBeamTeal0.SetAngle Y CurrentTrackY
				DBLightBeamTeal0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	if CurrentTrackLight == 7 || CurrentTrackLight2 == 7 || CurrentTrackLight3 == 7
		if DBLightBeamYellow0.GetDisabled == 1
			DBLightBeamYellow0.MoveTo Myself
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamYellow0.SetAngle X CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamYellow0.SetAngle Y CurrentTrackRandomAngle
			Set CurrentTrackRandomAngle to ( 3.6 * GetRandomPercent )
			DBLightBeamYellow0.SetAngle Z CurrentTrackRandomAngle
			DBLightBeamYellow0.Enable
		endif
		if CurrentTrackTransform < 5
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamYellow0.GetAngle X + 1
				DBLightBeamYellow0.SetAngle X CurrentTrackX
			else
				Set CurrentTrackX to DBLightBeamYellow0.GetAngle X - 1
				DBLightBeamYellow0.SetAngle X CurrentTrackX
			endif
		elseif ( CurrentTrackTransform >= 5 ) && ( CurrentTrackTransform < 10 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackY to DBLightBeamYellow0.GetAngle Y + 1
				DBLightBeamYellow0.SetAngle Y CurrentTrackY
			else
				Set CurrentTrackY to DBLightBeamYellow0.GetAngle Y - 1
				DBLightBeamYellow0.SetAngle Y CurrentTrackY
			endif
		elseif ( CurrentTrackTransform >= 10 ) && ( CurrentTrackTransform < 15 )
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackZ to DBLightBeamYellow0.GetAngle Z + 1
				DBLightBeamYellow0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackZ to DBLightBeamYellow0.GetAngle Z - 1
				DBLightBeamYellow0.SetAngle Z CurrentTrackZ
			endif
		else
			if CurrentTrackTransformDirection < 50
				Set CurrentTrackX to DBLightBeamYellow0.GetAngle X - 1
				Set CurrentTrackY to DBLightBeamYellow0.GetAngle Y - 1
				Set CurrentTrackZ to DBLightBeamYellow0.GetAngle Z - 1
				DBLightBeamYellow0.SetAngle X CurrentTrackX
				DBLightBeamYellow0.SetAngle Y CurrentTrackY
				DBLightBeamYellow0.SetAngle Z CurrentTrackZ
			else
				Set CurrentTrackX to DBLightBeamYellow0.GetAngle X + 1
				Set CurrentTrackY to DBLightBeamYellow0.GetAngle Y + 1
				Set CurrentTrackZ to DBLightBeamYellow0.GetAngle Z + 1
				DBLightBeamYellow0.SetAngle X CurrentTrackX
				DBLightBeamYellow0.SetAngle Y CurrentTrackY
				DBLightBeamYellow0.SetAngle Z CurrentTrackZ
			endif
		endif
	endif

	;15% chance of moving a light
	if GetRandomPercent > 15
		Return
	endif

	Set CurrentSpot to ( 0.081 * GetRandomPercent )
	Set CurrentSpotX to Xmin + GetRandomPercent * ( Xmax - Xmin ) / 99
	Set CurrentSpotY to Ymin + GetRandomPercent * ( Ymax - Ymin ) / 99
	Set CurrentSpotZ to Zmin + GetRandomPercent * ( Zmax - Zmin ) / 99

	if CurrentSpot == 0
		DBSpotLightRed0.Disable
		DBSpotLightRed0.MoveTo Myself
		DBSpotLightRed0.SetPos X CurrentSpotX
		DBSpotLightRed0.SetPos Y CurrentSpotY
		DBSpotLightRed0.SetPos Z CurrentSpotZ
		DBSpotLightRed0.Enable
	elseif CurrentSpot == 1
		DBSpotLightGreen0.Disable
		DBSpotLightGreen0.MoveTo Myself
		DBSpotLightGreen0.SetPos X CurrentSpotX
		DBSpotLightGreen0.SetPos Y CurrentSpotY
		DBSpotLightGreen0.SetPos Z CurrentSpotZ
		DBSpotLightGreen0.Enable
	elseif CurrentSpot == 2
		DBSpotLightBlue0.Disable
		DBSpotLightBlue0.MoveTo Myself
		DBSpotLightBlue0.SetPos X CurrentSpotX
		DBSpotLightBlue0.SetPos Y CurrentSpotY
		DBSpotLightBlue0.SetPos Z CurrentSpotZ
		DBSpotLightBlue0.Enable
	elseif CurrentSpot == 3
		DBSpotLightYellow0.Disable
		DBSpotLightYellow0.MoveTo Myself
		DBSpotLightYellow0.SetPos X CurrentSpotX
		DBSpotLightYellow0.SetPos Y CurrentSpotY
		DBSpotLightYellow0.SetPos Z CurrentSpotZ
		DBSpotLightYellow0.Enable
	elseif CurrentSpot == 4
		DBSpotLightOrange0.Disable
		DBSpotLightOrange0.MoveTo Myself
		DBSpotLightOrange0.SetPos X CurrentSpotX
		DBSpotLightOrange0.SetPos Y CurrentSpotY
		DBSpotLightOrange0.SetPos Z CurrentSpotZ
		DBSpotLightOrange0.Enable
	elseif CurrentSpot == 5
		DBSpotLightPurple0.Disable
		DBSpotLightPurple0.MoveTo Myself
		DBSpotLightPurple0.SetPos X CurrentSpotX
		DBSpotLightPurple0.SetPos Y CurrentSpotY
		DBSpotLightPurple0.SetPos Z CurrentSpotZ
		DBSpotLightPurple0.Enable
	elseif CurrentSpot == 6
		DBSpotLightTeal0.Disable
		DBSpotLightTeal0.MoveTo Myself
		DBSpotLightTeal0.SetPos X CurrentSpotX
		DBSpotLightTeal0.SetPos Y CurrentSpotY
		DBSpotLightTeal0.SetPos Z CurrentSpotZ
		DBSpotLightTeal0.Enable
	elseif CurrentSpot == 7
		DBSpotLightPink0.Disable
		DBSpotLightPink0.MoveTo Myself
		DBSpotLightPink0.SetPos X CurrentSpotX
		DBSpotLightPink0.SetPos Y CurrentSpotY
		DBSpotLightPink0.SetPos Z CurrentSpotZ
		DBSpotLightPink0.Enable
	endif
endif
endif

end

 

What I need is for the script to work as an activator so I can also activate and deactivate it with the same switch. Any ideas? I haven't been able to get a hold of the author in quite a few months. He actually developed the script for the original version of my mod when it was being developed for FO3.

Edited by Messenjah
Link to comment
Share on other sites

  • Recently Browsing   0 members

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