Justin Waters

Changing Radiation Zone Configuration

12 posts in this topic

First off, thanks to Sgt. Scrap Metal who found my error in my code.

This will allow you to change the required items for accessing a radiation zone. 

Personally I've set it to Scientist or Gas Mask but you can replace the || with && to require both items.  

My custom\radiation\ExileClient_system_radiation_thread_update.sqf code:

Spoiler

/**
 * ExileClient_system_radiation_thread_update
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 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;
{
    _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)));
        };
        if (ExilePlayerRadiation > 0.7) then 
        {
            playSound [format ["Exile_Sound_GeigerCounter_High0%1", 1 + (floor random 3)], true];
            _damage = 1/(5*60) * 2;
        }
        else 
        {
            if (ExilePlayerRadiation > 0.3) then 
            {
                playSound [format ["Exile_Sound_GeigerCounter_Medium0%1", 1 + (floor random 3)], true];
                _damage = 1/(8*60) * 2;
            }
            else 
            {
                playSound [format ["Exile_Sound_GeigerCounter_Low0%1", 1 + (floor random 3)], true];
                _damage = 1/(12*60) * 2;
            };
        };
        if !("U_C_Scientist" in (uniform player) || "Exile_Headgear_GasMask" in (assignedItems player) ) then
        {
            player setDamage ((damage player) + _damage);
        };
    };
}
forEach ExileContaminatedZones;
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;
};

My Exile.Tanoa > cfgExileCustomCode:

	ExileClient_system_radiation_thread_update = "custom\radiation\ExileClient_system_radiation_thread_update.sqf";

You can also change the effects of the color/film grain/Chroma in this file. I did some research and found the following.

The ppEffectAdjust changes the settings of the post-processing effect. The ExilePostProcessing_RadiationColor/RadiationChroma/RadiationFilm are defined in the ExileClient_system_radiation_initialize.sqf 

Check out the BI Wiki for information about Post process effects

Spoiler

/**
 * ExileClient_system_radiation_initialize
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 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/.
 */
 
if !((getNumber (missionConfigFile >> "CfgExileEnvironment" >> worldName >> "Radiation" >> "enable")) isEqualTo 1) exitWith {false}; 
ExilePlayerRadiation = 0;
ExilePlayerRadiationLastCheck = 0;
ExilePostProcessing_RadiationChroma = ppEffectCreate ["ChromAberration",205];
ExilePostProcessing_RadiationChroma ppEffectEnable true;
ExilePostProcessing_RadiationChroma ppEffectAdjust [0,0,true];
ExilePostProcessing_RadiationChroma ppEffectCommit 0;
ExilePostProcessing_RadiationColor = ppEffectCreate ["ColorCorrections",1505];
ExilePostProcessing_RadiationColor ppEffectEnable true;
ExilePostProcessing_RadiationColor ppEffectAdjust [1,1,0,[0,0,0,0],[1.5,1.3,1,1],[0.8,0.5,0.9,0],[0,0,0,0,0,0,4]];
ExilePostProcessing_RadiationColor ppEffectCommit 0;
ExilePostProcessing_RadiationFilm = ppEffectCreate ["FilmGrain",2005];
ExilePostProcessing_RadiationFilm ppEffectEnable true;
ExilePostProcessing_RadiationFilm ppEffectAdjust [0,8.39,8,0.9,0.9,true];
ExilePostProcessing_RadiationFilm ppEffectCommit 0;

If you want to add an effect or remove one make sure to also edit ExileClient_system_radiation_event_onPlayerDied.sqf and ExileClient_system_radiation_event_onPlayerSpawned.sqf

Edited by Justin Waters
found solution!
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement
Quote

        if !("Exile_Headgear_GasMask" in (assignedItems player)) then
        {
            player setDamage ((damage player) + _damage);
        };

 

the line means ! =not  Exile_Headgear_GasMask in assignedItems player

but whats is an assignedItems? This means only items like "Watch" "Map" "GPS" "Nightvison" and the item where using this slots.

If you wanna use the clothin you need to change this i dont know wich its correct i need to search the right one himself but you can try this

        if !("U_C_Scientist" in  (uniform player)) then
        {
            player setDamage ((damage player) + _damage);
        };

 

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, Justin Waters said:

Perfect! thanks.

 

I believe that error was preventing it from overriding the original code. Its working now!

its woud be nice you give me a like then and give the whole forum the right answer who its working. So all other guys can just search for them and find them :)

 

Share this post


Link to post
Share on other sites
On 6.1.2018 at 1:46 PM, Shcaf said:

Does anyone have a tutorial on how to remove it? [radiation zone]

Remove the radiation zone from the server?

Take it out of mission.sqm (marker) and missionfile config.cpp (zone itself)

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.