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

Unit Groups screwed me...

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Yo! I have a problem here. I want to make a simple spell that picks all units of one type and then makes them damage units around them but it seems that i have a problem... The trigger is below and it does NO damage.

+rep will be given to helpers!

  • VenomHoleDoT
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set VenomHoleHolesGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Venom Hole))
      • Unit Group - Pick every unit in VenomHoleHolesGroup and do (Actions)
        • Loop - Actions
          • Set VenomHoleVenoms = (Picked unit)
          • Set VenomHoleVenomLevel = ((Mana of VenomHoleVenoms) / 100.00)
          • Set VenomHoleVenomPosition = (Position of VenomHoleVenoms)
          • Set VenomHoleUnitGroup = (Units within (120.00 + (40.00 x VenomHoleVenomLevel)) of VenomHoleVenomPosition matching (((Matching unit) belongs to an enemy of (Owner of VenomHoleVenoms)) Equal to True))
          • Unit Group - Pick every unit in VenomHoleUnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause VenomHoleVenoms to damage (Picked unit), dealing VenomHoleVenomLevel damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_VenomHoleVenomPosition)
When my hero casts the spell, it creates that Venom Hole unit and sets it's mana to be equal to the level of the spell for the hero x 100. This way i transfer the level of the spell for the hero to another trigger :D. The unit has no mana regeneration, duh...
 
Level 3
Joined
May 15, 2012
Messages
61
Has Warcraft 3 problems with two actions of type "Pick every unit..." stacked in each other?

I mean, dies Warcraft know which picked unit you mean by calling "Picked Unit" - the inner or the outer one?
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

No Warcraft 3 shouldn't have any problems with that kind of trigger, also I used this kind so many times before and never had an issue.

1) Wondering why you need to pick up every unit on the map and filter after which unit is a hole. You can pick up units by type - you should try that:
  • Unit Group - Pick every unit in (Units of type HOLE) and do (Actions)
    • Loop - Actions
2) Other thing, why you pick every holes every 0.05 seconds? You even add holes which are already added in that group - You need a filter.

3) One more thing is that you also forgot to clear the leak of (at least) the "VenomHoleUnitGroup" with:
  • Custom script: call DestroyGroup(udg_VenomHoleUnitGroup)
4) The last thing I just noticed is this:
  • Set VenomHoleVenomLevel = ((Mana of VenomHoleVenoms) / 100.00)
You said you want to set it like "lvl * 100" but you do "lvl / 100" - some sort of mistake here. Also you don't refer in any kind to the level of the spell casted by the hero.

Greetings and Peace
Dr. Boom
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
@ Dr.Boom ->
  • 1) Thanks! This fixed everything.
  • 2) The trigger loops every 0.05 seconds because i want units to get damaged every 0.05 seconds.
  • 3) Leak cleared.
  • 4) That hole is a dummy unit and has locust. I use it's mana to "transfer" the level of the hero ability that creates the hole to another trigger (where i do the damage thing). Simply this unit has no mana regeneration and when i create it with the first trigger i set it's mana to be equal to the level of the ability for the hero. If the level is 1, the mana of the unit is 1. Forget that /100 and *100 thingy.

@Peacehagen -> yes, it's true but i removed the locust ability from the dummy hole unit and saw that the mana thing is all right.

@Cokemonkey11 -> yes, i did this. :D

Thanks to all of you! Problem solved!
 
Status
Not open for further replies.
Top