Jump to content
Sign in to follow this  
Pte Frank -3para-

BAF ied trigger / help with arrest script / lift script anyone?

Recommended Posts

BAF ied trigger..this is the big bit i need help on because i really want to use this in an upcoming mission.

basicly im trying to place lots of the BAF ied's on the map and then have a trigger so if you drive or walk a little bit behind the IED's they will go off.

the problem i have is i dont know how to place them in the editor, i have found an ied under backpacks, but its invisable....and in the mission.sqf its called the "IED_placement_BAF"..any ideas? how can i place things like "BAF_ied_v2" so i can synx them with a tirgger?

.......................................................................................................

no lift script..i made one

Edited by Pte Frank [3para]

Share this post


Link to post
Share on other sites

thanks, but ive seen them before :/ sorry, the baf ied is just i want to be able to place it prior to the game in editor so when the mission starts its already there and armed waiting to be set off by a trigger.

at the moment im trying to use

_spawnunit "BAF_ied_v1" setpos 0;

then work out how to attach to a trigger to set it off...should i name the ied?

.......................................................................................................

and the arrest is the one i basied mine off...i got all that its more the drag the arrested person and load in and out of cargo i need help with.

thank you for your swift response though :D

Share this post


Link to post
Share on other sites

The BAF IEDs aren't "shells" but "magazines" and are as explosive as a mag of 5.56 would be in game terms. So you can't createVehicle one and get it to explode like a grenade or artillery shell would. So to use them they need to be placed and activated by a unit.

I'm still, disappointingly, unable to make any use of that IED_placement_BAF backpack item thing. No idea how it's even supposed to be used and as we cannot open up the mission files for the campaign (if it's even in there) there's no examples of it's usage available.

So for now, BAF IEDs aren't really Editor placeable, but they are scriptable. You can like place a gamelogic and createVehicle one at it's location and use a trigger to create an explosion like normal though.

Do you actually need to "drag the arrested person and load in and out of cargo" for your script? If so, just use one of my hostage scripts for that perhaps? It'll join them to your group, you can control them like AI.

Share this post


Link to post
Share on other sites

well ive used the old "GRF_iedcreator" and replaced the items in there with the mag mane "BAF_ied_v1" and in the game it will spawn the ied so i can see it it just then does not explode...were as if you place an object such as "explosives" or any small object event a can or the loud speakers, it will still spawn the explosives but they will explode (as the script tells you it will).

i was just wondering if it could be the fact it was a mag or something eles and if there was a way about this.....

i dont like ai joining groups i want the mission to feel very hands on...i have been experimenting with the norin revive wich has a drag body function. and a load in and out of cargo function...but its really complicated to copy and remove the unconciouse bt lol.

i am extremly greatful for your help though :), the stuff i have made is still all usable i just wanted to add some gritty realism to it lol.

........................................................................................................

i think ill go back to using barrels and containers for ied's (or use the ai) and keep the teleport function for the arrest then.

they work just not very realistic lol.

......................................................................................................

update:

i dont need a lift one i have made one my self :).

Edited by Pte Frank [3para]
update

Share this post


Link to post
Share on other sites

Don't know if this will help but you could just place a trigger with activation BLUFOR, the in the "on act" box place

bomb="Bo_MK82" createVehicle (getPos IED)

that will make the object named IED (or whatever in place of IED) explode when a BLUFOR unit enters the trigger radius. It can be used multiple times as long as there is a seperate trigger and name for each item you want to explode.

Edited by FBX
Spellcheck

Share this post


Link to post
Share on other sites
Don't know if this will help but you could just place a trigger wit activation BLUFOR, the in the "on act" box place

bomb="Bo_MK82" createVehicle (getPos IED)

that will make the object named IED (or whatever in place of IED) explode when a BLUFOR unit enters the trigger radius. It can be used multiple times as long as there is a seperate trigger and name for each item you want to explode.

that does sound usful...the only thing now is how to put the ied in the editor..

this is what it looks like in the ied creator script that places them in game (wich works...but no explosion)..

im looking to be able to place these ied from baff and an engerneer to be able to disarm as they can..but for if people walk right over them they will explode....thats the reason.

"west" is the side the IED will be triggered for. You can use "east" or "resistance" as well.

Civilian or anyone will NOT work!!!

In the script itself you can edit these areas:

======IED locations======

Specify below all marker names you have added (you need to use empty markers!!!) to your mission as to be a possible IED!

For example:

_iedarray = ["ied1","ied2","ied3","ied4","ied5"]

======IED types======

Add all possible ied's you want the script to choose from. For now an IED can only be

an object type (in the editor choose empty ---> objects!!!!)

Please note that wrecks can not be destroyed by the player cause they are wrecked already. So if you ;add wrecks to this array the players cant do anything to destroy those!

For example:

_spawnunit = ["BAF_ied_v1","BAF_ied_v2","BAF_ied_v3","M113Wreck","hiluxWreck"]

======IED ordinance types======

