Forum Jump :

Author Message

vigil  



Posts: 2
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2009-08-28 04:29        
     
Hey Guys,
Been working on a scripting project that has me beating my head on the wall (like most programing does, cause I suck :P) What I'm trying to do is modify Jeevz's Improvised Explosive Device Script, to be able to recognize unit alignment rather than a single scripted object or trigger. I.E. BlueFor/RedFor/Indep truck passes within < 15 = preset explosion.

The Following is Jeevz's script, it's thus far the only thing that works, any ideas?

;start script
_theObject = _this select 0
_theExplosion = _this select 1

;locate the Object to be blown up
_bombLoc =  GetPos _theObject
_bombLocX = _bombLoc select 0
_bombLocY = _bombLoc select 1
_bombLocZ = _bombLoc select 2


; Deterimine the ordinance used to create the explosion
? (_theExplosion == "Small") : _ammoType = "R_57mm_HE"
? (_theExplosion == "Medium") : _ammoType = "M_Sidewinder_AA"
? (_theExplosion == "Large") : _ammoType = "M_Sidewinder_AA"
? (_theExplosion == "Huge") : _ammoType = "Bo_GBU12_LGB"

civvy1 globalchat _ammoType

; Get the explosion size and blow the object up

? (_theExplosion == "Small") : goto "SMALL"
? (_theExplosion == "Medium") : goto "MEDIUM"
? (_theExplosion == "Large") : goto "LARGE"
? (_theExplosion == "Huge") : goto "HUGE"


#SMALL
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_theObject setdammage 1
civvy1 globalchat "Small"
exit

#MEDIUM
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]

_theObject setdammage 1
civvy1 globalchat "Medium"
exit

#LARGE
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_theObject setdammage 1
civvy1 globalchat "Large"
exit

#HUGE
_ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ]
_theObject setdammage 1
civvy1 globalchat "Huge"
exit

This post was edited by Big (2009-08-28 05:54, ago)


Author Message

tcp  



Posts: 52
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2009-08-28 18:29        
     
If in the script, use an IF or CASE with
(side _theObject == west) //use either west, east, civilian, resistance


I've seen IEDs done without scripts and just a simple trigger:
Activation:
Once, BLUFOR present
Condition:
this && alive IED1
On Act:
_boom = "ARTY_R_227mm_HE" createVehicle (getpos IED1); _bomb = "Bo_GBU12_LGB" createVehicle (getpos IED1); IED1 setdamage 1;
IED1 can be a suicide bomber with waypoints or an object on the side of the road.
As you see there's a double explosion HE+GBU so anything close-by is sure to die, although there is a chance to prevent the explosion if you kill the suicide bomber before he gets close. Also, the trigger doesn't follow the suicide bomber, so a script might be better for more advanced handling i.e. only only being set off by vehicles, players on foot could move in and have an action to disarm. It would also let you init the script with the suicide bomber so he's not limited to a trigger zone.

EDIT: Here is something I put together, a simple IED script similar to Jeevz's except SQF is used and only vehicles set off the IED. Players on foot have the option to disarm them. You can initialize the script on any object you place in the editor. I'm only a beginner scripter, but I've playtested it and it should work. http://www.ofpec.com/forum/index.php?topic=34047.0

This post was edited by Big (2009-09-02 07:42, ago)


Advertisement


Author Message

vigil  



Posts: 2
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2009-09-02 07:17        
     
Thanks for the reply tcp, I'll give that a shot!
-vigil


Author Message

tcp  



Posts: 52
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2009-09-08 21:14        
     
UPDATED: Was not working reliably in MP.

IED/Suicide Bomber Script v02

UPDATED:
v02 Changelog
- publicVariables removed (was not being passed to server, only clients?)
- Suicide bomber works (triggers not used, nearObjects check, somewhat slower though)
- Ability to assign trigger to delay proximity check until activated (optional)

http://www.ofpec.com/forum/index.php?topic=34047.0


Author Message


Posts: 20660
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 44
In-game name: Foxhound

 
#5 Posted at 2009-09-08 22:28        
     
Thanks for posting the updated release. I have updated the news and the download page :thumb


This post was edited by Big (2009-09-10 10:49, ago)

Visit my family webshop desteigerhoutshop.nl.

Author Message

Jynx  



Posts: 23
Rank:


Level: Member

