How to make a group of unit type?

Yamuraiha

Member
Reaction score
1
I wanna make a group of unit type. For example, I call the mother group : neutral group, in neutral group, there are group A, group B, and group C ... I want to pick a random group out of mother group. ~~ S.O who understand me help me please :(
 

Yamuraiha

Member
Reaction score
1
I wanna make a group of unit type. For example, I call the mother group : neutral group, in neutral group, there are group A, group B, and group C ... I want to pick a random group out of mother group and create them at a location ~~ S.O who understand me help me please :(
 

Marvic June B. Corpuz

You can change this now in User CP.
Reaction score
1

I don't really think you need to create the mother group to do that... Am not sure if I can help but you can simply create a number of units in a certain area by Unit Actions -> Create Units Facing Angle.. Its as simple as that.. You want to create a group of units of the same type? This action does this... You do not need to group them out... Unless, sorting the unit out is needed for a number of actions... If so... You just have to set the units you created as a group simply by picking them all and set them as a group. Then add the group to the mother group..
 

Yamuraiha

Member
Reaction score
1
Ah I foggot to say up there, there are more than a unit type in one group. For example group A includes 2 footmans and 3 archers. And I don't understand this "You just have to set the units you created as a group simply by picking them all and set them as a group. Then add the group to the mother group.." Could you explain more ?
 

Marvic June B. Corpuz

You can change this now in User CP.
Reaction score
1
Ah... you need to specific so that anyone can give you a good reply. This is the trigger I created so you can get my point.

Untitled Trigger 001
Events
Time - Elapsed game time is 30.00 seconds
Conditions
Actions
Unit - Create 2 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Unit Group - Pick every unit in (Last created unit group) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to Group 1
Unit - Create 3 Archer for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Unit Group - Pick every unit in (Last created unit group) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to Group 1
Unit Group - Add all units of (Group 1) to Mother Group
If you want to set the the group as A before the units in the group was created, I do not find any actions in the trigger editor that would actually fit it. As far as I experienced creating triggers in the editor, unit groups are set after they are created. Though if you explore more, you might find suitable events, conditions and actions for what you really want to happen.
 

O.A

Quantum physics rules
Reaction score
29
Hello Yamuraiha, if you have indeed just started with the editor i would like to post the following, as i have come to find myself, that what one Accname recently stated, about having loved for someone to teach him early on what a leak was, so as not to have to remake a lot of stuff later on. If you feel like this is unnecessary complication to your world editing, then feel free to ignore the stuff below. Leaks like this are unlikely to cause any trouble, but the information is good to have.

Trigger:
  • Actions
    • -------- Set up temporary points and groups to be able to remove them later --------
    • Set p_Temp = (Center of WhereYouWantThem <gen>)
    • Unit - Create 2 Footman for Player 1 (Red) at p_Temp facing Default building facing degrees
    • Set ug_Temp = (Last created unit group)
    • Unit Group - Add all units of ug_Temp to Aug_SubGroups[1]
    • Custom script: call DestroyGroup (udg_ug_Temp)
    • Unit - Create 3 Archer for Player 1 (Red) at p_Temp facing Default building facing degrees
    • Set ug_Temp = (Last created unit group)
    • Unit Group - Add all units of ug_Temp to Aug_SubGroups[1]
    • Custom script: call DestroyGroup (udg_ug_Temp)
    • Custom script: call RemoveLocation (udg_p_Temp)
    • -------- Use a Custom Script to destroy groups and remove points --------
    • -------- Aug_SubGroups is a unit group array, add as many groups you want then add them to the main group --------
    • For each (Integer A) from 1 to 3, do (Actions)
      • Loop - Actions
        • Unit Group - Add all units of Aug_SubGroups[(Integer A)] to ug_MainGroup
    • -------- Picking a random group from main --------
    • Unit Group - Pick every unit in Aug_SubGroups[(Random integer number between 1 and 3)] and do (Actions)
      • Loop - Actions
    • -------- Single out a unit-type from the group --------
    • Unit Group - Pick every unit in Aug_SubGroups[ForExample_ThisOne] and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • And - All (Conditions) are true
              • Conditions
                • ((Picked unit) is alive) Equal to True
                • (Unit-type of (Picked unit)) Equal to Footman
          • Then - Actions
            • -------- In most cases it's a good idea to check whether the picked unit is alive for obvious reasons --------
          • Else - Actions
    • -------- If you reset the subgroups clear them first --------
    • Unit Group - Remove all units from Aug_SubGroups[ForExample_ThisOne]


If i messed anything up or made something needlessly complicated, butt in anyone and correct me.

Ps. Also see; http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
 

Yamuraiha

Member
Reaction score
1
Hello Yamuraiha, if you have indeed just started with the editor i would like to post the following, as i have come to find myself, that what one Accname recently stated, about having loved for someone to teach him early on what a leak was, so as not to have to remake a lot of stuff later on. If you feel like this is unnecessary complication to your world editing, then feel free to ignore the stuff below. Leaks like this are unlikely to cause any trouble, but the information is good to have.

Trigger:
  • Actions
    • -------- Set up temporary points and groups to be able to remove them later --------
    • Set p_Temp = (Center of WhereYouWantThem <gen>)
    • Unit - Create 2 Footman for Player 1 (Red) at p_Temp facing Default building facing degrees
    • Set ug_Temp = (Last created unit group)
    • Unit Group - Add all units of ug_Temp to Aug_SubGroups[1]
    • Custom script: call DestroyGroup (udg_ug_Temp)
    • Unit - Create 3 Archer for Player 1 (Red) at p_Temp facing Default building facing degrees
    • Set ug_Temp = (Last created unit group)
    • Unit Group - Add all units of ug_Temp to Aug_SubGroups[1]
    • Custom script: call DestroyGroup (udg_ug_Temp)
    • Custom script: call RemoveLocation (udg_p_Temp)
    • -------- Use a Custom Script to destroy groups and remove points --------
    • -------- Aug_SubGroups is a unit group array, add as many groups you want then add them to the main group --------
    • For each (Integer A) from 1 to 3, do (Actions)
    • Loop - Actions
    • Unit Group - Add all units of Aug_SubGroups[(Integer A)] to ug_MainGroup
    • -------- Picking a random group from main --------
    • Unit Group - Pick every unit in Aug_SubGroups[(Random integer number between 1 and 3)] and do (Actions)
    • Loop - Actions
    • -------- Single out a unit-type from the group --------
    • Unit Group - Pick every unit in Aug_SubGroups[ForExample_ThisOne] and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • And - All (Conditions) are true
    • Conditions
    • ((Picked unit) is alive) Equal to True
    • (Unit-type of (Picked unit)) Equal to Footman
    • Then - Actions
    • -------- In most cases it's a good idea to check whether the picked unit is alive for obvious reasons --------
    • Else - Actions
    • -------- If you reset the subgroups clear them first --------
    • Unit Group - Remove all units from Aug_SubGroups[ForExample_ThisOne]


If i messed anything up or made something needlessly complicated, butt in anyone and correct me.

Ps. Also see; http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
@@ I really really really really tks a lot for your information. I have to remake all the trigger >.<. But it's better do it now than when the map is finished, so thank you again.:eek:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top