• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Drain mana

Status
Not open for further replies.
Level 3
Joined
Mar 1, 2015
Messages
53
How can I make this:
  • Unit Group - Pick every unit in (Units within 550.00 of Temp_Point) and do (Actions)
    • Loop - Actions
      • Unit - Create 1 Dummy_hero for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
      • Unit - Add Shadow Strike to (Last created unit)
      • Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
      • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 20.00)
      • Custom script: call RemoveLocation(udg_fbv_point)
to not drain mana of friendly units? (including self)
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
  • Unit Group - Pick every unit in (Units within 550.00 of Temp_Point) matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
Instead of "units in range", do "units in range matching condition"
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
uhm... sorry nedio95 but no.
Instead make the check inside the loop.
Make an action (If/Then/Else) and put that condition that nedio95 mentioned in it (with picked unit instead of matching unit).

This will make it easier to modify and more readable.

Also... is that RemoveLocation() supposed to be inside the loop?
 
Level 3
Joined
Mar 1, 2015
Messages
53
Not sure if It was supposed to look like this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Picked unit) belongs to an enemy of (Triggering player)) Equal to True
    • Then - Actions
      • Unit Group - Pick every unit in (Units within 512.00 of Temp_Point) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy_hero for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
          • Unit - Add Shadow Strike to (Last created unit)
          • Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 20.00)
          • Custom script: call RemoveLocation(udg_fbv_point)
    • Else - Actions
still targets ally
 
you really need to be specific here... add if picked unit is alive = true..in this case only those alive units will be picked excluding the dead ones..

and change the triggering player to (owner of triggering unit)

•you should set the fbv_point inside the loop before creating the dummy and change the position Temp_Point into fbv_point..
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,658
Not that... if you make something that you will show to other people and want other people to use it, then yes. But if you want to make a map yourself, you should actually make everything hardcoded because you will save yourself some memory.
Ofcourse this is not fun to change afterwards but that doesn't matter.
 
Status
Not open for further replies.
Top