BetterDeadThanZed

Need help wth snow

4 posts in this topic

I'm only putting this here because it has to do with a snow script, but it's actually more of a scripting question.

I use JohnO's Exile Reborn on my server. Part of that is a script that causes it to snow if you are above 200 feet, below a certain temperature and certain overcast level. Here's the code I'm using, slightly modified from the original version:

Spoiler

if (ExileClientEnvironmentTemperature < 6) then
{	
	if !(vehicle player != player) then 
	{
		if ((_posASL >= 0) && (overcast >= 0.3) && (random 1 > 0)) then //0.5
		{	
			_enableSnow = true;
			ExileSnowClose attachTo [vehicle player, [0, 4, 1]];
			ExileSnowNear attachTo [vehicle player, [0, 4, 1.5]];
			ExileSnowFar attachTo [vehicle player, [0, 4, 2]];
		};
	};	
	if (_enableSnow) then 
	{
		ExileSnowClose attachTo [vehicle player, [0, 4, 1]];
		ExileSnowNear attachTo [vehicle player, [0, 4, 1.5]];
		ExileSnowFar attachTo [vehicle player, [0, 4, 2]];
		ExileSnowClose setDropInterval 0.01;
		ExileSnowNear setDropInterval 0.01;
		ExileSnowFar setDropInterval 0.01;
	}
	else 
	{
		ExileSnowClose setDropInterval 0;
		ExileSnowNear setDropInterval 0;
		ExileSnowFar setDropInterval 0;
	};
};	

 

The line I modified is this one:

if ((_posASL >= 0) && (overcast >= 0.3) && (random 1 > 0)) then

Originally it said this:

if ((_posASL >= 0) && (overcast >= 0.3)) then

I set the "random" chance to 100% for debugging purposes. The "random 1 > 0" would be changed to something like "random 1 > .70" so it' s a 30% chance of snow. 

So, the way this reads, if your position above sea level is greater than 0, and the overcast level is greater than or equal to 0.3, and the random number is above 0 (which it always will be for testing), then it should snow. However, when using this code, it's not snowing. I've made sure I set overcast above 0.3, the temperature is low enough and I'm more than 0 feet above sea level. Any suggestions?

Share this post


Link to post
Share on other sites
Advertisement

I got it working. I had snow disabled in my mission config.cpp! 

I have another question though. In the file I posted, there is this line:

if (ExileClientEnvironmentTemperature < 6) then

I want to make it so ExileClientEnvironmentTemperature equals freezing or below in that line (0 degrees celsius). What would I set the number to in that part of the line? < 6 seems to allow it to snow above 0 degrees, so that must represent a temperature above freezing.

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, BetterDeadThanZed said:

I got it working. I had snow disabled in my mission config.cpp! 

I have another question though. In the file I posted, there is this line:

if (ExileClientEnvironmentTemperature < 6) then

I want to make it so ExileClientEnvironmentTemperature equals freezing or below in that line (0 degrees celsius). What would I set the number to in that part of the line? < 6 seems to allow it to snow above 0 degrees, so that must represent a temperature above freezing.

I would probably do this:

if (ExileClientEnvironmentTemperature < 1) then

As that basically says if it's 0 temperature, then snow.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.