Group Order:

Ben

New Member
Reaction score
4
Whenever a trigger is occuring in my map it seems to only work for 12 units. Will the following action:

JASS:
call GroupPointOrderLoc( udg_Unit_Group[udg_Group1, udg_Order, GetOrderPointLoc() )


only order 12 units to follow the point order. Is it this action which only works for 12 units or do I have to look elsewhere for the problem?

Thanks,

Skli
 

saw792

Is known to say things. That is all.
Reaction score
280
Yes, a unit group loop is necessary because of the 12 unit limit (which has something to do with the max units a player can select/order at a time).
 

Ben

New Member
Reaction score
4
Is it possible to loop the command without using unit group-pick every unit, but with it picking 12 different units each time?

I really need the units to move in "formation" rather than individually,

Thanks,

Skli
 

Ben

New Member
Reaction score
4
Is it possible, using Jass, to do something like:

Unit Group-pick every unit Group of 12 units in Unit_Group and do Actions.

I'm not very good with this sort of triggering :(,

Thanks,

Skli
 

saw792

Is known to say things. That is all.
Reaction score
280
Create two group variables. Use a 'Pick Every Unit...' and add the picked unit to the first unit group. Create an integer loop from 1 to (Integer((Units in group 1 / 12) + 1).Then use another integer loop from 1 to 12 and pick a random unit from the first group and add it to the second group, then remove it from the first group. Then order your second group to do what you want, and clear the second group afterwards.

So yes, it's fairly complicated, and will run one to many times if the number of units is a multiple of 12 (won't really affect anything negatively, and can be fixed with an If condition), but that's what you asked for.

EDIT: Yes, this would be much easier in JASS, but only through simpler loop conditions which doesn't really give you an advantage that is worth pursuing in this case.
 

Ben

New Member
Reaction score
4
Thanks, thats what I'm going to do then. If the number of units is not a multiple of 12, and I try and select 12 units from a unit group in which there is less than 12 units will it select all remaining units it will it not work?

Skli
 

saw792

Is known to say things. That is all.
Reaction score
280
It will add a null unit to the unit group, which does not cause problems.
 

Ben

New Member
Reaction score
4
Trigger Help

Anyone know why the following trigger is not working?

JASS:
Events
    Unit - A unit Is issued an order targeting a point
Conditions

Actions
    Set Identifier = (Custom value of (Ordered unit))
    Set Order = (String((Issued order)))
    Trigger - Turn off (This trigger)
    For each (Integer A) from 1 to 10, do (Actions)
        Loop - Actions
            Set Temp_Group[(Integer A)] = (Random 12 units from (Units in (Playable map area) matching ((((Matching unit) is in Battalion[Identifier]) Equal to True) and (((Matching unit) is in Temp_Group[((Integer A) - 1)]) Equal to False))))
            Unit Group - Add all units of Temp_Group[((Integer A) - 1)] to Temp_Group[(Integer A)]
            Custom script:   call GroupPointOrderLoc( udg_Temp_Group[GetForLoopIndexA()], udg_Order, GetOrderPointLoc() )
            Custom script:   call DestroyGroup (udg_Temp_Group[GetForLoopIndexA()-1])
    Trigger - Turn on (This trigger)


It should make all units in the Unit Group Battallion[Identifier] move to a point however it only moves 12;

Thanks,

Skli
 

averes

New Member
Reaction score
17
Any reason its Integer A from 1 to 10? Are there 10 temp groups? Are the other groups even populated with units? As it looks like right it should only move 12 units thats are in each Temp_Group[Integer A] that are also in battallion.

If you want it to move every unit in battalion just do a pick every unit in battallion and move them.

If you want them to be moved in groups of 12, one after another, then do the same as above, but pick 12 random units, and then delete each picked unit from battallion and do it again. Though unless you have a delay somewhere in the loop its just going to look like there all moving at the same time.
 

Ben

New Member
Reaction score
4
Thanks, I've attempted to do what you suggested, but it isn't working :(. Any ideas. I've probably been stupid.


Code:
     Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Custom value of (Ordered unit)) Greater than 0
    Actions
        Set Identifier = (Custom value of (Ordered unit))
        Set Order = (String((Issued order)))
        Trigger - Turn off (This trigger)
        For each (Integer A) from 1 to (((Number of units in Battalion[Identifier]) / 12) + 1), do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Random 12 units from Battalion[Identifier]) and do (Actions)
                    Loop - Actions
                        Unit Group - Add (Picked unit) to Temp_Group
                        Unit Group - Remove (Picked unit) from Battalion[Identifier]
                Custom script:   call GroupPointOrderLoc( udg_Temp_Group, udg_Order, GetOrderPointLoc() )
                Unit Group - Add all units of Temp_Group to Temp_Group2
                Unit Group - Remove all units from Temp_Group
        Unit Group - Add all units of Temp_Group2 to Battalion[Identifier]
        Custom script:   call DestroyGroup (udg_Temp_Group)
        Custom script:   call DestroyGroup (udg_Temp_Group2)
        Trigger - Turn on (This trigger)
        Set Order = <Empty String>
        Set Identifier= 0

Thanks,

Skli
 

averes

New Member
Reaction score
17
Code:
     Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Custom value of (Ordered unit)) Greater than 0
    Actions
    Set TempInt = 3
    Unit Group - Add all units of Battallion to TempGroup
    For each (Integer A) from 1 to TempInt, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Number of units in TempGroup) Greater than or equal to 12
                Then - Actions
                    Set TempInt = (TempInt+ 1)
                    Unit Group - Pick every unit in (Random 12 units from TempGroup) and do (Actions)
                        Loop - Actions
                            Unit - Order (Picked unit) to Move To TempPoint
                            Unit Group - Remove (Picked unit) from TempGroup
                Else - Actions
                    Set TempInt = ((Integer A) + 1)

Not tested but that would be how I would go about it. Still not sure if thats exactly how you want to do it.
 

Ben

New Member
Reaction score
4
Tested it and played around with it - your trigger does work sort of. It works once. Any time I try repeating it, it doesn't work however (I'm guessing a problem with the loop - and I should be able to fix this). What I'd really like to try and do, however is to get them moving in groups of 12 to staggered locations - sort of like an army moving - am trying to modify your trigger to get the units to do this but am having no success :( getting them to even move once.

Any suggestions?

Thanks,

Skli
 

averes

New Member
Reaction score
17
My trigger actually ends up being an infinite loop, which is probably why it doesn't work after the first one. As for a 'staggered army' thing if you know where you want each group of 12 to go, and you know how many groups of 12 there will be, then just make a location array with each of the points. In the loop instead of using TempInt use the value of the number of groups of 12 you have. Then do the loop without the TempInt thing and replace TempPoint with TempPoint[Integer A] where TempPoint[] is an array of all the points you want the army to move to.
 
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

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top