Sign in to follow this  
Ambu5h

ALIAS Waterfall's for Exile

1 post in this topic

All credits go to ALIAS for creating the base of this script! I mearly improvised, adapted and overcame.
Waterfall's Steam Workshop Page

A while back i tried adding in ALIAS Cartoons waterfalls script into exile.
Unfortunately for exile it wasnt as straight forward as his tutorial's made it look.

So, after detoxing from PUBG and smoking some fresh batches of ARMA 3 i decided to give it another try.
And here it is, modified his scripts a tiny bit and added a file for easy modification's and management of multiple waterfall's and waterfall bases.

1. Create a folder named custom\waterfall\ in your Mission.pbo
2. Add this to Init.sqf (if you dont have this file, just create it)

[] execVM "custom\waterfall\waterfall_init.sqf";

3. Add this to description.ext make sure to merge the class CfgSounds with the one you already have. (ie: just add class cascada to class CfgSounds)

class CfgSounds
{
	sounds[] = {};

	class cascada
	{
		name = "cascada";
		sound[] = {"\custom\waterfall\cascada.ogg", 0.9, 1};
		titles[] = {1, ""};
	};	
};

4. In the waterfall's folder create the following files:
cascada.ogg
This can be downloaded from the original mod, if you want you can replace this with your own sounds.

waterfall_init.sqf   (configured for Tanoa)

Spoiler

diag_log "LOADING WATERFALLS!";

_objectType     = "Land_W_sharpStone_02";
_objectHidden    = true;
_waterfalls     = [
//                    [[<location>],                   [direction],     [vector up],    speed],                                Currently configured for Tanoa
                    [[4887.14, 9274.44, 24.5],     [-1, 1, 0],      [0, 0, 3],         3],  // Near Georgepol
                    [[9269.65, 9069.45, 251],     [1, 1, 0],      [0, 0, 3],         3],     // Maya Cave near Tuvanaka
                    [[2989.89, 1971.71, 24],     [-1, -0.8, 0],  [0, 0, 3],         3],  // South Yannuka island
                    [[10749.6, 8900.33, 303],     [1, 0.2, 0],     [0, 0, 3],         5], // Tuvanaka Rocks East
                    [[10678.6, 8939.23, 310],     [-1, 1, 0],     [0, 0, 3],         5]     // Tuvanaka Rocks West
                  ];
_waterbases        = [
//                    [[<location>],                   [direction],     [vector up]],
                    [[4882.2, 9277.03, -4],     [0, 1, 0],      [0, 0, -4]],    // Near Georgepol
                    [[9273.7, 9075.11, -4],     [0, 1, 0],      [0, 0, -4]],    // Maya Cave near Tuvanaka
                    [[2979.5, 1962.57, -4],     [0, 1, 0],      [0, 0, -4]]        // South Yannuka island
                  ];

if (!hasInterface) exitwith {};

{
    _fallSource =     createSimpleObject [_objectType, [(_x select 0) select 0, (_x select 0) select 1, (_x select 0) select 2]];
    _fallSource     hideSelection [_objectType, _objectHidden];
    _fallSource       setVectorDirAndUp [_x select 1, _x select 2];

    [_x select 3, _fallSource] execVM "custom\waterfall\al_waterfall.sqf";
}
forEach _waterfalls;

{
    _fallBase   =     createSimpleObject [_objectType, _x select 0];
    _fallBase         hideSelection [_objectType, _objectHidden];
    _fallBase       setVectorDirAndUp [_x select 1, _x select 2];

    [_fallBase]     execVM "custom\waterfall\al_spring_base.sqf";
}
forEach _waterbases;


al_waterfall.sqf

Spoiler

// [[12,this],"AL_waterfall\al_waterfall.sqf"] remoteExec ["BIS_fnc_execVM"];

diag_log "WATERFALL";

if (!hasInterface) exitwith {};

private ["_w_obj","_cascad","_casc1","_unghi_x_waterfall","_press_implicit_x","_press_implicit_y"];

_al_pressure = _this select 0;
_w_obj = _this select 1;

_unghi_x_waterfall = getdir _w_obj;

//if (_unghi_x_waterfall==180) then {hint str _unghi_x_waterfall};

if (_unghi_x_waterfall<=90) then {
    _press_implicit_x = linearConversion [0, 90,_unghi_x_waterfall, 0, 1, true];
    _press_implicit_y = 1-_press_implicit_x;
};

