How would I go about writing a script that only adds Volumetric Fog in certain situations. Like say, “early morning” or “Raining”. Also is it possible to set the intensity so I could gradually introduce it? How would I go about writing a script to do that?
Pseudo code
//if current state is happening introduce volumetric fog gradually every 3 seconds
fog_conditions=[morning, rain]
if(state_contains(fog_conditions)){
fog = 0;
timer = timer_start(func(){
if (volumetric_fog < 1){
volumetric_fog += 0.1
}else{
stop_time(timer);
}
}, 3000)
}
and then have some other function that reduces volumetric fog back to 0 if we return to any other state.
I’m just not sure at all how to write or incorporate scripts into the game. Or where I would go to begin finding out how to hook into some “listener” or promises for certain game events like weather or time.