Jump to content
Sign in to follow this  
bvrettski

Let it snow

Recommended Posts

The following script is part of the Namalsk Crisis missions for Amra 2. I would like to adopt it for use on Namalsk in Wasteland for Arma 3. 

 

Credit to Sumrak for the super simple script.

 

I added it to my wasteland mission and made the appropriate call in the init.sqf file. When my character spawns I see snow for a second or two then it stops. Can someone please help me understand what is triggering the snow.

 

I believe it is looking for these two parameters:

_this select 0: Double - time (default 3.0)
_this select 1: Double - density (can be 0 - 1, default 0.5)

 

I'm not sure what they represent in the overall mission but I have been unable to determine where those values would come from.

 

Is it possible for me to change or rewrite these inside the script so the snow remains a constant percentage and isn't changing with time per say.

 

I have a server up and running with much of the A3 Wasteland mission adopted for the Namalsk map.

 

Any help is much appreciated.

 

scriptName "fn_dzn_snowfall.sqf";
/*
File: fn_dzn_snowfall.sqf
Author: Sumrak


Description:
Simple snowfall script for Namalsk OR DayZ: Namalsk


Parameter(s):
_this select 0: Double - time (default 3.0)
_this select 1: Double - density (can be 0 - 1, default 0.5)


Returns:
Nice snow particle effect with a proper density and for the defined time.
*/


private["_dzn_snow_density", "_dzn_snow_pc", "_dzn_snow_timer", "_isinbuilding", "_isInsideBuilding"];


if (isNil "_this") then {
_this = [];
};
if (count _this > 0) then {
_dzn_snow_timer = abs (_this select 0);
} else {
_dzn_snow_timer = 3;
};
if (count _this > 1) then {
if ((_this select 1) != -1) then {
_dzn_snow_density = abs ( 100 * (_this select 1));
} else {
_dzn_snow_density = 10;
};
} else {
_dzn_snow_density = 50;
};


_d = 35;
_h = 18;
_dzn_snow_pc = 0;
snow = _dzn_snow_density / 100;
_isInsideBuilding = compile preprocessFileLineNumbers "\nst\ns_modules\functions\external\fn_isInsideBuilding.sqf";


while {_dzn_snow_timer >= 0} do {
_position = getPos player;
if ([player] call _isInsideBuilding) then {
_isinbuilding = true;
} else {
_isinbuilding = false;
};


while {(_dzn_snow_pc < _dzn_snow_density) && !_isinbuilding} do {
_dpos = [((_position select 0) + (_d - (random (2 * _d))) + ((velocity vehicle player select 0) * 6)), ((_position select 1) + (_d - (random (2 * _d))) + ((velocity vehicle player select 1) * 6)), ((_position select 2) + _h)];
drop ["\ca\data\cl_water", "", "Billboard", 1, 8, _dpos, wind, 1, 0.0001, 0.0, 0.5, [0.05, 0.05, 0.05], [[1, 1, 1, 0], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], [0, 0], 0.2, 1.2, "", "", ""];
_dzn_snow_pc = _dzn_snow_pc + 1;
};


sleep 0.1;
_dzn_snow_timer = _dzn_snow_timer - 0.1;
_dzn_snow_pc = 0;
};
snow = 0;

 

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  

×