OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bobthedinosaur on 15 Jan 2004, 23:52:28
-
is there a way to place a load of satchel charges at certain places using the editor and then give a unit the trigger to blow them all up?
-
yes, you can do it with scripts
; satchel.sqs
Unit = _this select 0
; how to use [dudes name] exec "satchel.sqs"
Normal = Unit AddAction [FORMAT["Blow up satchels"],"blowbomb.sqs"]
; add the action to blow up the bombs
exit
; blowbomb.sqs
Unit RemoveAction Normal
; remove the action that was added in satchel.sqs
; Add more of these to blow up more satchels replace Pipey with the name of the satchel
"LASERGUIDEDBOMB" camCreate getpos Pipey
; create a explosion at the satchel charge
~0.35
Pipey setpos [getpos Pipey select 0, getpos Pipey select 1, (getpos Pipey select 2) -10]
; make it so the satchel charge is no longer viewable
~0.1
"LASERGUIDEDBOMB" camCreate getpos Pipey2
; create explosion at another satchel
~0.35
Pipey2 setpos [getpos Pipey2 select 0, getpos Pipey2 select 1, (getpos Pipey2 select 2) -10]
; make it so satchel charge is no longer visible
~0.1
exit
This is taken from one of my scripts that was made a long long time ago, so i dont know if it still works.
You could probably replace
Pipey setpos [getpos Pipey select 0, getpos Pipey select 1, (getpos Pipey select 2) -10] lines
with deletevehicle Pipey
;)
-
ok thanx, i'm a bit dumb though and i know nothing about scripts
could you explain a few things about what you just said?
-
ok, i added some comments to the code previously posted.
-
bobthedinosaur, read snYpir's Friendly Intro to Code snippets and also Johan Gustafsson's scripting guide, if you haven't already.
-
ok
while the subject is up
im after a script were a sachel will start (maybe at a flagpole if it makes it EZer)
and it will detonate in 3 seconds
-
try this
; boom.sqs
; use by:
; [satchel_charge_name, flagpole_name] exec "boom.sqs"
_sat = _this select 0
_moveto = _this select 1
_tim = 0
_sat setpos getpos _moveto
#loop
~1
_tim = _tim + 1
?(_tim >= 3):goto "next"
goto "loop"
#next
"LASERGUIDEDBOMB" camCreate getpos _sat
~0.5
deletevehicle _sat
exit
then place a satchel charge on the map somewhere and a flagpole somewhere too
Then run this script and the satchel will move over were the flag pole is and blow up in 3 second.
you could also put the line _sat setpos getpos _moveto in the init.sqs script so the satchel moves to the flagpole at the start of the missions :)
-
can u actually start with a satchel charge sitting there and not use the laserguided bomb trick?
-
You can camcreate a 'timebomb' but it takes 30 seconds to explode. I don't know how to make the time shorter nor I know how to make camcreated 'pipebomb' explode because setting damage to it doesn't work.
-
no, you cant make satchel charges explode without camcreated a explosion over them then removing the satchel charge.