Home   Help Search Login Register  

Author Topic: Detect units in radius of Mapclick  (Read 1111 times)

0 Members and 2 Guests are viewing this topic.

GavinP

  • Guest
Detect units in radius of Mapclick
« on: 11 Jun 2006, 19:19:00 »
Hi, not sure whether this belongs here, or advanced, but hopefully I'll get an answer either way! 8)

Is it possible to detect units within a given radius of a mapclick, and add them to a list, in the same way units within a trigger are part of a list?

What I'm doing is making a simple air support script, which works fine at the moment with invisible targets etc. However, I want the plane to be able to also spot targets within a given radius of their 'target' which they can call the player and request go/no go attacks.

I'm looking for the simplest route, which must be MP compatible (Should there be two ways of doing this!)

Cheers guys,


GavinP

  • Guest
Re: Detect units in radius of Mapclick
« Reply #1 on: 12 Jun 2006, 11:39:03 »
13 views and no answer. I'm getting the impression that this isn't going to be possible. :(

Looking at it another way, is it possible to create a trigger during 'run time'?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Detect units in radius of Mapclick
« Reply #2 on: 12 Jun 2006, 18:41:57 »
off the top of my head, easiest way would be to create your trigger, give it a name, and during runtime, move it to the coordinates given by the mapclick.

whether or not that method is MP compatible is another matter. test it and see.

Homefry

  • Guest
Re: Detect units in radius of Mapclick
« Reply #3 on: 12 Jun 2006, 18:54:10 »
13 views and no answer. I'm getting the impression that this isn't going to be possible. :(

Looking at it another way, is it possible to create a trigger during 'run time'?

I don't believe you can create triggers throught scripting commands.  Furthermore, I don't believe you can edit trigger properties through scripting.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Detect units in radius of Mapclick
« Reply #4 on: 12 Jun 2006, 20:41:35 »
Quote
...I don't believe you can edit trigger properties through scripting...

Code: [Select]
trigger_name setpos some_place
deletvehicle trigger_name

that's about the extent of it as far as i know.

GavinP

  • Guest
Re: Detect units in radius of Mapclick
« Reply #5 on: 12 Jun 2006, 20:53:31 »
 8)

Cheers guys, the trigger idea worked. I'd never noticed the name box before on the trigger!

Anyway, the trigger is working perfectly now, so all I need is to work with the list returned now. Not done much with arrays, so this should be an interesting learning curve.

Scripting is one hell of an addictive thing. I find myself way out of my league very quickly! Its guys like you that deserve all the credit.