• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Does that clear leaks for all the groups?

Status
Not open for further replies.
Level 7
Joined
Jul 7, 2008
Messages
332
Hi, In my map there are a lot of waves/levels where units are created for Dark Green.

For example:
  • Events
    • Unit - A unit owned by Player 11 (Dark Green) Dies
  • Conditions
    • ((All units of (Units owned by Player 11 (Dark Green)) are dead) Equal to True)
  • Actions
    • Set Group = (Units in (Playable map area) owned by Player 11 (Dark Green))
    • Unit - Create 5 Footman for Player 11 (Dark Green) at (Center of Spawn West <gen>) facing Default building facing degrees
    • Unit - Create 5 Footman for Player 11 (Dark Green) at (Center of Spawn Center <gen>) facing Default building facing degrees
    • Unit - Create 5 Footman for Player 11 (Dark Green) at (Center of Spawn East <gen>) facing Default building facing degrees
    • Custom script: call DestroyGroup( udg_Group )
    • Trigger - Turn on Level 3 <gen>
    • Trigger - Turn off (This trigger)
Would that clear the leaks for all the 3 group leaks?
Or I will have to do it like this:
  • Events
    • Unit - A unit owned by Player 11 (Dark Green) Dies
  • Conditions
    • ((All units of (Units owned by Player 11 (Dark Green)) are dead) Equal to True)
  • Actions
    • Unit - Create 5 Footman for Player 11 (Dark Green) at (Center of Spawn West <gen>) facing Default building facing degrees
    • Set Group = (Last created unit group)
    • Custom script: call DestroyGroup( udg_Group )
    • Unit - Create 5 Footman for Player 11 (Dark Green) at (Center of Spawn Center <gen>) facing Default building facing degrees
    • Set Group = (Last created unit group)
    • Custom script: call DestroyGroup( udg_Group )
    • Unit - Create 5 Footman for Player 11 (Dark Green) at (Center of Spawn East <gen>) facing Default building facing degrees
    • Set Group = (Last created unit group)
    • Custom script: call DestroyGroup( udg_Group )
    • Trigger - Turn on Level 3 <gen>
    • Trigger - Turn off (This trigger)
?


The question is: Is it possible to make a trigger which removes the leaks without adding the custom scripts to all the triggers? (There are a lot of them thats why)


For example this trigger would do the job?
  • Events
    • Time - Every 5.00 seconds of game time
  • Conditions
  • Actions
    • Set Group = (Units in (Entire map) owned by Player 11 (Dark Green))
    • Custom script: call DestroyGroup( udg_Group )
 
Level 9
Joined
Apr 3, 2008
Messages
700
First trigger won't work.
In the second one you can just write a custom script.
JASS:
call DestroyGroup(GetLastCreatedGroup)

Is it possible to make a trigger which removes the leaks without adding the custom scripts to all the triggers
You can do it on GUI if you use WEU. But Jass is much better.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
The first trigger wouldnt work
Do something like this:
  • For each Integer A from 1 t 5
    • loop actions
      • Set TempLoc = center of Spawn east
      • Unit - Create 1 Footman for Player 11(Dark Green) at TempLoc
      • Unit Group - add last created unit to Group
  • For each Integer A from 1 t 5
    • loop actions
      • Set TempLoc = center of Spawn center
      • Unit - Create 1 Footman for Player 11(Dark Green) at TempLoc
      • Unit Group - add last created unit to Group
  • For each Integer A from 1 t 5
    • loop actions
      • Set TempLoc = center of Spawn west
      • Unit - Create 1 Footman for Player 11(Dark Green) at TempLoc
      • Unit Group - add last created unit to Group
  • Do actions with 'Group'
  • Custom script: call DestroyGroup(udg_Group)
  • Custom script: call RemoveLocation(udg_Temploc)
 
Status
Not open for further replies.
Top