Quote: "It does in the last build. "
oh yes, i had the max global.lua open
Quote: "i see your script is just getting a random angle and adjusting it over time but i have no idea how it actually translates to a non-random position - i.e. setting an actual sun object which will cycle (starting at the desired time of day rather than random)"
ok got it - works great, thanks Preben
place down a sun as Preben did, make it always active = yes and give it this script
adjust
local speed = 4
local radius = 1300
to suit your scene
so speed is how fast it travels along the orbit and radius is how large the orbit is
note; it currently assumes you're starting at midday and the shadows will point towards the player's starting position
to adjust that change
if not gotOrigin then
PositionObject(g_Entity[e].obj, radius, 0, g_Entity[e].z)
tspeed = 0
origin.x, origin.y, origin.z = g_PlayerPosX, g_PlayerPosY, g_PlayerPosZ
gotOrigin = true
end
where
PositionObject(g_Entity[e].obj, radius, 0, g_Entity[e].z)
tspeed = 0
is setting it to start at dawn, so
PositionObject(g_Entity[e].obj, 0, radius*0.75, g_Entity[e].z)
tspeed = 90
is midday (note the *0.75 is because the script automatically ellipses the sun to keep it more realistic)
PositionObject(g_Entity[e].obj, -radius, 0, g_Entity[e].z)
tspeed = 180
is dusk
^ tspeed is how far around it's circle the sun is - i.e. 0 ~ 360
origin.x, origin.y, origin.z = g_PlayerPosX, g_PlayerPosY, g_PlayerPosZ
should point to the location your sun is facing at map start - i.e. if the player marker is in the centre of the map it should work fine to use those values