• 0
Sign in to follow this  
RixxTV

Lythium Map Boundry Radiation

Question

Trying to enable radiation when a player passes the outside of the map using the following script. This works with Esseker using this, but can't seem to get it working with Lythium. I have also tried to change 

_distance = (_x select 0) distance (getPosASL player);

to 

_distance = (_x select 0) distance2D (getPosASL player);

in an attempt to ignore elevation with no luck.

 

Spoiler

/**
 * ExileClient_system_radiation_thread_update
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_distance","_damage"];
ExilePlayerRadiationLastCheck = ExilePlayerRadiation;
ExilePlayerRadiation = 0;
_radDam = false;
_beyondWorld = false;
{
    _distance = (_x select 0) distance (getPosASL player);
    if (_distance < (_x select 2)) exitWith {
        if (_distance < (_x select 1)) then {
            ExilePlayerRadiation = 1; 
        } else {
            ExilePlayerRadiation = 1 - ((_distance - (_x select 1)) / ((_x select 2) - (_x select 1)));
        };
        _radDam = true;
    };
} forEach ExileContaminatedZones;

if (ExilePlayerRadiation isEqualTo ExilePlayerRadiationLastCheck) then {
    _pos = getPosASL player;
    _posX = _pos select 0;
    _posY = _pos select 1;
    
    if (_posX > worldSize || _posY > worldSize || _posX < 0 || _posY < 0) then {
        
        ExilePlayerRadiation = 0.1;
        
        if (_posX > worldSize) then { ExilePlayerRadiation = ExilePlayerRadiation + ((_posX - worldSize) / 100); };
        if (_posY > worldSize) then { ExilePlayerRadiation = ExilePlayerRadiation + ((_posY - worldSize) / 100); };
        if (_posX < 0) then { ExilePlayerRadiation = ExilePlayerRadiation + (abs(_posX) / 100); };
        if (_posY < 0) then { ExilePlayerRadiation = ExilePlayerRadiation + (abs(_posY) / 100); };

        _beyondWorld = true;
    };
};

if (_radDam || _beyondWorld) then {
    if (ExilePlayerRadiation > 0.7) then {
        playSound [format ["Exile_Sound_GeigerCounter_High0%1", 1 + (floor random 3)], true];
        ["ErrorTitleAndText", ["Outside Map Boundries", "Leaving map boundries is not allowed. Return now!!"]] call ExileClient_gui_toaster_addTemplateToast;
        _damage = 1/(1*30) * 2;
    } else {
        if (ExilePlayerRadiation > 0.3) then {
            playSound [format ["Exile_Sound_GeigerCounter_Medium0%1", 1 + (floor random 3)], true];
            ["ErrorTitleAndText", ["Outside Map Boundries", "Leaving map boundries is not allowed. Return now!!"]] call ExileClient_gui_toaster_addTemplateToast;
            _damage = 1/(1*30) * 2;
        } else {
            playSound [format ["Exile_Sound_GeigerCounter_Low0%1", 1 + (floor random 3)], true];
            ["ErrorTitleAndText", ["Outside Map Boundries", "Leaving map boundries is not allowed. Return now!!"]] call ExileClient_gui_toaster_addTemplateToast;
            _damage = 1/(1*30) * 2;
        };
    };
    if (!("Exile_Headgear_GasMask" in (assignedItems player)) || _beyondWorld) then {
        player setDamage ((damage player) + _damage);
    };
};

if !(ExilePlayerRadiation isEqualTo ExilePlayerRadiationLastCheck) then {
    ExilePostProcessing_RadiationColor ppEffectAdjust 
    [
        1,
        linearConversion [0, 1, ExilePlayerRadiation, 1, 0.45],
        linearConversion [0, 1, ExilePlayerRadiation, 0, -0.05],
        [0,0,0,0],
        [1.5,1.3,1,1 - ExilePlayerRadiation],
        [0.8,0.5,0.9,0],
        [0,0,0,0,0,0,4]
    ];
    ExilePostProcessing_RadiationColor ppEffectCommit 2;
    ExilePostProcessing_RadiationChroma ppEffectAdjust [0.02 * ExilePlayerRadiation,0.02 * ExilePlayerRadiation,true];
    ExilePostProcessing_RadiationChroma ppEffectCommit 2;        
    ExilePostProcessing_RadiationFilm ppEffectAdjust [ExilePlayerRadiation,8.39,8,0.9,0.9,true];
    ExilePostProcessing_RadiationFilm ppEffectCommit 2;
};
 

 

Share this post


Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

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.