Jump to content
Sign in to follow this  
windies

setFog JIP compatible script

Recommended Posts

Wrote a script to utilize the new setFog array command and decided to make it JIP compatible and release it. I did try testing this on a local dedicated server to my machine and connecting and had no problems, but that's as much as I could test it.

Here is the script:

https://drive.google.com/file/d/0B7IenZ_SotmZWE5rcks0VWFzY0U/edit?usp=sharing

and you simply call it in init.sqf with [[startDensity,EndDensity], Decay, Altitude, Time in minutes for changes to take effect]. So for example [[.65, .40], .010, 55, 60] execVM "Fog.sqf"; would start with a fog density of .65 with a decay of .010 and an altitude of 55 meters and gradually decrease to a fog density of .40 over 60 minutes.

Share this post


Link to post
Share on other sites

Quick update to it to keep client code from executing on the server. Same link as above.

Share this post


Link to post
Share on other sites

thank you very much. will try it out. never played with fog yet actually..

Share this post


Link to post
Share on other sites

Trying to pick up as much mp infos as possible. Question then.

If this is using isServer how should it behave on coop host vs coop dedicated? Should dedicated be used instead if it is used on a dedi server?

Trying to learn when to use which and this is a good example as I've been struggling with getting this to work as well when using the timer. If setting the fog like this

30 setFog[0.7,0.02,50] I run into errors where it never sets in. Using 0 for the timer value does make it work though. So must be a server/client issue but trying to solve it on my own has proved fruitless thus far ;)

Thanks for sharing BTW.

Share this post


Link to post
Share on other sites

isServer should work irregardless of dedicated or client host, at least that's how it was explained to me. I don't have 2 client's to actually be able to test that though so I could only test in a local dedicated server environment.

As for calling the script, are you calling it with "30 setFog[0.7,0.02,50]" ? If so then that's wrong, simply call it with [[start density, end density], decay, altitude, time to run]. For instance if I wanted the fog to start with a density of .25 and progress to .75 density I would simply do

nul = [[.25,.75], .012, 25, 60] execVM "setFog.sqf";

either in a trigger activation or init.sqf or even a unit's init and that would start the fog with a density at .25 and keep changing it across all the clients and the server until it hits .75 density where it will stay and the script should terminate.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×