Here you can specify what type(s) of ammo you want the script to select from to be used as the explosives.

For example:

GRF_ammo_array = ["Sh_125_HE","Bo_GBU12_LGB","Sh_122_HE","Sh_125_HE","Sh_122_HE","Sh_122_HE"]

======IED radius======

Here you can specify at what distance (in meters) a created IED should explode.

For example:

_radius = 10

======IED deactivation======

If you want to allow the player to be able to shoot/destroy suspected IED's set this value to true.

If you dont want the player to be able to shoot/destroy IED's set this to false.

Please keep in mind pallets and wrecks (and maybe other objects I missed/didnt try) can NOT be ;destroyed since they dont register of being hit (a wreck is already destroyed and pallets dont explode right?)

Like this:

_deactivation = true

or

_deactivation = false

---------------------------------------------------

Credits

---------------------------------------------------

I suggest and ask you kindly to not modify this script at this point (let me finish it), however if you want to edit, change or use this script in anyway give me credit for the work I have done.

I have used 2 elements in this script I got from one of Kronzky's scripts.

The not working array elements (call and sent array scripts) were given to me by Bobor SK

---------------------------------------------------

License & disclaimer

---------------------------------------------------

You are permitted to use this script for personal entertainment purposes only.

Any commercial and/or military use is strictly forbidden.

if anyone knows this script....

if this doesnt make any sense to anyone then its ok im sorry but you are all giving really good ideas :)...

BTW: this is not my script and it is for personal use (and clan) but it is not for commerial use nor milltary.

...........................................................................................................................................................

all further spoilers are the other files from the said script

...........................................................................................................................................................

fox_ied.sqf

;Random IED script

;Made by El nino Foxhound

;Version beta 0.1 - 29/04/2007

;visit http://www.armaholic.com

;exit if the local machine is not server

GRF_total_ied_array = []

GRF_name = "GRF"

?!(local server): exit

[] exec "GRF_iedcreator\removeammo.sqs"

;======INIT======

GRF_IED_randomElement = {private["_r"]; _r = random (count _this); _r = (_r - (_r mod 1)); (_this select _r)}

;======IED positions======

;Please specify below all marker names you have added (you need to use empty markers!!!) to your mission as to be a possible IED!

_iedarray = ["ied1","ied2","ied3","ied4","ied5","ied6","ied7","ied8","ied9","ied10","ied11","ied12","ied13","ied14","ied15","ied16","ied17","ied18","ied19","ied20","ied21","ied22","ied23","ied24","ied25","ied26","ied27","ied28","ied29","ied30","ied31","ied32","ied33","ied34","ied35","ied36","ied37","ied38","ied39","ied40","ied41","ied42","ied43"]

;======IED types======

;Add all possible ied's you want the script to choose from. For now an IED can only be

;an object type (in the editor choose empty ---> objects!!!!)

;Please note that wrecks can not be destroyed by the player cause they are wrecked already. So if you ;add wrecks to this array the players cant do anything to destroy those!!!!!!

_spawnunit = ["BAF_ied_v1","Explosive","Explosive","Old_bike_TK_INS_EP1","BAF_ied_v2","BAF_ied_v3","BAF_ied_v4"] -on a side note this works in in spawning the ied's but they dont explode

;======IED ordinance types======

;Here you can specify what type(s) of ammo you want the script to select from to be used as the ;explosives.

GRF_ammo_array = ["R_80mm_HE","R_80mm_HE","R_80mm_HE","R_80mm_HE","R_80mm_HE"]

;======IED radius======

;Here you can specify at what distance (in meters) a created IED should explode.

_radius = 8

;======IED deactivation======

;If you want to allow the player to be able to shoot/destroy suspected IED's set this value to true.

;If you dont want the player to be able to shoot/destroy IED's set this to false.

;Please keep in mind pallets and wrecks (and maybe other objects I missed/didnt try) can NOT be ;destroyed since they dont register of being hit (a wreck is already destroyed and pallets dont explode ;right?)

_deactivation = true

;=====start=====

_sideX = if (((_this find "west")!=-1) || ((_this find "WEST")!=-1)) then {"WEST"} ELSE {"ANYONE"}

?(_sideX == "WEST") : goto "start"

_sideX = if (((_this find "east")!=-1) || ((_this find "EAST")!=-1)) then {"EAST"} ELSE {"ANYONE"}

?(_sideX == "EAST") : goto "start"

_sideX = if (((_this find "resistance")!=-1) || ((_this find "RESISTANCE")!=-1)) then {"RESISTANCE"} ELSE {"ANYONE"}

?(_sideX == "RESISTANCE") : goto "start"

#start

_chance = _this select 0

_sideX = _this select 1

;player sidechat format ["side is set to %1",_sideX]

_i = 0

GRF_ied_array = []

_totalieds = count _iedarray

?_radius < 6 : _radius = 6

GRF_radious = _radius

GRF_name = GRF_name + format ["%1",_i]

ied.sqs

;======Ordinance=====

