• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to apply event to unit-type, not specific unit?

Status
Not open for further replies.
Level 5
Joined
Jul 10, 2009
Messages
89
Hi, here's my trigger below. I was wondering if there is a way to make the event apply to all units of a certain type, rather than just the specific unit I have selected.

Thanks!


  • proximity
    • Events
      • Unit - A unit comes within 256.00 of Market 0059 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Mule
    • Actions
      • Wait 5.00 seconds
      • Unit - Order (Triggering unit) to Right-Click (Random unit from (Units owned by (Triggering player) of type Arcane Vault))
      • Unit - Order (Triggering unit) to Right-Click (Random unit from (Units owned by (Triggering player) of type Goblin Inventor))
      • Unit - Order (Triggering unit) to Right-Click (Random unit from (Units owned by (Triggering player) of type Tomb of Relics))
      • Unit - Order (Triggering unit) to Right-Click (Random unit from (Units owned by (Triggering player) of type Summons Rock))
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This enables it for all units of certain type that exist when the map starts:

  • Untitled Trigger 089
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Temp_Group_1 = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Footman))
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • Trigger - Add to (Your trigger) the event (Unit - A unit comes within 256.00 of (Picked unit))
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
This enables it for all units that are created during the game:

  • Untitled Trigger 090
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to (Your trigger) the event (Unit - A unit comes within 256.00 of (Triggering unit))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I advise learning to trigger before trying to make a serious map. You can not make good maps unless you are good at triggers.
Looking at GUI spells from the spell section would be a start, or if you are a programmer (which I hope you are) you can instantly skip GUI and look at JASS as it is far superiour to GUI.

Also sending it to a random unit from group has no structure at all, I advise revising your mule system if that is really what you want (the first 3 orders are usless anyway).
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
I advise learning to trigger before trying to make a serious map. You can not make good maps unless you are good at triggers.
Looking at GUI spells from the spell section would be a start, or if you are a programmer (which I hope you are) you can instantly skip GUI and look at JASS as it is far superiour to GUI.

Also sending it to a random unit from group has no structure at all, I advise revising your mule system if that is really what you want (the first 3 orders are usless anyway).

I know programming but i still use GUI,i don't understand why all you people insist on making users use Jass,since they don't want it...
Superior than GUI?Agreed.BUT still it is his choice.
 
Level 9
Joined
Jun 7, 2008
Messages
440
As to the first post, I dont think the trigger will even fire. . . It is set to triggering player. Does it not need to be owner of triggering unit?? Not to mention that that "mule" will be running around like a chicken with his head cut off. Hes going to be moving to each on of those (well, hes going to start running) but end up moving only to the last part of the trigger. As well, having the trigger set at map initialization (0.00) Would only work once. What if more units were built or bought??
  • Events
    • Unit - a unit comes within 256 of Market0059
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Mule
  • Actions
    • Unit - Pick every unit in (units of type <Your Type>) and do Set Temp_Group = (picked unit)
    • Wait 5 seconds
    • Unit - Pick every unit in (Temp_Group) and do Order (picked unit) to Right-Click Random unit from ( Units owned by (Owner of (triggering unit) of type Arcane Vault
    • Custom script: call DestroyForce(udg_Temp_Group)
 
Status
Not open for further replies.
Top