OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: kobay on 21 Dec 2004, 10:55:15
-
hi every
please help me.......here is the question!
i place a cannon (flak or 88) on field then with my squad i have to find it.......when i get near the cannon with a trigger it should start firing......i dont care where but not at me
there is a command that make this?
thanks
-
1. name the cannon something eg. mycannon
2. put a target (invisible helipads are really good) and name it something eg. mytarget
3. let the trigger start a script...
cannonfire.sqs
#loop
mycannon dotarget mytarget
~1
mycannon fire (weapons mycannon) select 0
?(mycannon ammo ((weapons mycannon) select 0)) > 0: goto "loop"
This would make the cannon fire at the target untill it is out of ammo.
The 1 second delay is representing the reload time of the weapon (this could vary from weapon to weapon but doesnt really matter in this case, the script will still work).
I hope this does work because i dont have the time to test it ;)
If you want it to fire somewhere far away try this:
cannonfire.sqs
#loop
mycannon dowatch [getpos mytarget select 0,getpos mytarget select 1,100]
~1
mycannon fire (weapons mycannon) select 0
?(mycannon ammo ((weapons mycannon) select 0)) > 0: goto "loop"
here instead of dotarget we use dowatch and make the cannon watch a position 100 meters above the target. That should make it fire quite far...
-
tnks so much IO
i'll try soon
hope works
UAH!
-
you could also use the fire command and then you won't need the addon
-
what do you mean with fire? Triggerhappy
(trigger init: namecannon fire)
sorry im not so inside editing
-
Either way would work, but Triggerhappy, I think IO Warrior meant a regular H (invisible). Its in the objects. I don't think he meant the addon, which is also another way to go without muchscripting except for deleting the addon target...
So many routes to the same result...:P