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

This may or may not work-obs on defeat

Status
Not open for further replies.
So I'm just going to share this and ask if it works.

  • heroes defeat
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 1 (Red))) or ((((Triggering unit) is A Hero) Equal to True) and (((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True))
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit))) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Owner of (Dying unit)) treat (Picked player) as an Ally with shared vision
          • Player - Make (Picked player) treat (Owner of (Dying unit)) as an Ally with shared vision
Is this gonna work cause it doesn't in test mode.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Custom script: set bj_wantDestroyGroup = true
This destroys the group that is used below, immeditely. In this case you don't need to use any group veriable.

Otherwise, most of peoples recommend not use this, because I think it causes memory leaks/errors

Using a group veriable will be cleared like this:
  • Custom script: call DestroyGroup (udg_GroupName)
As for player problem, just use multiple conditions.
 
Status
Not open for further replies.
Top