Jump to content
loopdk

Snow script where it dont snow in buildings

Recommended Posts

Guest

Huh, if there is a function to detect if there is a roof it could be easy to do. (Like water)

Share this post


Link to post
Share on other sites

Best, scripter can do, AFAIK, is mentioned roof detection. But what then? Stop generating particles if roof above the player? Yep, but then snow stops also outside, which could be equally wrong looking. So, whoever wants to make such code needs no single particle emitter above player's head, but rather whole matrix of emitters attached to the player covering around the player square area, then detecting roof for every one of them, and disabling only those actually "roofed" along with the player at the moment. Not perfect (eg snow still will be inside other houses in the area, where player isn't, but can see through their windows), but best, I could figure out atm. Scripted snow isn't perfect anyway though - player-centric illusion. 

Share this post


Link to post
Share on other sites

Huh, if there is a function to detect if there is a roof it could be easy to do. (Like water)

 

You can try that:

intext = false;

if (lineIntersects [
                    eyepos player,
                    [
                        eyepos player select 0,
                        eyepos player select 1,
                        (eyepos player select 2) + 10
                    ]
                ]
            ) then {
                //hint "may be inside"; 
                myobj = (lineIntersectsWith [eyepos player, [eyepos player select 0,
                                        eyepos player select 1,
                                        (eyepos player select 2) + 10
                                    ],objNull, objNull, true]) select 0 ;

                intext = myobj isKindof "house";
                }
            else {

                //hint "outside";
                intext = false;
            };


hint str (intext); // true = inside, false = outside

it's a quick hack I've done from a script used by an old version of JSRS that one of the author published a long time ago in this section of the forum IIRC.

  • Like 1

Share this post


Link to post
Share on other sites

@1212PDMCDMPPM Is your snipped working even if player is in house and looking outside from opened door of house (eyepos player intersecting line through open door or window) ? Is it detecting house then?

 
 

Share this post


Link to post
Share on other sites

The script is detecting if a "house" type object is up to 10 meters above the player (ie a roof). I used this kind of script to lower music level playing wind sound when a player is inside a building (vs in the open) or to prevent AI to go prone in buildins.

It will not check what your looking at. 

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

×