Jump to content
Sign in to follow this  
ffur2007slx2_5

Suicide Bomb Function

Recommended Posts

Suicide Bomb Function (4th May 2011 updated)

1858870430_04182011_1.png

Description:

Maybe my script is a little bit silly but I just wanna to make something easier when you are useing scripts. Maybe most of you can write such kind of script on your own but I still think it's necessary to post here just for those people who do not have enough time to write a script on his own but need it. This is my second function after Dynamic Weapon Generator Function, hope you like it, remember, make everything easy but works well is my purpose.

Features:

You can active this function anytime you want in a mission, you can make the suicide bomber attack any target you want, human, object, vehicle or GameLogic. The bomber can be enemy or friend, can attacking target by driving vehicle or on foot, but commit suicide by driving a plane is not included.

Version:

v1.46

Added: Secondary explosion of vehicle suicide assault

v1.45

Suicider bomber may carry different bombs to assault

Suicider bomber will no longer fleeing or refuse moving during an attack

v1.44

How to use it:

Download the function and put it into your mission, load your mission and put the code below into the unit's init:

sqf = [suicider,Victim,Attacking range (must be more than 35m)] execVM "WCRffsx_fnc_Suicide.sqf"

for example: sqf = [soldier0,player,250] execVM "WCRffsx_fnc_Suicide.sqf"; that means soldier0 will start attacking player when the distance between player and soldier0 is less than 250m.

Download:

http://www.freedrive.com/file/1442952,wcrffsx_fnc_suicide.sqf

Edited by ffur2007slx2_5
Updated

Share this post


Link to post
Share on other sites

ffur, a couple of questions;

Does this work in a multiplayer environment?

How does it cope if you tell it to attack player but there's more than 1 player in the game?

Share this post


Link to post
Share on other sites
ffur, a couple of questions;

Does this work in a multiplayer environment?

How does it cope if you tell it to attack player but there's more than 1 player in the game?

I haven't tested it through network, what about naming every player p1, p2, p3 etc.

Share this post


Link to post
Share on other sites

Hello,

Do not work for me, I placed a man or a car.

With the name soldier0 to test and as a target player.

I placed the command in the init of soldier0 and sqf in the mission folder.

He does not move when I enter less 250m ...

Edited by Th3DEAD

Share this post


Link to post
Share on other sites
I haven't tested it through network, what about naming every player p1, p2, p3 etc.

Could do though I'd want it to attack any player, rather than a specific one.

Share this post


Link to post
Share on other sites
Hello,

Do not work for me, I placed a man or a car.

With the name soldier0 to test and as a target player.

I placed the command in the init of soldier0 and sqf in the mission folder.

He does not move when I enter less 250m ...

Woops, I forget to tell you, it is recomanded to use civilian unit as the suicider because they can be hardly detected.

Then, it is also recomanded to set INDEPENDENTs friendly to EVERYONE.

At last, check whether the name of the unit is in accordance with the name of the suicider.

sqf = [civilian_1,player,250] execVM "WCRffsx_fnc_Suicide.sqf";

---------- Post added at 09:50 AM ---------- Previous post was at 09:35 AM ----------

Could do though I'd want it to attack any player, rather than a specific one.

What about

{sqf = [civilian,_x,250] execVM "WCRffsx_fnc_Suicide.sqf"} forEach playableUnits;

But I've no idea whether it really works.

Share this post


Link to post
Share on other sites

Then, it is also recomanded to set INDEPENDENTs friendly to EVERYONE.

Oh, that's a shame. I can't do that in my mission. I need to have independents enemy to everyone.

Share this post


Link to post
Share on other sites

you could do something like:

one function that checks the suicide bombers knowsabout about other units, and then do something like

highest knowsabout unit -> attack that unit -> If fail to attack, engage closest unit

fsm might be the way to go on this one, ill see what i can come up with.

Share this post


Link to post
Share on other sites
Oh, that's a shame. I can't do that in my mission. I need to have independents enemy to everyone.

Yep, that's just one of the problem I'm facing in the script, the opposite side units always preform wired when you force them to approach you, so that's why I suggest you choose the friendly side unit as the suicider because the script can runs better.

I can fix it but may at the cost without useing "addRating" so no nobody will defend themselves when the suicider is approaching, which may lead every suicide attack successfully.

I haven't find a better way avoid AI wired performance when their ratting is minus at present, but I believe I can make it in the next update.

---------- Post added at 02:48 PM ---------- Previous post was at 02:40 PM ----------

you could do something like:

one function that checks the suicide bombers knowsabout about other units, and then do something like

highest knowsabout unit -> attack that unit -> If fail to attack, engage closest unit

fsm might be the way to go on this one, ill see what i can come up with.

It might be a good idea but maybe the suicider will only choose the target he knows to attack even though the target is valueless.

I think in reality, the suicider will assault the most valuable target which he has the ability to approach. Attacking a normal soldier maybe a kind of waste.

Edited by ffur2007slx2_5

Share this post


Link to post
Share on other sites

there are a few workarounds to getting priority over something, it just becomes a bit more challenging with arrays of units.

---------- Post added at 17:10 ---------- Previous post was at 16:58 ----------

heres a sample mission:

http://www.mediafire.com/?6xgtxm2xrl1sz6w

I used ambient civilians here, and it randomly picks one of the civilians inside the trigger area and executes the script on them.

the script then checks to see if the civilians has identified a target of value (in this case west), then it checks to see which is closest to them, and rushes in blowing themselves up when in range.

not exactly finesse, but it works, and should work in MP if isServer is added into trigger condition.

how to call the script:

nul = [yourguy, WEST] execVM "SuicideBomber.sqf"

where WEST is the side that the unit will attack.

works with civs and works with any other side, but it would be recommended you dont give them a weapon, otherwise it defeats the purpose.

Share this post


Link to post
Share on other sites
there are a few workarounds to getting priority over something, it just becomes a bit more challenging with arrays of units.

---------- Post added at 17:10 ---------- Previous post was at 16:58 ----------

heres a sample mission:

http://www.mediafire.com/?6xgtxm2xrl1sz6w

I used ambient civilians here, and it randomly picks one of the civilians inside the trigger area and executes the script on them.

the script then checks to see if the civilians has identified a target of value (in this case west), then it checks to see which is closest to them, and rushes in blowing themselves up when in range.

not exactly finesse, but it works, and should work in MP if isServer is added into trigger condition.

how to call the script:

nul = [yourguy, WEST] execVM "SuicideBomber.sqf"

where WEST is the side that the unit will attack.

works with civs and works with any other side, but it would be recommended you dont give them a weapon, otherwise it defeats the purpose.

Good, I'll test it when I get back home tomorrow.

Share this post


Link to post
Share on other sites

This is frickin awesome, I nearly shat my pants just playing the test mission. At the top of your head, do you know how to make it activate only when west enters the trigger? (dont want haj chasing me unless i enter his town). I want to add this awesomeness to the MSO.

Share this post


Link to post
Share on other sites
This is frickin awesome, I nearly shat my pants just playing the test mission. At the top of your head, do you know how to make it activate only when west enters the trigger? (dont want haj chasing me unless i enter his town). I want to add this awesomeness to the MSO.

Maybe you can do like that:

x = [] Spawn { { if (side _x == WEST) then { fnc = [Attacker,_x,500] execVN "WCRffsx_fnc_Suicide.sqf"; sleep 0.01; }; } forEach allUnits;

Haven't tested yet, you can just make a try.:D

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  

×