I'm making a mission in which you have to get a barrel of radio active sands and load it into a LAV (called plomb).
I created a trigger with a 15 meters radius (trig_radio_activity) attached to the barrel (named radio_active) and grouped with my squad (any team member activates it), when a member of the team enters it, it launches this script:
_rad=0;
if (player in list trig_radio_activity) then {
ppEffectCreate ["colorCorrections", 1510];
"colorCorrections" ppEffectEnable true;
"colorCorrections" ppEffectAdjust[ 1, 1, 0, [-5, 0.09, 2.01, -0.09],[1.04, -0.6, -0.27, 1.05],[-5, -5, -5, 0]];
"colorCorrections" ppEffectCommit 10;
"ChromAberration" ppEffectEnable true;
"ChromAberration" ppEffectAdjust[0.1, 0.1, true];
"ChromAberration" ppEffectCommit 10;
"DynamicBlur" ppEffectEnable true;
"DynamicBlur" ppEffectAdjust[2.1];
"DynamicBlur" ppEffectCommit 10;
};
{while {_x distance radio_active <15 and alive _x} do {
_dist=_x distance radio_active;
_x setDammage (getDammage _x) + 0.01/(_dist*2);
_rad = _rad + (getdammage _x)*1000;
hintsilent format [localize "STR_RAD", name _x, round (_rad + (getdammage _x)*1000)];
sleep 0.1;
} } forEach list trig_radio_activity;
"colorCorrections" ppEffectAdjust [1, 1, 0, [0.0, 0.0, 0.0, 0.0], [1.0, 1, 1, 0.5], [0, 0, 0, 0.0]];
"colorCorrections" ppEffectCommit 10;
"ChromAberration" ppEffectAdjust[0, 0, true];
"ChromAberration" ppEffectCommit 30;
"DynamicBlur" ppEffectAdjust[0];
"DynamicBlur" ppEffectCommit 30;
if (cesium_loaded) exitwith {};
(str_rad= "%1 recieved %2 REMS")
The barrel has and addaction to take it which launches take_cesium.sqf:
(take_cesium= radio_active addAction [localize "str_take_cesium", "take_cesium.sqf",showWindow]
private "_caller";
_cesium = _this select 0;
_caller = _this select 1;
//_weapon= primaryWeapon _caller;
cesium_dropped=false;
publicVariable "cesium_dropped";
while {alive _caller} do {
//waituntil {_caller distance _cesium <2};
_caller playmove "AmovPknlMstpSlowWrflDnon_gear";
_cesium removeAction take_cesium;
//_caller action ["dropWeapon", _caller, _weapon];
sleep 2;
cesium_pris=true;
publicVariable "cesium_pris";
_cesium attachto [_caller, [-0.01,0.000,-0.05], "RightHandMiddle1"];
_cesium setVectorDir [5, 1, 1];
_cesium setVectorUp [0, 1, 1];
drop_cesium = _caller addAction [localize "str_drop_cesium", "drop_cesium.sqf",showWindow];
sleep 1;
if (cesium_dropped) exitWith {_cesium removeAction drop_cesium;};
if (not alive _caller) then {detach _cesium; _cesium setPos [getPos _cesium select 0, getPos _cesium select 1, 0]; _cesium setVelocity [0, 0, 0]; _caller removeAction drop_cesium;take_cesium= _cesium addAction [localize "str_take_cesium", "take_cesium.sqf",showWindow]; trig_radio_activity attachto [radio_active,[0,0,0]];};
waituntil {vehicle _caller == plomb};
_caller removeAction drop_cesium;
//_cesium removeAction take_cesium;
detach _cesium;
detach trig_radio_activity;
deletevehicle _cesium;
deletevehicle trig_radio_activity;
sleep 2;
cesium_loaded = true;
publicVariable "cesium_loaded";
if (true) exitwith {};
};
if (true) exitwith {};
drop_cesium.sqf:
private "_caller";
_cesium = radio_active;
_caller = _this select 0;
_caller removeAction drop_cesium;
_caller playmove "AmovPknlMstpSlowWrflDnon_gear";
sleep 1;
detach _cesium;
_cesium setPos [getPos _cesium select 0, getPos _cesium select 1, 0];
_cesium setVelocity [0, 0, 0];
trig_radio_activity attachto [radio_active,[0,0,0]];
cesium_dropped=true;
publicVariable "cesium_dropped";
take_cesium= _cesium addAction [localize "str_take_cesium", "take_cesium.sqf",showWindow];
In MP, I'm having the video effects but not other players if they enter the radius of radio activity. (that's what I've been said)
Video effects remain if i'm no more in the trigger's list but one member of my squad is.
if I order an AI to take the barrel of cesium, then to drop it, when I'm getting near the barrel, the damages doesn't seem to work anymore...
so:
- how can I make that video effects happens to each player and only if he gets less than 15m from the barrel?
- how can I make that they stop if the player is at a distance from the barrel greater than 15m even if a member of the squad isn't?
- I wish the damages start again each time you get near the barrel.
Thanks in advance, here's the link to the mission:
http://www.ofpec.com/forum/index.php?topic=34906.0