;Below you can specify an array of possible explosions, the script will randomly select 1. Keep in mind that if you add ammotypes of lesser "damage" but you want to kill the unit you should make the radius of the IED activation smaller to be sure the closest unit gets killed.

_ordinance = GRF_ammo_array call GRF_IED_randomElement

;======Start=====

;Edit below at your own risk!!

_unit = _this Select 0

_radious = call {GRF_radious}

#start

_z = nearestObjects [_unit, ["Thing","Static"], _radious + 4]

_checker = count _z

_i = 0

?_checker < 1 : exit

#loop

_nObject = _z select _i

?!(alive _nObject) : exit

_name_checker = _nObject in GRF_ied_array

;player sidechat format ["value of namechecker = %1",_name_checker]

?_name_checker : goto "explosion"

_i = _i + 1

?_i != _checker : goto "loop"

;player sidechat "IED not found in array, seems this was a dud!!! so exiting again"

exit

#explosion

_nObjectpos = getpos _nObject

_nObjectposX = _nObjectpos select 0

_nObjectposY = _nObjectpos select 1

_nObjectposZ = _nObjectpos select 2

_a = nearestObjects [_nObject, ["Man"], _radious + 2]

_b = nearestObjects [_nObject, ["Car","Motorcycle"], _radious + 2]

_c = nearestObjects [_nObject, ["Tank"], _radious + 2]

_d = nearestObjects [_nObject, ["Tank","Car","Motorcycle"], _radious + 2]

_ordinance createvehicle [_nObjectposX,_nObjectposY,_nObjectposZ]

~0.05 + random 0.3

?_ordinance != "Bo_GBU12_LGB" : _ordinance createvehicle [_nObjectposX,_nObjectposY,_nObjectposZ]

~0.01

{_x setdamage (0.85 + random 0.15)} foreach _a

{_x setdamage (0.8 + random 0.2)} foreach _b

{_x setdamage (0.75 + random 0.25)} foreach _c

_damage_test = damage _unit

;player sidechat format ["unit damage = %1",_damage_test]

_gamble = random 100

?_gamble > 0 : goto "survive"

?!(alive _unit) : Exit

_unit setdamage 1

Exit

ied_destroyed.sqs

;======Ordinance=====

;Below you can specify an array of possible explosions, the script will randomly select 1. Keep in mind that if you add ammotypes of lesser "damage" but you want to kill the unit you should make the radius of the IED activation smaller to be sure the closest unit gets killed.

_ordinance = GRF_ammo_array call GRF_IED_randomElement

;======Start=====

;Edit below at your own risk!!

_dead_ied = _this select 0

_pos = getpos _dead_ied

_oldposX = abs(_pos select 0)

_oldposY = abs(_pos select 1)

_oldposZ = abs(_pos select 2)

~0.2

;player sidechat format ["ordinance = %1",_ordinance]

_ordinance createvehicle [_oldposX, _oldposY, _oldposZ]

~0.05 + random 0.3

"Sh_125_HE" createvehicle [_oldposX, _oldposY, _oldposZ]

~0.05 + random 0.3

_gamble = random 100

?_gamble > 50 : goto "end"

_ordinance createvehicle [_oldposX, _oldposY, _oldposZ]

exit

receiveArray.sqf

private ["_channel","_array","_i","_count"];

_channel = _this;

while {var_forever} do

{

call compile format ["waitUntil{var_sendArray%1}",_channel];

call compile format ["var_sendArray%1 = false",_channel];

_array = [];

call compile format ["_count = var_sendArray%1Count",_channel];

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

{

call compile format ["_array = _array + [var_sendArray%1Value%2]",_channel,_i];

};

call compile format ["var_receivedArray%1 = _array",_channel];

};

removeammo.sqs

#loop

?var_forever : goto "Del_ammo"

~4

;player sidechat "waiting"

goto "loop"

#Del_ammo

_T_ied = call {var_receivedArray1}

;player sidechat format ["array = %1",_T_ied]

_i = 0

_nr_ieds = count _T_ied

?_nr_ieds < 1 : exit

#remove_ammo

_Dammo = _T_ied select _i

_Dammo setAmmoCargo 0

_Dammo setVehicleAmmo 0

clearWeaponCargo _Dammo

clearMagazineCargo _Dammo

removeAllWeapons _Dammo

_i = _i + 1

?_i == _nr_ieds : exit

goto "remove_ammo"

sendArray.sqf

private ["_array","_channel","_count","_i"];

_array = _this select 0;

_channel = _this select 1;

_count = count _array;

call compile format ["var_sendArray%1Count = _count; publicVariable ""var_sendArray%1Count""",_channel];

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

{

call compile format ["var_sendArray%1Value%2 = _array select _i; publicVariable ""var_sendArray%1Value%2""",_channel,_i];

};

call compile format ["var_sendArray%1 = true; publicVariable ""var_sendArray%1""",_channel];

btw i am a fan of this script and who ever made it

Edited by Pte Frank [3para]

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  

×