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

[General] About Units with Locust

Status
Not open for further replies.
I had this problem days ago about my system. This system is a Boid Simulation system which I made in Warcraft 3. Most of the thing works, except that every Boid can't detect a nearby Boid. So I made tests with GroupEnums and tried using Debug Messages to see what causes Boids to ignore each other. I tried enumerating them with check the unit's unit type id if it matches Boid's id, which happened that the Messages don't print out. I tried removing that condition (so it's straightforward) and it seems that it still doesn't print out them message.


So the question is, do units with locust can't be enumerated with a group?
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
They can't. Tested myself.

If you group every unit in an area it fails. However if you add all units one by one to the group and then do a ForGroup() it works. Here is my mega-advanced test:

  • Actions
    • -------- Dont Work --------
    • Unit Group - Pick every unit in (Units in Region 001 <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
    • -------- Work --------
    • Unit Group - Add Peon 0024 <gen> to gg
    • Unit Group - Add Peon 0006 <gen> to gg
    • Unit Group - Pick every unit in gg and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Pick every unit in region will filter out units with locust.
Pick every unit owned by player will not filter any units. (I thought but am not 100% sure.)

Something else you could try is make the enumeration yourself.
I assume that all Boids are inside an array so you can check the distance between each Boid.
(Could be pretty heavy.)

Another thing that will work is de-locusting the Boids.
I use that in my missile system as well so I can use missile collision with other missiles.
(Exactly what you want.)
To do this, you must use a dummy unit and create that one instead.
When the dummy is created, add locust, morph it to the new unit with reversed morph abilities and add Ghost (visible) and remove collision through triggers.
That way, you have a completely de-locusted unit that will show up in enumerations, will not be controllable and will be targetable (as long as the model can be clicked).
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You can not use "Units in range" and "Units in region" to pick units with locust, however you can use "Units of player" and "units of type".
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
That doesnt make any sense.

Lets take a look what you said:
Pick every unit in region that has locust
Pick every unit in region and remove the ones who havent got locust
pick every unit in region which filters locust units and remove the ones who havent got locust

Do you understand?
That is how coding works... kind of.
 
Status
Not open for further replies.
Top