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

[Spell] Points and Unit Groups

Status
Not open for further replies.
Level 4
Joined
Jul 15, 2013
Messages
33
So I have a trigger where it takes every unit within X of a point(position of casting unit) and adds them to a unit group. This is followed by creating a special effect at the position of each unit in the unit group. For the purpose of eliminating leaks. How would I assign a point(or type of variable to use and how to assign it) to each unit in the unit group and then at the end of the trigger delete all the positions.
 
Can you delete the locations inside the Pick every unit in Unit Group block or do you need them later?

  • Unit Group - Pick every unit in tempunitgroup and do (Actions)
    • Loop - Actions
      • Set temppoint = (Position of (Picked unit))
      • Special Effect - Create a special effect at temppoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Custom script: call RemoveLocation(udg_temppoint)
Otherwise, you would have to go with a point array and a counter:

  • Set tempinteger = 0
  • Unit Group - Pick every unit in tempunitgroup and do (Actions)
    • Loop - Actions
      • Set tempinteger = (tempinteger + 1)
      • Set pointArray[tempinteger] = (Position of (Picked unit))
      • Special Effect - Create a special effect at pointArray[tempinteger] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
  • For each (Integer tempinteger2) from 1 to tempinteger, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation( udg_pointArray[udg_tempinteger2])
 
Last edited:
Level 4
Joined
Jul 15, 2013
Messages
33
Can you delete the locations inside the Pick every unit in Unit Group block or do you need them later?

  • Unit Group - Pick every unit in tempunitgroup and do (Actions)
    • Loop - Actions
      • Set temppoint = (Position of (Picked unit))
      • Special Effect - Create a special effect at temppoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Custom script: call RemoveLocation(udg_temppoint)
Otherwise, you would have to go with a point array and a counter:

  • Set tempinteger = 0
  • Unit Group - Pick every unit in tempunitgroup and do (Actions)
    • Loop - Actions
      • Set tempinteger = (tempinteger + 1)
      • Set pointArray[tempinteger] = (Position of (Picked unit))
      • Special Effect - Create a special effect at pointArray[tempinteger] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
  • For each (Integer tempinteger2) from 1 to tempinteger, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation( udg_pointArray[udg_tempinteger2])
I just got back from work but thanks for the response:'

Just a more general question with unit group, is it pretty much saying - "Okay so for each unit do this, then move on to the next unit, and continue to do this until all of them are done", just off top of my head pretty sure I use the point once(its for vfx).
 
Status
Not open for further replies.
Top