Jump to content
Sign in to follow this  
keimosabe

what am I missing here...

Recommended Posts

I'm working with tcp's IED script and I've noticed a couple of things that you coder geniuses can help me with...

The IED scripts use a SIDE variable to determine which side activates the IED and in my case it is WEST. No problem. But when I start out and set a unit with "setcaptive true", apparently it removes the SIDE variable of that unit, which only makes sense.

Does "setcaptive false" return the unit to its original SIDE? The problem I am running into is that the "setcaptive true" units do not activate the scripts that are looking for a WEST side unit.

And in the script itself for TCP's IED, you can setup the class types that never fail to disarm an IED they are close to. Click the spoiler button to see the code as I am using it. "USMC_SoldierS_Engineer","ACE_usarmy_sapper","ACE_SF_FR_Sapper" are the three class types I have set up that SHOULD BE able to always detect and disarm them, but in my testing, no matter what class I use, the bomb always blows up, taking out my guy with it (unless he has been set to captive)

I have looked around but cannot find... Am I missing something with the script or do I have to just approach the vehicle a lot slower for a unit to detect the IED? I have never seen the IED successfully detected, so I don't know what to look for in my testing.

// The class types able to disarm the IEDs

_eod = switch (_side) do {

case west: {

["SoldierWB"]

};

case east: {

["SoldierEB"]

};

default {

["CAManBase"]

};

};

// Engineer/Demo Expert class types that never fail disarming

_engi = switch (_side) do {

case west: {

["USMC_SoldierS_Engineer","ACE_usarmy_sapper","ACE_SF_FR_Sapper"]

};

case east: {

[]

};

default {

[]

};

};

if (!isnil "_trg") then {

_wait=true;

while {alive _ied && _wait} do {

sleep _time;

if(triggerActivated _trg) then {_wait=false;};

};

};

_detect=false;

if(count _dtec > 0) then {_detect=true;};

_armed=true;

_wait=true;

_tim=5;

while {alive _ied && _wait} do {

sleep _tim;

_tim=_time;

_near = (getPos _ied) nearObjects 500;

if(_side countSide _near > 0) then {

_tmo=300;

_wait2=true;

while {(alive _ied) && (_wait2) && (_tmo > 0)} do {

sleep 0.5;

_near = (getPos _ied) nearObjects (_rad+40);

_nrsd = [];

{if(side _x == _side) then {_nrsd = _nrsd + [_x]}} forEach _near;

_count=count _nrsd;

for [{_x=0},{_x<_count},{_x=_x+1}] do {

_sel = _nrsd select _x;

_luck = random 1;

{if((_sel isKindOf _x) && ((_sel distance _ied) <= _rad)) exitWith {_wait=false; _wait2=false; if(_luck < 0.33 && speed _sel < 10 && !(_ied isKindOf "CAManBase")) then{_armed=false;};}} forEach _targ;

{if((_sel isKindOf _x) && ((_sel distance _ied) <= 5)) exitWith {_wait=false; _wait2=false; {if(_sel isKindOf _x) then {_armed=false; hint "Disarmed";};} forEach _engi; if(_armed && _luck > 0.1) then {_armed=false; hint "Disarmed";};}} forEach _eod;

if(_detect) then {

{

if(_sel isKindOf _x) then {

if (_luck > 0.80) then {

_wait=false;

_wait2=false;

};

if (_luck < 0.03) then {

hint "Detected IED";

};

};

} forEach _dtec;

};

};

_tmo=_tmo-1;

};

};

};

as usual, thanks in advance for the help and props to TCP and POTS for their scripts. :)

Share this post


Link to post
Share on other sites

Sorry, it is a bit late for me to check out the code, maybe tcp might find the time to address your problem.

What I CAN actually confirm, is, that "<object> setcaptive true" makes the <object> change side to "CIVILIAN", and change its side back by using "<object> setcaptive false".

Share this post


Link to post
Share on other sites

OK, thanks for confirming that lil' bit. I found in another site (I think Armaholic) where tcp was in on a discussion about his script where he said something to the effect that he was not able to get the DISARM action to come up server side. I wonder if he got it fixed. I'll try and PM him about it.

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  

×