Priority:
Asset Progress:
Status:
Asset Type:
Merged into:
Script
begin T_ScObj_LightCaveRay_Script
short init
short moving
short daytime
short daytimebefore
float origX
float origY
float origZ
float altX
float altY
float altZ
long movZ
if ( MenuMode == 1 ) ; skip for menu mode
return
endif
if ( init == 0 ) ; setup values
Move, Z, 36000
set origX to GetStartingPos, X
set origY to GetStartingPos, Y
set origZ to GetStartingPos, Z
set altX to GetPos, X
set altY to GetPos, Y
set altZ to GetPos, Z
set moving to -1
set init to 1
endif
if ( GameHour >= 20 )
set daytime to -1 ; night
elseif ( GameHour >= 19 )
set daytime to -2 ; dusk
elseif ( GameHour >= 8 )
set daytime to 1 ; day
elseif ( GameHour >= 7 )
set daytime to 2 ; dawn
else
set daytime to -1 ; night
endif
if ( daytime == 2 )
if ( daytimebefore != 2 )
SetPos, X, altX
SetPos, Y, altY
SetPos, Z, altZ
set moving to 1
set movZ to 36000
endif
elseif ( daytime == -2 )
if ( daytimebefore != -2 )
SetPos, X, origX
SetPos, Y, origY
SetPos, Z, origZ
set movZ to 5
set moving to 1
endif
elseif ( daytime == 1 )
if ( daytimebefore != 1 )
if ( moving == -1 ) ; not already moving
SetPos, X, origX
SetPos, Y, origY
SetPos, Z, origZ
set movZ to 5
set moving to 0
endif
endif
else if ( daytime == -1 )
if ( daytimebefore != -1 )
if ( moving == -1 ) ; not already moving
SetPos, X, altX
SetPos, Y, altY
SetPos, Z, altZ
set movZ to 36000
set moving to 0
endif
endif
endif
set daytimebefore to daytime ; update time
if ( moving == 1 )
if ( daytime > 0 )
Move, Z, -5
set movZ to movZ - 5
else
Move, Z, 5
set movZ to movZ + 5
endif
if ( movZ > 36000 ) ; reached night pos
set moving to -1
elseif ( movZ < 5 ) ; reached day pos
set moving to -1
endif
endif
end
More simple script in the comment.
Attachment | Size | Date |
---|---|---|
Light Rays resource - Lougian.rar | 7.94 MB | 2017-11-05 17:57 |
T_Glb_Light_CaveRay.7z | 5.65 MB | 2017-11-10 11:38 |
TR_misc_light_caveRays_script.ESP | 2.64 KB | 2019-08-24 20:55 |
TR_CaveRays_Script_Reviewed.ESP | 2.45 KB | 2019-08-25 02:11 |
Comments
These are pretty sweet. A
These are pretty sweet. A must-have!
Uploaded my edits based on
Uploaded my edits based on MinerMan's file. Names and lighting values have been adjusted, and a script (see above - input would be welcome, but it seems to work alright) has been attached to the lights to disappear them during daytime. Marking these as ready-to-merge.
Merging an unscripted version
Merging an unscripted version of this, knocking this back to 90% In Development pending an improved script.
I added TR_misc_light
I added TR_misc_light_caveRays_script.ESP patch with simple script disabling lights when it's night.
begin T_ScObj_LightCaveRay_Script
if ( GameHour >= 20 )
if ( GetDisabled == 0 )
disable
endif
elseif ( GameHour < 8 )
if ( GetDisabled == 0 )
disable
endif
else
if ( GetDisabled == 1 )
enable
endif
endif
end
Hmm. Could use this script on
Hmm. Could use this script on the glow bugs too. Might need to make an outdoors ID that uses it. Same with the lights they use.
This should be on T_Glb_Light
This should be on T_Glb_Light_Window_XX too
The _script suffix should be
The _script suffix should be removed from the ID; T_ScObj already indicates a script. Maybe change it to CaveRayLight or CaveRay, since the other light scripts don't include the word light. Also, remove the Tamriel_Data.esm dependency if there is one. Finally, the stop should be moved to 18 so that the lights are disabled during dawn and dusk (6-8 am and 6-8 pm according to Holamayan).
I'm just going to review the
I'm just going to review the esp, will implement these changes.
The script is ready to merge.
The script is ready to merge. Only merge in TR_CaveRays_Script_Reviewed.ESP, the rest is already in Tamriel Data. I implemented the changes above and tested the script ingame.
Edit: changed the script to
Edit: changed the script to enable/disable at 7am and 7pm respectively (former is not a change).