• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

This can't be right...

Status
Not open for further replies.
Level 6
Joined
May 27, 2007
Messages
162
The event:

Unit - comes within 512 of Unit

Can the Unit, be a variable?

When I click it, it gives me the option of
1) Preset: No Unit / empty drop down menu
or
2) Variable / select unit / edit variables

I do have a variable which stores a unit. But that is not available for me to use!

Any help is greatly appreciated.
 
Use this action in a trigger:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type Asteroid) and do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger2 <gen> the event (Unit - A unit comes within 512.00 of (Picked unit))
  • Trigger2
  • Events
  • Conditions
    • //Conditions here (if any)
  • Actions
    • //Actions here
You can replace the picked unit with the variable you want, but, if you are going to use a variable, don't use the Unit Group action of course.
 
Level 6
Joined
May 27, 2007
Messages
162
Thanks again to both of you guys, I can see a little spot in the credits section when this gets finished :)...

I did as Pharaoh_ suggested, in adding a new event to an already built trigger. But now the problem that I have is, the built trigger, as the game goes on, gets more and more events added to it, and therefore triggers multiple times...

I'll try DarkAngelAzazels way next, seems simple enough but - knowing me - i'll probably trip up on something simple. Also, i'm looking into hashtables, they're pretty nifty, going to add a knockback script so that when an asteroid is hit it travels away from the miner... :)
 
Status
Not open for further replies.
Top