• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

living unit count causing issues

Status
Not open for further replies.
Level 4
Joined
Apr 27, 2009
Messages
94
The trigger is very simple and yet causing an issue, as soon as I reach the limit of living units allowed, the trigger wont proceed working even when a unit dies.

  • every 1 second of game time
  • number of units in(units owned by player 1)less than 40
  • create 1 footmen
since it is a periodic event it is absolutely beyond me what could possibly be the problem.
 
Level 8
Joined
Aug 4, 2006
Messages
357
  • every 1 second of game-time
  • Set tempGroup = (Units owned by (Player 1) matching (Matching unit is alive))
  • If (Number of units in tempGroup) is less than 40
    • Then-Actions
      • Create 1 footman for player 1...
  • Custom script: call DestroyGroup(udg_tempGroup)
You have to make sure that the units are alive, otherwise it will be counting corpses. I did some extra stuff to remove the unit group leak.
 
Level 10
Joined
Nov 28, 2008
Messages
655
  • Spawn
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Number of units in (Units owned by Player 1 (Red))) Less than 5
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
  • Clean Up
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit - Remove (Dying unit) from the game
That works, just tested it.

If that interferes with stuff, you can probably find another way to do it.

I think, <think>, that it is not working because a unit is still "owned" by a player until is is completely gone, aka, the like 40 seconds decay time or whatever it is. So either reduce that, or remove the unit on death, and you should be good.


Edit: He did that one as I did this one, lol His looks cleaner, go with him.
 
Status
Not open for further replies.
Top