Home   Help Search Login Register  

Author Topic: sticky bomb script  (Read 989 times)

0 Members and 1 Guest are viewing this topic.

Offline punisher

  • Members
  • *
sticky bomb script
« on: 25 Jul 2007, 22:44:34 »
hi
looking for a script to simulate sticky bombs. Probably done by an action near the tank maby disabling its fuel or attaching a satchel to it.
Had a search but all i found was a dead link here: http://www.ofpec.com/forum/index.php?topic=18208.0
Any help?
ta
The Gimp clan- pushing the limits of OFP
http://www.youtube.com/user/Pigdogmeat

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: sticky bomb script
« Reply #1 on: 25 Jul 2007, 23:28:34 »
Well, you can't really attach a satchel to a vehicle. You can place it near one on the ground... Luckily, there are ways around this ;)

If you know what tank you're planning to attach a sticky bomb to, then creating a script for it would be easy. First just add an action to the tank:
Code: [Select]
myTank addAction ["Attach Sticky Bomb","scripts\stickyBomb.sqs"]
Then, stickyBomb.sqs would look like this:
Code: [Select]
;stickyBomb.sqs

;Tank that the action is attached to.
_tank = _this select 0
;Action number to remove
_indexNumber = _this select 2

;Give the player 10 seconds to run away.
~10

;Get the position of the tank
_tankPos = getPos _tank
_tankX = _tankPos select 0
_tankY = _tankPos select 1

;Create a large explosion at the tank.
_stickyBomb = "LaserGuidedBomb" camCreate [_tankX,_tankY,1]
;Make sure he's dead :)
if (alive _tank) then {_tank setDammage 1}

;Remove the now redundant action
_tank removeAction _indexNumber

;exit script
exit
And walla! You have it! Just put that script in side a folder called "scripts" inside your mission directory.

If you want to add it to multiple tanks, then it gets a little more complicated... but hopefully that will work for now.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline punisher

  • Members
  • *
Re: sticky bomb script
« Reply #2 on: 26 Jul 2007, 01:32:34 »
Nice one mate jus the job
i modified it so the explosive was a mine and it just took out the treads :D
The Gimp clan- pushing the limits of OFP
http://www.youtube.com/user/Pigdogmeat