Home   Help Search Login Register  

Author Topic: Getting aircraft to target/fire on group infantry  (Read 883 times)

0 Members and 1 Guest are viewing this topic.

Offline jarvo9

  • Members
  • *
  • Freedom!
Getting aircraft to target/fire on group infantry
« on: 11 Oct 2005, 01:41:13 »
Okay this is what i would like to accomplish: Getting an aircraft to target and fire on a specific GROUP of infantry

I have tried using unitname dotarget unitname; unitname dofire unitname but it doesn't seem to work for a group of soldiers...

Any help welcomed !  ;)

Offline Pilot

  • Contributing Member
  • **
Re:Getting aircraft to target/fire on group infantry
« Reply #1 on: 11 Oct 2005, 01:47:21 »
Usually planes won't target infantry.  To force them to, try placing an invisible target at the leader's position every few seconds.

Get the invisible targets here

-Pilot

Offline jarvo9

  • Members
  • *
  • Freedom!
Re:Getting aircraft to target/fire on group infantry
« Reply #2 on: 11 Oct 2005, 02:01:05 »
I have tried using the invisable targets and it has worked with good timing for one pass but i haven't tried putting them on leader multiple times every few seconds cause i don't know how too...

Offline Pilot

  • Contributing Member
  • **
Re:Getting aircraft to target/fire on group infantry
« Reply #3 on: 11 Oct 2005, 03:21:27 »
Well, I can help with that ;)

Create a text file and name it target.sqs

Then copy and paste the following into the file:

Code: [Select]
_man = _this select 0
_target = _this select 1

_group = group _man
_groupLeader = leader _group

#Loop
?_group == grpNull: exit
_target setpos getpos _groupLeader
~5
goto "Loop"
Ok, I'm not %100 sure that will work, but I am pretty confident of it.

Now, create an invisible target and give it a name.

Now, in the leader's init field, type:
[this, NameOfTarget] exec "target.sqs"

NameOfTarget is the name you gave the target.  For example, if you name the target, tg1, you would use:
[this, tg1] exec "target.sqs"

As I said above, I am pretty sure the script will work, the only part I am unsure about is
Code: [Select]
?_group == grpNull: exit
-Pilot

Offline jarvo9

  • Members
  • *
  • Freedom!
Re:Getting aircraft to target/fire on group infantry
« Reply #4 on: 11 Oct 2005, 17:36:02 »
hmmm.... i tried that script but i can't get it to work at all, the rest of the group seems to target the leader. They kill him then script seems to end.

Thanks for trying though m8. Perhaps u could have another go at it  ;)


Offline Pilot

  • Contributing Member
  • **
Re:Getting aircraft to target/fire on group infantry
« Reply #5 on: 11 Oct 2005, 21:48:29 »
That's strange.  What kind of target are you using?  Are you sure it's friendly to the group?  If not, they will attack the target, and therefore the leader.

I'll take a look at it when I get access to OFP again.  It might be a day or two, though.

-Pilot

Offline 456820

  • Contributing Member
  • **
Re:Getting aircraft to target/fire on group infantry
« Reply #6 on: 11 Oct 2005, 22:41:06 »
theres a script in the scripting beta testing boards about 7 pages back nto sure what its called and i dont have a link but that was great

UNN

  • Guest
Re:Getting aircraft to target/fire on group infantry
« Reply #7 on: 12 Oct 2005, 14:00:56 »
Sounds like it's working ok. Only don't run the script from the group leaders init. Run it from the aircrafts init. Otherwise, as you said, they will just kill each other :)

Quote
As I said above, I am pretty sure the script will work, the only part I am unsure about is
Code:?_group == grpNull: exit

Yep, it should be:

Code: [Select]
? (IsNull _Group): exit

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Getting aircraft to target/fire on group infantry
« Reply #8 on: 12 Oct 2005, 19:45:10 »
I made a script that does as you have requested. It is a little dated as I have leared a few things since I first posted it but I have not taken the time to update it.

If interested, follow this link.

Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

Offline Pilot

  • Contributing Member
  • **
Re:Getting aircraft to target/fire on group infantry
« Reply #9 on: 13 Oct 2005, 17:42:11 »
Quote
Only don't run the script from the group leaders init. Run it from the aircrafts init. Otherwise, as you said, they will just kill each other :)
Can you please explain this, I don't understand.  All I'm doing is placing a target over the leader, how does calling the script from the leader's init field cause the other soldiers in the group to target the leader? ???

Quote
Yep, it should be:

Code: [Select]
? (IsNull _Group): exit

Ahhh, thanks for that :)

UNN

  • Guest
Re:Getting aircraft to target/fire on group infantry
« Reply #10 on: 13 Oct 2005, 22:49:03 »
Quote
All I'm doing is placing a target over the leader, how does calling the script from the leader's init field cause the other soldiers in the group to target the leader?

Yeah, you right, sorry. I kind of jumped the gun when he said the infantry were firing at the leader. Like you said, it sounds like the wrong target type.