PDA

View Full Version : Dynamic Time/Weather Script



malolo420
January 27th, 2008, 07:48 AM
I wasn't going to release this because I made it for someones map.
But I'm starting to doubt they were going to give me credit for it so I'm releasing it. I personally havn't tested it but It seemed to work perfectly in his map.


Make 2 bsps, (the same one but different bsp files {for different skys make +sky in the second bsp +sk1)
Then make a biped and a vehicle out of view and 2 cutscene flags(1 where vehicle is and 1 ontop of biped), name the biped syncbip and the vehicle synchog and the flag at vehicle vehistart, and the other one killbip (for my script, you can change names).
Then just compile my script and it will switch skys every 5 minutes.

(global boolean is_server false)
(script continuous nightsky
(sleep_until (= (unit_get_health syncbip) 0) 15)
(if (= (structure_bsp_index) 0)
(begin
(set is_server true)
(switch_bsp 1)
(sleep 9000)
(object_create_anew syncbip)
)))

(script continuous killbiped
(if (= (unit_get_health syncbip) 0.0)
(begin
(object_teleport synchog killbip)
)))

(script continuous daysky
(sleep_until (= (unit_get_health syncbip) 1) 15)
(if (= (structure_bsp_index) 1)
(begin
(set is_server true)
(switch_bsp 0)
)))

(script continuous bipedkill
(if (= (unit_get_health syncbip) 1)
(begin
(set is_server true)
(sleep 9000)
(object_teleport synchog killbip)
(sleep 60)
(object_teleport synchog vehistart)
)))

AAA
January 27th, 2008, 08:23 PM
Just what some of us wanted. Nice work :) +Rep

Jay2645
January 27th, 2008, 10:23 PM
Don't BSP switches normally cause exceptions?
I wrote one of these for an old project, everyone exceptioned every 5 seconds, lol.

SuperSunny
January 27th, 2008, 10:32 PM
Don't BSP switches normally cause exceptions?
I wrote one of these for an old project, everyone exceptioned every 5 seconds, lol.

I think Jahrain did this a while ago as well, and it seemed to work

Jay2645
January 27th, 2008, 11:26 PM
Must have done something wrong then, lol.

Kalub
January 28th, 2008, 02:18 AM
I think Jahrain did this a while ago as well, and it seemed to work


Yea, jahrain did it many moons ago. 'Cept his was in BG and it went from dawn, to noon, to sunset, to night

malolo420
January 28th, 2008, 03:35 AM
Thats what the guy I made it for did to, cept it didn't sync well so he went back to just day and night.

itszutak
February 3rd, 2008, 12:52 AM
Yea, jahrain did it many moons ago. 'Cept his was in BG and it went from dawn, to noon, to sunset, to night
Was this released? I would like to see how smooth/rough it is.

CabooseJr
February 3rd, 2008, 07:44 AM
Very useful, I would like to see this done in more maps.

Apoc4lypse
February 3rd, 2008, 02:02 PM
I think Jahrain did this a while ago as well, and it seemed to work

agreed, Jahrain already did it, but I thought it had sync issues, but I forget really so idk...