Jump to content
Sign in to follow this  
M3th0s

C4 Only

Recommended Posts

Hi there... I've got a problem with an UAV: I want destroy it ONLY with C4 (pipebomb)... I need this for a PVP with objectives map (like serch & destroy). So I found this script in Hunt Waldo mission (by Xeno) called c4only.sqf :

__________________________________________________________

//Original by Xeno

_obj = _this select 0;

_alive = true;

_obj setVehicleInit "this allowDamage false"; processInitCommands;

While{_alive} do

{

sleep 1.0;

_bomb = (getPos _obj nearObjects ["PipeBomb",10]) select 0;

if(not isNull _bomb) then

{

//latk = (_bomb nearObjects ["Man",10]) select 0;

latk = nearestObject [_bomb, "Man"];

WaitUntil {not alive latk or isNull _bomb};

if(isNull _bomb) then

{

_obj setVehicleInit "this allowDamage true"; processInitCommands;

_obj setDamage 1;

if(getDammage _obj == 1) then{_alive=false};

};

if((not alive latk) and (not isNull _bomb)) then {deletevehicle _bomb; latk = objNull};

};

};

__________________________________________________________

but this work with logic server and invisibile helipad... I don't understand it... It's possible put the script in the init of UAV center (or bulding) with out helipad or logic...?

Thx :rolleyes:

Edited by M3th0s

Share this post


Link to post
Share on other sites

Cool... I've never written that code (makes me wonder why // by Xeno is in it).

I think it is from KillJoy, the creator of Evolution.

Xeno

Share this post


Link to post
Share on other sites

you'd put:

null = execvm "c4only.sqf";

into the init of whatever objects you want to only be destroyed by satchels.

Share this post


Link to post
Share on other sites
you'd put:

null = execvm "c4only.sqf";

into the init of whatever objects you want to only be destroyed by satchels.

no, I tried this way but doesen't work... I can destroy it with smaw... :butbut:

but thx...

---------- Post added at 06:11 PM ---------- Previous post was at 06:05 PM ----------

Cool... I've never written that code (makes me wonder why // by Xeno is in it).

I think it is from KillJoy, the creator of Evolution.

Xeno

ahahahhahah LoL u don't wrote it? ahhaha this is funny.... where I can find this Killjoy? Or u maybe know a way to use this script or similar... thx Xeno :)

Share this post


Link to post
Share on other sites

my first idea was something like

this addEventHandler ["HandleDamage",{(_this select 4) == "PipeBomb"}]

(Only a PipeBomb can damage the object but if it's damaged by a pipebomb it's destroyed immediately.)

or

this addEventHandler ["HandleDamage",{if ((_this select 4) == "PipeBomb") then {_this select 2}}]

(Only a PipeBomb can damage the object - the damage by the pipebomb is passed through to the object.)

Share this post


Link to post
Share on other sites

I've written the Waldo thing, and I copied the original c4only.sqf out of the Evo mod in Armed Assault.

And I am quite sure that there was written //by Xeno in it.

Wait I'll just take a look, must have the mission somewhere backupped....

...

...yes, actually there's written //by Xeno in it. ^^

So I pimped it a bit since ArmA2 provides the allowDamage command and changed the //by Xeno to //Original by Xeno.

I think for me it works fine, btw the correct call in the initline must be

null = [this] execVM "c4only.sqf"

(dont forget to pass the object as a paramater)

I also think this c4only script was needed instead of just using an eventhandler because it is not really the Pipebomb itself that causes the damage but something else.

Share this post


Link to post
Share on other sites
I also think this c4only script was needed instead of just using an eventhandler because it is not really the Pipebomb itself that causes the damage but something else.

I made a quick test and my code worked flawlessly.

Share this post


Link to post
Share on other sites
I made a quick test and my code worked flawlessly.

Thx Guys! I'm going to test it! :yay:

Thx for answers :)

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  

×