Disperse Move
-
@Jip said in Disperse Move:
Pretty cool idea - if the discovery from @TheWheelie is correct then I feel you are choosing random orders somehow. After inspecting the code I didn't get much wiser - it has comments but I'm not enough into this bit of the code base to understand in under a few minutes.
What do you think about assuming that the group of units have the same orders, choose the orders from the first unit and then see they align with the number of units that you have?
For example:
- If you have more orders than units, assign each unit a unique order leaving some out.
- If you have more units than orders, make sure each order is assigned and assign some double.
That would solve the situation Wheelie has, which shows unreliable behavior.
what happened to @TheWheelie was solved already in version 3
the reason it happened before is that units' orders were randomized normally like in original Spread Move, and I was simply removing every order per unit except first one given to it, but units could have been unevenly distributed between these orders (because it was a random function) resulting in more units getting the same first order than others, and sometimes (like in farms' example) some orders might have not been given to any unit at all as their first order, and once all orders after the first were removed, those orders that were not given to any units as their first order were deleted completely
the way it works now is that the unit uses its index (which number in selected group of units they are) to select which order goes to it first (from order queue), and thus every order gets at least 1 unit (as long as there are at least same number of units as orders), if there are more orders than units, the orders given past the unit number get deleted and units are distributed up to last order they could, if there are more units than orders, once last order in queue is given to a unit, the next unit in group starts over from first queued order and this repeats until all units are given first orders, evenly distributing all units between all orders
-
You're correct - I didn't read correctly . Apologies!
-
Issuing the Order sometimes works yet only with certain Move Orders Constellations and soemtimes doesnt
Opening the Log reveals a traceback Error and Error at Line 317 in the dispersemove.lua regarding "action2"
this somehow leads to the Unit each getting their own Commands but not splitting up akin to Shift+G also weirdly enough hammering the Key often enough will rarely result in splitting up without problems
-
@Northern-Newbie well idk exactly what you mean, but from what you said I managed to get disperse move to run properly even if some (but not all) units got to their first move order(s) before hotkey was pressed (before disperse move would just not work in this case), if thats what you meant, however distribution (at least to first order player queued or however first many orders units already "split" between having reached them or not) is somewhat worse as this is a bigger problem than it may seem
To not flood the thread I put explanation of this fix in imgur album.
Add spoilers to forums so we can spoiler pictures pls.the bigger problem is: units that already got to first order (or however many) and would have otherwise been sent there (not all units that got to some orders already would have been sent to those same ones necessarily, both because they may now be closer to a different order or because even distribution would not allow it) if they didnt already reach it, now distribute evenly between their remaining orders (aka orders player queued but excluding ones they already got to), the rest of units with full queue (no missing orders aka didnt reach any order yet before pressing hotkey) operate same as before, I thought about redistributing units with full queues (units that have none of orders lost) to offset these "lost units" but I think that would cause a bigger problem as they may cross paths with other units (rip pathfinding) or in general not go to closest orders they can, and the point of this mod is kind of in the speed in which units disperse, not as strongly evenness of that
one way to fix this may be to simply remove whole group of orders from those units that already reached orders they are supposed to get as their first (and only) orders, but for some reason doing that (setting unit order table to nil) just does nothing and they keep whole order queue instead, may try that once I figure out how to do it, if anyone knows halp pls
-
@Mach you can issue come to move under unit itself +/-1 unit to clear queue. Moving in exact same position will get canceled by engine, dunno if it clears command queue.
-
@techmind_ said in Disperse Move:
@Mach you can issue come to move under unit itself +/-1 unit to clear queue. Moving in exact same position will get canceled by engine, dunno if it clears command queue.
Ill try that but idk if issuing new move orders or moving existing ones to positions where player didnt manually place them before (which would be the case here) is considered "okay"
-
Last time i checked it was okay aslong as it doesnt happen automatically
also the Problem even arises when units havent reached the first order ever given of the Bunch off Orders one may give andf will result in this error
WARNING: Error running lua command: ...alliance\mods\disperse move\modules\dispersemove.lua(317): access to nonexistent global variable "action2" stack traceback: [C]: in function `error' ...alliance\gamedata\mohodata.scd\lua\system\config.lua(53): in function <...alliance\gamedata\mohodata.scd\lua\system\config.lua:52> ...alliance\mods\disperse move\modules\dispersemove.lua(317): in function `DisperseMove' [string "import('/mods/Disperse Move/modules/dispers..."](1): in main chunk
And also will result in Units moving to the xact same Locations i give but in order and not dispersing
-
I cannot reproduce what happens to you, are you using latest version of mod (v10)? To me there is no call for that variable at that line at all. What are you doing before giving these orders and pressing hotkey?
-
It seems i had to update to the newest Verison which apparently uploaded the same day
-
Yes I uploaded it to fix that very bug, sorry should have mentioned it