Home   Help Search Login Register  

Author Topic: flak and cannon  (Read 487 times)

0 Members and 1 Guest are viewing this topic.

kobay

  • Guest
flak and cannon
« 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

IO Warrior

  • Guest
Re:flak and cannon
« Reply #1 on: 21 Dec 2004, 12:34:00 »
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
Code: [Select]
#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
Code: [Select]
#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...
« Last Edit: 21 Dec 2004, 12:39:17 by IO Warrior »

kobay

  • Guest
Re:flak and cannon
« Reply #2 on: 21 Dec 2004, 15:39:14 »
tnks so much IO

i'll try soon

hope works

UAH!

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:flak and cannon
« Reply #3 on: 21 Dec 2004, 15:43:44 »
you could also use the fire command and then you won't need the addon

kobay

  • Guest
Re:flak and cannon
« Reply #4 on: 21 Dec 2004, 16:50:09 »
what do you mean with fire? Triggerhappy

(trigger init: namecannon fire)

sorry im not so inside editing

Dubieman

  • Guest
Re:flak and cannon
« Reply #5 on: 21 Dec 2004, 18:38:52 »
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
« Last Edit: 21 Dec 2004, 18:39:15 by GuiltyRoachKillar »