Jump to content

light script help


seularts

Recommended Posts

ok so I have the following script made to activate a bunch of lights when I activate a trigger:

 

scn CTActivateAllHangarLightsScript

ref light

BEGIN OnTrigger Player
if light == 0
	set light to CTHangarLightsRef
endif

if light.GetDisabled
	light.Enable
endif
Activate
MarkForDelete;
End

 

CTHangarLightsRef is an xMarker that I set to be initially disabled and all the lights are edited to have as Enable parent the xMarker. But when I go through the trigger to activate it, the lights don't lit up. What am I doing wrong?

Link to comment
Share on other sites

i hope this script runs on a trigger and not on a xmarker !

 

first you cant set the Light == 0 before you declared it to the script

 

youre script schould be like nthis

Scn CTActivateAllHangarLightsScript

Ref MyRef

Begin OnTriggerEnter 

Set MyRef to GetLinkedRef
  if MyRef.GetDisabled == 1
     MyRef.Enable

  elseif MyRef.GetDisabled == 0
     MyRef.Disable

endif
end

 

now just set the trigger as enableparent to the xmarker

 

so now everytime you run in the trigger lights go on....and if you go again in the trigger (leaving the room ) the lights go out

Link to comment
Share on other sites

Hmm.. in the end it worked the way I wrote it, the game just didn't updated in time for me to see the results. And yes the script was on the trigger :) I set it to 0 because my lights were set to off, and technically light has no value at first before it is declared, so all I want the trigger to do is activate them at a certain point in the game and that is all. Thanks for the reply thou.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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