BetterDeadThanZed

[RELEASE] Suffer minor damage even when wearing gasmask

6 posts in this topic

Posted (edited)

This is a very simple modification that causes a player to sustain lessened damage while in a radiation zone while wearing a gas mask. 

  • Create a folder in your server's mission pbo file called custom\radiation.
  • Create a file called ExileClient_system_radiation_thread_update.sqf and paste this code: 
    http://pastebin.com/c9ypNzXU
  • Open your mission pbo's config.cpp and go to the class CfgExileCustomCode section and add this line:
ExileClient_system_radiation_thread_update = "custom\radiation\ExileClient_system_radiation_thread_update.sqf";

Notes:

By default, while wearing a gas mask, a player receives 1% of the damage they would normally get while not wearing a gas mask. You can remain in the center of the radiation zone for a while and sustain relatively minor damage. You can adjust this percentage by adjusting this line:

player setDamage ((damage player) + _damage * .01);

Change the .01 to something else.  

Edited by BetterDeadThanZed
4 people like this

Share this post


Link to post
Share on other sites

ahh so this is where it is!

 

So this was very helpful thank you! How about lowering the visual effect?

Share this post


Link to post
Share on other sites
Advertisement

Pre 1.0 I set the first number in the diameter setting of the radiation zone to 0 but now that the radiation zones are defined in the mission.sqm I'm not sure how to reduce the effect. When I get back from vacation I'll see if I can find it or maybe during my absence maybe someone else can figure it out. 

Share this post


Link to post
Share on other sites

Posted (edited)

exile/addons/exile_client/code/ExileClient_system_radiation_initialize

once you know exactly what each value is post a setup where its not pitch black 1 foot infront of you at night with a flashlight on thx <3

itll have to be an override aswell so make a duplicate file stick it into ur mission file edit it then link it in the customcode in config

Edited by Crazy Mike

Share this post


Link to post
Share on other sites

Posted (edited)

Well. its not working for me. i followed your step. and into the game. nothing happened. even the zone its not hurt ppl.

the code i used ill post below:

 

/ **
* 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;
{
_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 / (1 * 60) * 2;
}

else
{
if (ExilePlayerRadiation> 0.3) then
{
playSound [format [ "Exile_Sound_GeigerCounter_Medium0% 1", 1 + (floor random 3)], true];
_damage = 1 / (3 * 60) * 2;
}
else
{
playSound [format [ "Exile_Sound_GeigerCounter_Low0% 1", 1 + (floor random 3)], true];
_damage = 1 / (5 * 60) * 2;
};
};
if! ( "Exile_Headgear_GasMask" in (assignedItems player)) then
{
player setDamage ((damage player) + _damage);
};
if ( "Exile_Headgear_GasMask" in (assignedItems player)) then
{
player setDamage ((damage player) + _damage * .01);
};
};
}
forEach ExileContaminatedZones;
if! (ExilePlayerRadiation isEqualTo ExilePlayerRadiationLastCheck) then
{
ExilePostProcessing_RadiationColor ppEffectAdjust
[
1,
linearConversion [0, 1, ExilePlayerRadiation, 1, 1.3],
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;
};

Fixed. Something Wrong with this code. i redownloaded its works :D

Edited by HeadCrabD

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.