• 🏆 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!

[Trigger] Mass Selection

Status
Not open for further replies.
Level 19
Joined
Oct 1, 2008
Messages
1,667
  • P1
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Bear
          • (Unit-type of (Triggering unit)) Equal to Eagle
          • (Unit-type of (Triggering unit)) Equal to Forest Spirit
          • (Unit-type of (Triggering unit)) Equal to Spider
          • (Unit-type of (Triggering unit)) Equal to Stag
          • (Unit-type of (Triggering unit)) Equal to Wild Boar
          • (Unit-type of (Triggering unit)) Equal to Wolf
    • Actions
      • Unit Group - Pick every unit in (Units within 650.00 of (Position of (Triggering unit)) matching (((Unit-type of (Picked unit)) Equal to (Unit-type of (Triggering unit))) and ((Owner of (Picked unit)) Equal to (Owner of (Triggering unit))))) and do (Actions)
        • Loop - Actions
          • Selection - Select (Picked unit) for (Owner of (Triggering unit))


When a unit is selected, units of teh same type within a certain radius of it are also selected.
That is what this trigger is meant to do, but clearly Triggering Unit doesnt fit it. would there be any way of having something along the lines of Selected Unit or any other way of doing this?


UPDATE!
Here
 
Last edited:

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
It leaks also Try in Unit Group - Pick every unit in (Units within 650.00 of (Position of (Triggering unit)) matching (((Unit-type of (Matching Unit)) Equal to (Unit-type of (Triggering unit))) and ((Owner of (Matching Unit)) Equal to (Owner of (Triggering unit))))) and do (Actions)

Loop - Actions
 
Level 11
Joined
Nov 15, 2007
Messages
781
Triggering unit will work.

Some things to clear up;

Clean up leaks, look at the "Things that leak" post if you need help with it.
Rather than selecting units, do "select unit group"; your current trigger will pick first one unit, then clear selection and pick another unit.
Also, make sure the unit group only selects living units.
 
Level 19
Joined
Oct 1, 2008
Messages
1,667
Ok I managed to get a working trigger going but it somehow crashes Wc3...
Here it is:
  • P1
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Bear
          • (Unit-type of (Triggering unit)) Equal to Eagle
          • (Unit-type of (Triggering unit)) Equal to Forest Spirit
          • (Unit-type of (Triggering unit)) Equal to Spider
          • (Unit-type of (Triggering unit)) Equal to Stag
          • (Unit-type of (Triggering unit)) Equal to Wild Boar
          • (Unit-type of (Triggering unit)) Equal to Wolf
          • (Unit-type of (Triggering unit)) Equal to Pit Fiend
    • Actions
      • Selection - Select (Units within 650.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Triggering unit)))) for Player 1 (Red)
 
Your actions will execute the trigger and create a infinite loop.

Try this solution:

  • P1
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Bear
          • (Unit-type of (Triggering unit)) Equal to Eagle
          • (Unit-type of (Triggering unit)) Equal to Forest Spirit
          • (Unit-type of (Triggering unit)) Equal to Spider
          • (Unit-type of (Triggering unit)) Equal to Stag
          • (Unit-type of (Triggering unit)) Equal to Wild Boar
          • (Unit-type of (Triggering unit)) Equal to Wolf
          • (Unit-type of (Triggering unit)) Equal to Pit Fiend
    • Actions
      • Trigger - Turn off (This trigger)
      • Selection - Select (Units within 650.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Triggering unit)))) for Player 1 (Red)
      • Trigger - Turn on (This trigger)
 
Level 19
Joined
Oct 1, 2008
Messages
1,667
Your actions will execute the trigger and create a infinite loop.

Try this solution:

  • P1
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Bear
          • (Unit-type of (Triggering unit)) Equal to Eagle
          • (Unit-type of (Triggering unit)) Equal to Forest Spirit
          • (Unit-type of (Triggering unit)) Equal to Spider
          • (Unit-type of (Triggering unit)) Equal to Stag
          • (Unit-type of (Triggering unit)) Equal to Wild Boar
          • (Unit-type of (Triggering unit)) Equal to Wolf
          • (Unit-type of (Triggering unit)) Equal to Pit Fiend
    • Actions
      • Trigger - Turn off (This trigger)
      • Selection - Select (Units within 650.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Triggering unit)))) for Player 1 (Red)
      • Trigger - Turn on (This trigger)

Hmm, it should have, but didnt work..
 
Level 7
Joined
Aug 15, 2007
Messages
52
Im a vJasser, been ages since i did GUI. I made this which works but its buggy. maybe u can make it less buggy:

  • Select
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit Group - Pick every unit in (Random 1 units from (Units currently selected by Player 1 (Red))) and do (Actions)
        • Loop - Actions
          • Selection - Select (Units within 512.00 of (Position of (Picked unit)) matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Picked unit)))) for Player 1 (Red)
      • Trigger - Turn on (This trigger)
 
Level 7
Joined
Aug 15, 2007
Messages
52
took sometime to test and here is an unglitchy version, but the selection function itself is slow...
  • Select
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit Group - Pick every unit in (Random 1 units from (Units currently selected by Player 1 (Red))) and do (Actions)
        • Loop - Actions
          • Selection - Select (Units within 512.00 of (Position of (Picked unit)) matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Picked unit)))) for Player 1 (Red)
      • Wait 0.01 seconds
      • Trigger - Turn on (This trigger)
 
Status
Not open for further replies.
Top