Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Moving Light Script isn't working more than twice?


JulianSull
 Share

Recommended Posts

Lights do not move without a lot of special code. You can say MoveTo, but they will probably not move. Only NPC's and creatures will move without issues using MoveTo.

What I recommend is placing a light in all 5 locations, and mark them 'initially disabled'. Then put this script on a hidden object in the room.

I also recommend checking for the highest timer value first, this way you don't need a bunch of special code wrapped around it to check the timer value. This works because the FIRST if condition that is TRUE is the only one that is performed, all the others will be skipped.

scn MovingLightScript
float timer

begin GameMode
set timer to timer + GetsecondsPassed

if timer >= 33
set timer to 0
elseif timer > 30
MovingLightCelestial04.enable
MovingLightCelestial01.disable
elseif timer > 28
MovingLightCelestial05.enable
MovingLightCelestial04.disable
elseif timer < 26
MovingLightCelestial02.enable
MovingLightCelestial05.disable
elseif timer < 23
MovingLightCelestial01.enable
MovingLightCelestial02.disable
elseif timer < 20
MovingLightCelestial03.enable
MovingLightCelestial01.disable
elseif timer < 17
MovingLightCelestial05.enable
MovingLightCelestial03.disable
elseif timer < 13
MovingLightCelestial04.enable
MovingLightCelestial05.disable
elseif timer < 10
MovingLightCelestial03.enable
MovingLightCelestial04.disable
elseif timer < 7
MovingLightCelestial02.enable
MovingLightCelestial03.disable
elseif timer < 3
MovingLightCelestial01.enable
MovingLightCelestial02.disable
endif
end[/code]

Each light will need to have the Reference ID name set to 'MovingLightCelestial01' through 'MovingLightCelestial05'.

Link to comment
Share on other sites

Lights do not move without a lot of special code. You can say MoveTo, but they will probably not move. Only NPC's and creatures will move without issues using MoveTo.

What I recommend is placing a light in all 5 locations, and mark them 'initially disabled'. Then put this script on a hidden object in the room.

I also recommend checking for the highest timer value first, this way you don't need a bunch of special code wrapped around it to check the timer value. This works because the FIRST if condition that is TRUE is the only one that is performed, all the others will be skipped.

ahh, activators move no problem aswell, you just need to use enable/disable to update the collision. nice idea about just having each light position as a copy of the light...that didnt even occur to me...must have been the late hour.

My structure fot the time would work the same, only i put in a toggle so that my code only ran once. :sick:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...