Jump to content
Sign in to follow this  
Casio91Fin

Gives radiation

Recommended Posts

Hey.

How can I make this work so that the effects of radiation also work inside the vehicle?

Here is the script itself that only works for infantry

Trigger:

 Name: Radzone

Any Player

Present
Repeatable

Condition: this && (player in thislist)

On ACT: {[_x] execVM "Radzone.sqf"} forEach thislist;

 

Radzone.sqf:
 

_unit = _this select 0;

while {(alive _unit) && (_unit inArea RadZone)} do
{
    _uniform = uniform _unit;
    _goggles = goggles _unit;

    if

    ((["_CBRN_", _uniform] call BIS_fnc_inString)
    &&
    (["respirator", _goggles] call BIS_fnc_inString))

    then
    {}
    else
    {
        playSound "Geiger1";
        _distanceToCenter = _unit distance RadZone;
        _damage = (1 / _distanceToCenter) / 0.45;
        _damageTotal = (damage _unit) + _damage;
        _damage = _damage * 0.025 + (random 0.075);
        _unit setDamage _damageTotal;
        hint parseText format ["<t size= '3'><img image='pics\RadaV3.paa'/> <br/> <t size= '1'> <t color='#ffff00'>!YOU'RE IN THE RADIATION AREA!</t> <br/>Death will come: %1%2 /100%2</t>",round(_damageTotal * 100),"%"];
    };
Sleep 2.78;
};

Share this post


Link to post
Share on other sites

@Casio91Fin,

Quote

How can I make this work so that the effects of radiation also work inside the vehicle?


I'm not exactly sure but something like this should get you started,

Condition: this && ((vehicle player) in thislist) //vehicle player

On ACT: {[_x] execVM "Radzone.sqf"} forEach thislist;

Radzone.sqf:

_unit = vehicle player; // will likely work (to hurt the vehicle?)
_unit = vehicle player (assignedVehicleRole player select 0);// maybe this

Have fun!

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

This should work for both infantry and vehicles (infantry units are "crewed" by themselves) :

 

On ACT:

{
	_entity = _x;
	{
		if (!isplayer _x) exitWith {};//only if you want your script to apply to players only
		[_x] execVM "Radzone.sqf";
	} foreach (crew vehicle _entity);
} forEach thislist;

EDIT : as @wogz187 mentioned, you may need to include (vehicle player) in the Condition field, depending on the design of Radzone.sqf.

  • Like 2

Share this post


Link to post
Share on other sites

Thx now it works.
Radzone.sqf

/*
Trigger name: RadZone
Any Player
Present
Repeatable
trigger condition: this && ((vehicle player) in thisList)
trigger On Act: {[_x] execVM "RadZoneV2"} forEach thislist;
*/

_unit = _this select 0;

while {(alive _unit) && (_unit inArea RadZone)} do
{
    _uniform = uniform _unit;
    _goggles = goggles _unit;

    if ((["_CBRN_", _uniform] call BIS_fnc_inString)
    &&
        (["respirator", _goggles] call BIS_fnc_inString)) then
    {}
    else
    {
        playSound "Geiger1";
        _distanceToCenter = _unit distance RadZone;
        _damage = (1 / _distanceToCenter) / 0.45;
        _damageTotal = vehicle player;
        _damageTotal = (damage _unit) + _damage;
        _damage = _damage * 0.025 + (random 0.075);
        _unit setDamage _damageTotal;
        hint parseText format ["<t color='#ffff00'>!YOU'RE IN THE RADIATION AREA!</t> <br/>Death will come: %1%2 /100%2<br/><t size= '5'><img image= 'pics\RadaV3.jpg'</t>/>",round(_damageTotal * 100),"%"];
};
Sleep 2;
};

  • Like 2

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

×