• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit group without remove unit and without callback function

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
i want check units in unit group 1by1 without make a callback function like what forloop do because i want use 1 number from main function but also i dont want remove units because i will need later :/

so i give a example:

1st i create few hero i will tell later why i use them

when start the map i create a global unit group, where i put random x unit, during game play if a unit die then remove from group when spawn a new unit from this unit type then add to unit group.
(Notice: acctually i use this group for more unit type not only 1, so i cant use GroupEnumUnitsOfType)

during game every 3 sec i check every unit in unit group and lets say if that heroes what i created in begining attack 1 unit from group (each hero can attack only 1 unit from group in same time, so every hero have different target, also have restriction x hero type attack only v,y,z unit type from group) :D

ok i tell different way, unit group contain units (2 category: mine & herb), x hero type attack only mine units, another hero type attack only herb unit type

if possible i want use something like groupenumrange where dont need external function just a loop, also dont want many loop(so that also not solution make a loop for each unit type)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
i want check units in unit group 1by1 without make a callback function like what forloop do because i want use 1 number from main function but also i dont want remove units because i will need later :/

so i give a example:

1st i create few hero i will tell later why i use them

when start the map i create a global unit group, where i put random x unit, during game play if a unit die then remove from group when spawn a new unit from this unit type then add to unit group.
(Notice: acctually i use this group for more unit type not only 1, so i cant use GroupEnumUnitsOfType)

during game every 3 sec i check every unit in unit group and lets say if that heroes what i created in begining attack 1 unit from group (each hero can attack only 1 unit from group in same time, so every hero have different target, also have restriction x hero type attack only v,y,z unit type from group) :D

ok i tell different way, unit group contain units (2 category: mine & herb), x hero type attack only mine units, another hero type attack only herb unit type

if possible i want use something like groupenumrange where dont need external function just a loop, also dont want many loop(so that also not solution make a loop for each unit type)

You could store them in unit arrays and loop through the array as I've explained some time ago ^.^

Remember that system I gave you a long time ago?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
y, i use that, just i thought maybe have a trick coz unit group save a bit time for me :D

maybe i can show today what i tryed make :p

It's faster then using the unit group, but it'll take more time to implement it.
I might recreate that system to make it easier to implement.

Nice, PM me I would love to see it :)
 
Status
Not open for further replies.
Top