Country: us
Location: Memphis, TN
Occupation:
Age: 41
In-game name:

 
#6 Posted at 2009-09-09 04:54        
     
is there a way to have the rhino device on the uparmored hummers addon disarm or detect the ieds?

I am a soldier, I fight where I am told, and I win where I fight.
- General George Patton Jr

Author Message

tcp  



Posts: 52
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2009-09-10 08:20        
     
Yes, updated my script.

v03 Changelog
-added support for Rhino device
-changed nearestObject detection method

http://www.ofpec.com/forum/index.php?topic=34047.0

BTW, are you talking about ArmA1 or is that uparmored addon converted?

This post was edited by tcp (2009-09-10 08:37, ago)


Author Message


Posts: 115
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#8 Posted at 2009-09-10 08:46        
     
You are free to mess around and copy stuff from my scripts if you want, they are good for single player, but require some server side/client side isolation to get them working properly in multiplayer.

http://www.armaholic.com/page.php?id=4605
http://www.armaholic.com/page.php?id=4666


Author Message

Big  

Armaholic icons master


Posts: 5559
Rank:


Level: Former Staff

Country: es
Location: Who knows
Occupation: Industrial Engineer
Age: 44
In-game name:

 
#9 Posted at 2009-09-10 10:49        
     
tcp : Yes, updated my script.

v03 Changelog
-added support for Rhino device
-changed nearestObject detection method

http://www.ofpec.com/forum/index.php?topic=34047.0

BTW, are you talking about ArmA1 or is that uparmored addon converted?
Thanks, page updated:



Author Message

tcp  



Posts: 52
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#10 Posted at 2009-09-10 14:40        
     
Thanks POTS, I already happened to borrow from your scripts :) Originally, I was using a trigger and a player action to pass public variables when disarmed (which didn't pass to the server or something).

However, although I suspected I needed it, I left out isServer check. I blew up my entire squad on squad night with an atomic-sized IED since it was multiplied by the number of people in-game.

Anyways, I thought nearObjects would be slow, but it seemed like the best method for roaming VBIED/suicide bombers. It seems to work well, with only a small noticeable response time (0.5 second delay + processing) which puts you at or slightly past an IED with a 15 foot proximity when going full speed in a Humvee.

I could probably reduce the delay and not affect server performance since its has a fallback to sleep mode when no targets are within 300 meters.

Unless there's a way to increase performance on this and besides any bug-fixing, I think the only addition would be for suicide bombers to move towards targeted forces, either casually or at top speed. Although, that should probably run in a separate script.


Author Message

Jynx  



Posts: 23
Rank:


Level: Member

Country: us
Location: Memphis, TN
Occupation:
Age: 41
In-game name:

 
#11 Posted at 2009-09-11 18:38        
     
the arma 1 upumarmed hummers port straight into arma 2

I am a soldier, I fight where I am told, and I win where I fight.
- General George Patton Jr

Author Message

tcp  



Posts: 52
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#12 Posted at 2009-09-23 00:56        
     
Just to clarify, you are able to change the types of units that set off or disarm IEDs (only in the script though, not the initialization).

For example, to have a West soldier set off instead of disable the IED, follow this:

http://www.ofpec.com/forum/index.php?topic=34047.msg235277#msg235277

The vehicle you set to detect (and optionally detonate) will still work if you pass it in the initialization.


Author Message

tcp  



Posts: 52
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#13 Posted at 2009-10-02 21:32        
     
UPDATED - 20091002
v04 Changelog
- tweaked init delay/gap
- prevented objects from containing blast
- more luck variations, engineer considered

http://www.ofpec.com/forum/index.php?topic=34047.msg234390#msg234390


Author Message


Posts: 20660
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 44
In-game name: Foxhound

 
#14 Posted at 2009-10-03 00:20        
     
Thanks again :thumb
I have updated the news and the download page.


This post was edited by Foxhound (2009-10-03 07:52, ago)

Visit my family webshop desteigerhoutshop.nl.

Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#15 Posted at 2010-02-11 05:35        
     
_boom = "ARTY_R_227mm_HE" createVehicle (getpos IED1); _bomb = "Bo_GBU12_LGB" createVehicle (getpos IED1); IED1 setdamage 1;


How can i make it so that this simple trigger will follow a civilian instead of just sit there waiting for somnone to set it off? (first post by the way, and just starting to learn scripting)