InsertCoins

Snow inside buildings

12 posts in this topic

Maybe this has been addressed already, but snow seems to not care that it should stop at the roof in the arma 2 barracks.

Is this a Namalsk issue or JBAD buildings issue?

Share this post


Link to post
Share on other sites
Advertisement

Its an Arma Issue.
Arma weather system doesn't do snow...

All the snow scripts are particle effects to give an illusion of snow.
Short version
There is no nice way to make a snow script that works 100% in arma without killing players fps.

Longer Version
I haven't looked at exile/namalsk snow script yet.
You can add a building check, but then you need to spawn more particle effects around the building.
So when a player is inside, they will still see it snowing outside.
But then you need to worry about wind, blowing the particle effects through the walls of the building.

It can become tedious to create a snow script that has the look you want and works ok for most of the time.
All while trying not to kill a clients FPS, with all the checks

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, Torndeco said:

Its an Arma Issue.
Arma weather system doesn't do snow...

All the snow scripts are particle effects to give an illusion of snow.
Short version
There is no nice way to make a snow script that works 100% in arma without killing players fps.

Longer Version
I haven't looked at exile/namalsk snow script yet.
You can add a building check, but then you need to spawn more particle effects around the building.
So when a player is inside, they will still see it snowing outside.
But then you need to worry about wind, blowing the particle effects through the walls of the building.

It can become tedious to create a snow script that has the look you want and works ok for most of the time.
All while trying not to kill a clients FPS, with all the checks

I have the original scripts from the Arma 2 version of Namalsk Crisis. They produced a random, light snowfall across the whole map (since it doesn't start and stop snowing at the snowline in real life) They also have a check for being inside a house (which is being used by the EVR overload script that has been converted. I've been trying to make this work on our server (because I dislike the built in snow effect), but I'm no coder. If you'd like to take a look the script is here.

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 = 0;
    };
} else {
    _dzn_snow_density = 50;
};

_d = 35;
_h = 18;
_dzn_snow_pc = 0;
snow = _dzn_snow_density / 100;
_isInsideBuilding = compile preprocessFileLineNumbers "\addons\snow\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;

The inside building script is:

/* Property of DayZ modification - http://www.dayzmod.com/ */
private["_unit1","_building","_type","_relPos","_boundingBox","_min","_max","_myX","_myY","_myZ","_inside"];
_unit1 = _this select 0;
//_building = _this select 1;
_building = nearestObject [_unit1, "HouseBase"];
 
_type = typeOf _building;

_relPos = _building worldToModel (getPosATL _unit1);
_boundingBox = boundingBox _building;
//diag_log ("DEBUG: Building: " + str(_building) );
//diag_log ("DEBUG: Building Type: " + str(_type) );
//diag_log ("DEBUG: BoundingBox: " + str(_boundingBox) );

_min = _boundingBox select 0;
_max = _boundingBox select 1;
             
//diag_log ("Min: " + str(_min) );
//diag_log ("Max: " + str(_max) );
             
_myX = _relPos select 0;
_myY = _relPos select 1;
_myZ = _relPos select 2;
             
//diag_log ("X: " + str(_myX) );
//diag_log ("Y: " + str(_myY) );
//diag_log ("Z: " + str(_myZ) );
    
if ((_myX > (_min select 0)) and (_myX < (_max select 0))) then {
        if ((_myY > (_min select 1)) and (_myY < (_max select 1))) then {
                if ((_myZ > (_min select 2)) and (_myZ < (_max select 2))) then {
                        _inside = true;
                } else { _inside = false; };
        } else { _inside = false; };
} else { _inside = false; };

//diag_log ("isinBuilding Check: " + str(_inside) );
_inside

 

Would be great if we could get this to work.

Edited by MudBone

Share this post


Link to post
Share on other sites

Prob with that script is when you are inside a building there is no snow :P
i.e step inside a building look behind you and notice all the snowing has stopped 

Like i said there is no nice way to get snow to work 100% without killing client fps imo.
You can try to get it close, but there will always be a cause were the snow glitches in through some random building wall

Share this post


Link to post
Share on other sites
25 minutes ago, Torndeco said:

Prob with that script is when you are inside a building there is no snow :P
i.e step inside a building look behind you and notice all the snowing has stopped 

Like i said there is no nice way to get snow to work 100% without killing client fps imo.
You can try to get it close, but there will always be a cause were the snow glitches in through some random building wall

I don't know how Bohemia does it but Rain does not get inside buildings or bellow things...

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.