if ((_unghi_x_waterfall>90)and(_unghi_x_waterfall<180)) then {
    _unghi_x_waterfall = _unghi_x_waterfall-90;
    _press_implicit_x = linearConversion [0, 90,_unghi_x_waterfall, 1, 0, true];
    _press_implicit_y = _press_implicit_x-1;
};

if ((_unghi_x_waterfall>180)and(_unghi_x_waterfall<270)) then {
    _unghi_x_waterfall = _unghi_x_waterfall-180;
    _press_implicit_x = linearConversion [0, 90,_unghi_x_waterfall, 0, -1, true];
    _press_implicit_y = (-1*_press_implicit_x)-1;
};

if ((_unghi_x_waterfall>270)and(_unghi_x_waterfall<360)) then {
    _unghi_x_waterfall = _unghi_x_waterfall-270;
    _press_implicit_x = linearConversion [0, 90,_unghi_x_waterfall, -1, 0, true];
    _press_implicit_y = 1+_press_implicit_x;
};

//hint format["Xpres - Ypres %1:%2",_press_implicit_x,_press_implicit_y];

_cascad = false;
    
while {true} do
{
    if (((player distance _w_obj) <= 1000) and (!_cascad)) then
    {
        _cascad = true;
        _casc1 = "#particlesource" createVehicleLocal (getpos _w_obj);
        _casc1 setParticleCircle [0, [0, 0, 0]];
        _casc1 setParticleRandom /*LifeTime*/        [2,
                                /*Position*/        [0,0,0],
                                /*MoveVelocity*/    [0,0,0],
                                /*rotationVel*/        5,
                                /*Scale*/        0.01,
                                /*Color*/        [0,0,0,0.1],
                                /*randDirPeriod*/    0.01,
                                /*randDirIntesity*/    0,
                                /*Angle*/        10];
        _casc1 setParticleParams [["\A3\data_f\cl_water", 1, 0, 1], "", "Billboard", 1, 3, [0, 0, 0], /*viteza componenta*/[_press_implicit_x*_al_pressure,_press_implicit_y*_al_pressure, -7], 15, 1050, 7.9, 0.1, [1, 10], [[0.85, 0.95, 1, 0.5], [1, 1, 1, 0.1]], [0.08], 0, 0, "", "", _w_obj];
        _casc1 setDropInterval 0.01;
        
        diag_log "WATERFALL DRAWN";
    };
    
    if (((player distance _w_obj) > 1000) and (_cascad)) then {
        deleteVehicle _casc1;
        _cascad = false;
        diag_log "WATERFALL REMOVED";
    };
    
    diag_log "WATERFALL CYCLED";
    sleep 30;
};


al_spring_base.sqf

Spoiler

diag_log "WATERFALL BASE";

private ["_casc_baza","_baza_casc","_cascad"];

if (!hasInterface) exitwith {};

_baza_casc = _this select 0;

_cascad = false;

[_baza_casc] spawn {
    _cascad_s = _this select 0;
    while {true} do {
    _cascad_s say3d ["cascada",800];sleep 15};
};
    
while {true} do
{
    if (((player distance _baza_casc) <= 1000) and (!_cascad)) then
    {
        _cascad = true;
        
        _casc_baza = "#particlesource" createVehicleLocal (getpos _baza_casc);
        _casc_baza setParticleCircle [3.5, [2, 2, 3]];
        _casc_baza setParticleRandom [1, [0.25, 0.25, 0], [1, 1, 0.1], 5, 0.5, [0, 0, 0, 1], 0, 0];
        _casc_baza setParticleParams [["\A3\data_f\cl_basic", 1, 0, 1], "", "Billboard", 1, 2, [0, 0, 0], [0, 0, 3], 5, 20, 7.9, 0.01, [5, 5, 3], [[1, 1, 1, 0.5], [1, 1, 1, 0.1], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _baza_casc];
        _casc_baza setDropInterval 0.01;
        
        diag_log "WATERFALL BASE DRAWN";
    };
    
    if (((player distance _baza_casc) > 1000) and (_cascad)) then
    {
        deleteVehicle _casc_baza;
        _cascad = false;
        diag_log "WATERFALL BASE REMOVED";
    };
    sleep 30;
};



KNOWN ISSUES and NOTES:

1. Z Location (starting height) is defined from sea level, not from terrain level. Use "diag_log getPositionASL player;" in the debug window to get the propper coordinates.
2. Hiding the object doesnt work at this point. I tried both hideObject and hideSelection but both didnt work.
3. This script could be quite a bit simpler at this point, feel free to improve and ill update it.
 

Edited by Ambu5h
  • Like 4

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.