FirstOfGroup, GetUnitsInRangeOfLocMatching, etc

Sooda

Diversity enchants
Reaction score
318
> what does this matter?

I agree there isn' t very solid answer why it is so important but maybe elmstfreddie will answer why he wants to know it.
Maybe answer would be because FirstOfGroup returns random unit, but we could know what it will return if we would know how it picks them. Then you could use that knowledge for picking Archer before Footman and not needing to do comparison is unit type Archer or something that.

EDIT: ROFL !!!! Locust units aren' t picked by GroupEnum functions, good point N-a-z-g-u-l and Exide >.< ! Rofl ! I gonna do new tests without locust but with 0 collision size instead :D .

EDIT2: Ok, now when I have fixed the *sigh* small bug of my test map I can tell you it is reversed :D ! It always picks first unit what was created with CreateUnit native and lastly from group is retrieved tenth Footman. I did quick check but it was opposite to my previous ones and all other units was picked in order of creation. Firstly very first unit created on map, then second, then third, etc.
Sorry for first *sigh* small bit of miss leading info.
By the way with 0 collision size they still get clustered around map center and that didn' t affect result. So I guess unit position on map isn' t in any way connected to 'picking unit' when getting all of them. It comes into play when you pick units in range or region I assume.
 

Exide

I am amazingly focused right now!
Reaction score
448
>Normally... we don' t deal with normal things here...
Oh-so-True! :)

>No, they even will be not considered as 'matching' to start that comparison.
Hmm, I think I saw somewhere, someone mention there was a way to pick Locust units.. Maybe I was wrong about the (Matching Unit) part, or maybe I simply remember wrong? :p
 

Sooda

Diversity enchants
Reaction score
318
> someone mention there was a way to pick Locust units..

Most known way is to order or manipulate unit with Locust by using instead unit it' s unit variable what points to that unit aka holds that unit.

My test map starts to get complete, I add few chat commands and few functions and you all can mess with it. It even will feature cool visual effects what will point to unit with Shop arrow who was picked first.

My so far conclusion is that it always picks units before who was created with native CreateUnit. Even in GroupEnumUnitsInRange picked first unit what was created before.

LAST EDIT:

I have finished my ultimate FirstOfGroup Test Map. You can choose what you want to test and how you want to. It is so advanced that you may be stunned. I suggest to type first "-help" into chat to see all commands.
My conclusion on some experiments says it just picks first unit what was created first with native CreateUnit (For GUI just create unit). In every GroupEnum pick it picked first and only first very first unit who was created with that native. If you can prove otherwise be my guest. I am so tired of writing and testing and adding help explanations that I can' t do any tests myself. So I ask you to download it and do some tests. If you find something interesting post it here. Map is attached under my post (See attached files.).

EDIT: Map removed.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Picking units in "units of type" and "units owned by player of type" will get Locusts too.

Though, there's no point in them having Locust here... or no collision.
Order them to some random point nearby.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
As for pre-placed units, I have concluded, that the picking pattern is following:

first placed unit for Player(0)
second placed unit for Player(0)
...
last placed unit for Player(0)

first placed unit for Player(1)
...
last placed unit for Player(1)

first placed unit for Player(2)
...
etc.

Why? I put my money on that, the pre-placed units are created on map initialization for each player in a row. (war3map.j)
JASS:

function CreateUnitsForPlayer0 takes nothing returns nothing
    local player p = Player(0)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit(p, &#039;hfoo&#039;, -6717.9, 6708.3, 270.000)
    ...
endfunction


Another one for Player(1), 2, etc.


I guess it's the same with dynamically created units:

The unit created first for player(0) will be picked first, then the second etc. If all the units for Player(0) are picked, it continues with Player(1), etc.
 

Sooda

Diversity enchants
Reaction score
318
You are right Andrew, and only counts CreateUnit native call, it will add unit created to the list. Then it always picks first unit on list first when unit meets conditions (Dosn' t care will it be 'unit in range' or 'unit in rect'). If I get fixed some minor display bugs and adding some more commands I will upload it again. But so far FirstOfGroup just picks unit' s before who was created on map and thats all, no special patterns to look for.

@ Ace

Did it with default Footmen and results were same.
 

Sooda

Diversity enchants
Reaction score
318
> no special patterns to look for.

Made conclusions too soon >.<

It picks Heroes before units. Soon coming more.

EDIT:

The list gets updated with new units and there is some kind of a priority what will be picked first. But I don' t know it.

I spent much time updating and fixing small bugs in map. You know can create to any player (Neutral Players included) any unit. You can set each unit health and mana if you want. Shorts out from first to last 'FirstOfGroup' return value and how many times that unit previously was returned as 'FirstOfGroup' value. Displays currently available test info about lastly or currently selected unit. You can use help menu to navigate and seek out commands what interests you. All 'GroupEnum' natives listed. Freedom to easily set test values. Displays test progress and test can be canceled at any time. Shorts out and includes in tests all pre-placed units or in real time created units.
Latest test map can be found under my post (See attached files).
 

Attachments

  • FirstOfGroupTestMap12.w3x
    31.7 KB · Views: 128
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top