1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

problem with unit group experience

Discussion in 'World Editor Help Zone' started by Banti, Sep 8, 2014.

  1. Banti

    Banti

    Joined:
    Dec 21, 2012
    Messages:
    120
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Hi
    I am trying to get expieriece for my heroes using unit group and none of them is working
    • Unit Group - Pick every unit in (Units owned by Player 7 (Green) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Hero - Add 600 experience to (Matching unit), Hide level-up graphics

    • Unit Group - Pick every unit in (Units owned by Player 7 (Green) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Hero - Add 600 experience to (Picked unit), Hide level-up graphics
     
  2. Anvil

    Anvil

    Joined:
    Jun 8, 2011
    Messages:
    466
    Resources:
    9
    Models:
    6
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    9
    Add exp to Picked unit not matching unit.

    • Unit Group - Pick every unit in (Units owned by Player 7 (Green) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop: Acciones
        • Hero - Add 600 experience to (Picked unit), Hide level-up graphics
     
  3. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,526
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    To expand on the answer above. Picked unit is for inside the unit group loop
    Matching unit is for the condition on what units to add to the unit group.
     
  4. Banti

    Banti

    Joined:
    Dec 21, 2012
    Messages:
    120
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Thanks for your help, I make it work. I have question for you deathismyfriend. Do I have to make variable with Temp_Group and use
    • Custom script: call DestroyGroup (udg_Temp_Group)
    to avoid memory leak or it should be fine without.
     
  5. jonhysone

    jonhysone

    Joined:
    Oct 29, 2012
    Messages:
    1,244
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Well you can avoid creating a variable and just pick your units but before you pick them use this
    • Custom script: set bj_wantDestroy == true
     
  6. Anvil

    Anvil

    Joined:
    Jun 8, 2011
    Messages:
    466
    Resources:
    9
    Models:
    6
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    9
    ...

    Code (vJASS):
    set bj_wantDestroyGroup = true
     
  7. Banti

    Banti

    Joined:
    Dec 21, 2012
    Messages:
    120
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Thank you for all your help
     
  8. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,526
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    As stated you can do either but not both. Both can cause the map to crash.
     
  9. jonhysone

    jonhysone

    Joined:
    Oct 29, 2012
    Messages:
    1,244
    Resources:
    1
    Maps:
    1
    Resources:
    1


    Ops I was tired I forgot (Group) :S
     
  10. Mythic

    Mythic

    Media Manager

    Joined:
    Apr 24, 2012
    Messages:
    8,274
    Resources:
    144
    Models:
    122
    Icons:
    6
    Skins:
    1
    Maps:
    5
    Spells:
    6
    Reforged HD Icons:
    1
    Tutorials:
    3
    Resources:
    144
    You forgot to only put one equal sign too. :p