• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Unselectable Randomised Villager Spawns

Status
Not open for further replies.
Level 12
Joined
May 9, 2009
Messages
735
Hello, I am working a system that attempts to make randomised 'villager' units spawn from food buildings periodically. These 'villager' should be unselectable or uncontrollable but still belong to the players so the enemy can kill them and there should only be allowed a limited amount of 'villagers' out at one time.

This is the trigger than I came up with so far:

  • Untitled Trigger 002
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Equal to Player 1 (Red)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AAAVillagerMax1 Less than 15
                • Then - Actions
                  • Unit Group - Pick every unit in (Units of type Farmhouse) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Player 1 (Red)
                        • Then - Actions
                          • Set AAAPositionVillagerFarm = (Position of (Picked unit))
                          • Set AAARollVillagerFarm = (Random integer number between 1 and 7)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AAARollVillagerFarm Equal to 1
                            • Then - Actions
                              • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                              • Unit - Add Villager M.Crossbowman to (Last created unit)
                              • Unit - Add Wander (Neutral) to (Last created unit)
                              • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AAARollVillagerFarm Equal to 2
                                • Then - Actions
                                  • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                  • Unit - Add Villager M.Peasant to (Last created unit)
                                  • Unit - Add Wander (Neutral) to (Last created unit)
                                  • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AAARollVillagerFarm Equal to 3
                                    • Then - Actions
                                      • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                      • Unit - Add Villager M.Peasant to (Last created unit)
                                      • Unit - Add Wander (Neutral) to (Last created unit)
                                      • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AAARollVillagerFarm Equal to 4
                                        • Then - Actions
                                          • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                          • Unit - Add Villager M.Servant of Man to (Last created unit)
                                          • Unit - Add Wander (Neutral) to (Last created unit)
                                          • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AAARollVillagerFarm Equal to 5
                                            • Then - Actions
                                              • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                              • Unit - Add Villager M.Servant of Man to (Last created unit)
                                              • Unit - Add Wander (Neutral) to (Last created unit)
                                              • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AAARollVillagerFarm Equal to 6
                                                • Then - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Swordsman to (Last created unit)
                                                  • Unit - Add Wander (Neutral) to (Last created unit)
                                                  • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
                                                • Else - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Thug to (Last created unit)
                                                  • Unit - Add Wander (Neutral) to (Last created unit)
                                                  • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
                        • Else - Actions
                • Else - Actions
            • Else - Actions
I was thinking of changing the VillagerMax intager to a count of numbers in a group so that when the villagers died the number would go down but I have a problem with this trigger simply not working. Nothing happens. Can anyone help me out?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I guess you want it to work only for one player ?

1st - Never, ever, ever, forever ever do this:
  • Unit Group - Pick every unit in (Units of type Unit-Type) and do (Actions)
2nd - Why do this?
  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
Why not just give the ability to the unit ?

3rd - You are not lazy enough.

  • Map Initialization
    • Events
      • Map Initialization
    • Actions
      • Set Villager_Ability[0] = Ability1
      • Set Villager_Ability[1] = Ability2
      • Set Villager_Ability[2] = Ability3
      • Set Villager_Ability[3] = Ability4
      • Set Villager_Ability[4] = Ability5
      • Set Villager_Ability[5] = Ability6
      • Set Villager_Ability[6] = Ability7
To avoid the "Pick units of type" you create another variable of unit-group type which will keep track of the farms. You should have another trigger which registers farms and removes them when they are destroyed, I do not actually know if they are generic or you build them or if they can even be destroyed, so I will not suggest how to do it for now.
  • Untitled Trigger 002
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AAAVillagerMax1 Less than 15
        • Then - Actions
          • Unit Group - UnitGroup_Farmhouses and do (Actions)
            • Loop - Actions
              • Set AAAPositionVillagerFarm = (Position of (Picked unit))
              • Set AAARollVillagerFarm = (Random integer number between 0 and 6)
              • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm facing Default building facing degrees
              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
              • Unit - Add Villager_Ability[AAARollVillagerFarm] to (Last created unit)
              • Unit - Add Wander (Neutral) to (Last created unit)
              • Set AAAVillagerMax1 = (AAAVillagerMax1 + 1)
              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm)

Edit// All this said, locust makes unit invulnerable, so your "the enemy can kill them" will not work with this bility

You will need to keep track of villagers with a unit-group (UnitGroup_Villagers)another trigger, something like:
Event
Player - Player 1 (Red) Selects a unit
Contidion
Triggering unit is in UnitGroup_Villagers
Actions
Remove (Triggering unit) from selection for Player 1 (Red)
 
Last edited:
Level 12
Joined
May 9, 2009
Messages
735
Yeah sorry about the long trigger I was testing and didn't get it polished. I will try to use a variable unit group of the farmhouses instead of doing it directly and sees if it fixes.

The trigger is mostly long because of the variations of 'villager units' that should spawn. The trigger is supposed to work for all players, the entire thing will just be copy pasted to the 'else' part of the 'picked player is red' to account for every player effectively expanding the trigger to very large proportions.

I am using the advice from this thread and it appears to work flawlessly: the unit is both killable and unselectable and still collides with other objects; using chaos together with locust creates this 'bug'.

Edit: in reply to your edit >.< I thought of doing that as well but it is not perfect as the unit is selected for 1 second and you can effectively give orders this way.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Well... you are not making the "Chaos ability" part in your trigger...

You know Chaos ability
Take it and Make it change the unit you want to itself (yes a unit to a unit same unit)
Add locust by a trigger than add that chaos abilty (with trigger not object editor)

The "Pick units of Type" should not bug it but it leaks and this leak can not be fixed.
 
Level 12
Joined
May 9, 2009
Messages
735
I am sorry I didn't make it very clear to you but the adding of the abilities 'M.Villager', 'M.Servant of man' etc. are variations of the chaos ability that a different alternative unit which should make the dummy unit transform into it >.<

Edit: Okay I think I got the problem. The units were spawning but they were spawning right inside the farm so I could not see them, they were also unselectable. Also the wander ability did't apply properly so they didn't just walk out.

Edit again: Okay I think I got it working, I fixed the problem by giving the units the wander ability in the unit editor so that they wander out of the insides of the farmhouse eventually. Here is the final working trigger:
  • Villager System
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Equal to Player 1 (Red)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in AAAGroupVillager1) Less than 15
                • Then - Actions
                  • Set AAAGroupAllFarms1 = (Random 1 units from (Units owned by Player 1 (Red) of type Farmhouse))
                  • Unit Group - Pick every unit in AAAGroupAllFarms1 and do (Actions)
                    • Loop - Actions
                      • Set AAAPositionVillagerFarm1 = (Position of (Picked unit))
                      • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AAARollVillagerFarm Equal to 1
                        • Then - Actions
                          • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm1 facing Default building facing degrees
                          • Unit Group - Add (Last created unit) to AAAGroupVillager1
                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                          • Unit - Add Villager M.Crossbowman to (Last created unit)
                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm1)
                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms1)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AAARollVillagerFarm Equal to 2
                            • Then - Actions
                              • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm1 facing Default building facing degrees
                              • Unit Group - Add (Last created unit) to AAAGroupVillager1
                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                              • Unit - Add Villager M.Peasant to (Last created unit)
                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm1)
                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms1)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AAARollVillagerFarm Equal to 3
                                • Then - Actions
                                  • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm1 facing Default building facing degrees
                                  • Unit Group - Add (Last created unit) to AAAGroupVillager1
                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                  • Unit - Add Villager M.Peasant to (Last created unit)
                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm1)
                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms1)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AAARollVillagerFarm Equal to 4
                                    • Then - Actions
                                      • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm1 facing Default building facing degrees
                                      • Unit Group - Add (Last created unit) to AAAGroupVillager1
                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                      • Unit - Add Villager M.Servant of Man to (Last created unit)
                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm1)
                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms1)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AAARollVillagerFarm Equal to 5
                                        • Then - Actions
                                          • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm1 facing Default building facing degrees
                                          • Unit Group - Add (Last created unit) to AAAGroupVillager1
                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                          • Unit - Add Villager M.Thug to (Last created unit)
                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm1)
                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms1)
                                        • Else - Actions
                                          • Unit - Create 1 Dummy Villager System for Player 1 (Red) at AAAPositionVillagerFarm1 facing Default building facing degrees
                                          • Unit Group - Add (Last created unit) to AAAGroupVillager1
                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                          • Unit - Add Villager M.Engineer to (Last created unit)
                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm1)
                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms1)
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked player) Equal to Player 2 (Blue)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in AAAGroupVillager2) Less than 15
                    • Then - Actions
                      • Set AAAGroupAllFarms2 = (Random 1 units from (Units owned by Player 2 (Blue) of type Farmhouse))
                      • Unit Group - Pick every unit in AAAGroupAllFarms2 and do (Actions)
                        • Loop - Actions
                          • Set AAAPositionVillagerFarm2 = (Position of (Picked unit))
                          • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AAARollVillagerFarm Equal to 1
                            • Then - Actions
                              • Unit - Create 1 Dummy Villager System for Player 2 (Blue) at AAAPositionVillagerFarm2 facing Default building facing degrees
                              • Unit Group - Add (Last created unit) to AAAGroupVillager2
                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                              • Unit - Add Villager M.Crossbowman to (Last created unit)
                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm2)
                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms2)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AAARollVillagerFarm Equal to 2
                                • Then - Actions
                                  • Unit - Create 1 Dummy Villager System for Player 2 (Blue) at AAAPositionVillagerFarm2 facing Default building facing degrees
                                  • Unit Group - Add (Last created unit) to AAAGroupVillager2
                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                  • Unit - Add Villager M.Peasant to (Last created unit)
                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm2)
                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms2)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AAARollVillagerFarm Equal to 3
                                    • Then - Actions
                                      • Unit - Create 1 Dummy Villager System for Player 2 (Blue) at AAAPositionVillagerFarm2 facing Default building facing degrees
                                      • Unit Group - Add (Last created unit) to AAAGroupVillager2
                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                      • Unit - Add Villager M.Peasant to (Last created unit)
                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm2)
                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms2)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AAARollVillagerFarm Equal to 4
                                        • Then - Actions
                                          • Unit - Create 1 Dummy Villager System for Player 2 (Blue) at AAAPositionVillagerFarm1 facing Default building facing degrees
                                          • Unit Group - Add (Last created unit) to AAAGroupVillager2
                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                          • Unit - Add Villager M.Servant of Man to (Last created unit)
                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm2)
                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms2)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AAARollVillagerFarm Equal to 5
                                            • Then - Actions
                                              • Unit - Create 1 Dummy Villager System for Player 2 (Blue) at AAAPositionVillagerFarm1 facing Default building facing degrees
                                              • Unit Group - Add (Last created unit) to AAAGroupVillager2
                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                              • Unit - Add Villager M.Thug to (Last created unit)
                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm2)
                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms2)
                                            • Else - Actions
                                              • Unit - Create 1 Dummy Villager System for Player 2 (Blue) at AAAPositionVillagerFarm1 facing Default building facing degrees
                                              • Unit Group - Add (Last created unit) to AAAGroupVillager2
                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                              • Unit - Add Villager M.Engineer to (Last created unit)
                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm2)
                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms2)
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked player) Equal to Player 3 (Teal)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in AAAGroupVillager3) Less than 15
                        • Then - Actions
                          • Set AAAGroupAllFarms3 = (Random 1 units from (Units owned by Player 3 (Teal) of type Farmhouse))
                          • Unit Group - Pick every unit in AAAGroupAllFarms3 and do (Actions)
                            • Loop - Actions
                              • Set AAAPositionVillagerFarm3 = (Position of (Picked unit))
                              • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AAARollVillagerFarm Equal to 1
                                • Then - Actions
                                  • Unit - Create 1 Dummy Villager System for Player 3 (Teal) at AAAPositionVillagerFarm3 facing Default building facing degrees
                                  • Unit Group - Add (Last created unit) to AAAGroupVillager3
                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                  • Unit - Add Villager M.Crossbowman to (Last created unit)
                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm3)
                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms3)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AAARollVillagerFarm Equal to 2
                                    • Then - Actions
                                      • Unit - Create 1 Dummy Villager System for Player 3 (Teal) at AAAPositionVillagerFarm3 facing Default building facing degrees
                                      • Unit Group - Add (Last created unit) to AAAGroupVillager3
                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                      • Unit - Add Villager M.Peasant to (Last created unit)
                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm3)
                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms3)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AAARollVillagerFarm Equal to 3
                                        • Then - Actions
                                          • Unit - Create 1 Dummy Villager System for Player 3 (Teal) at AAAPositionVillagerFarm3 facing Default building facing degrees
                                          • Unit Group - Add (Last created unit) to AAAGroupVillager3
                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                          • Unit - Add Villager M.Peasant to (Last created unit)
                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm3)
                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms3)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AAARollVillagerFarm Equal to 4
                                            • Then - Actions
                                              • Unit - Create 1 Dummy Villager System for Player 3 (Teal) at AAAPositionVillagerFarm3 facing Default building facing degrees
                                              • Unit Group - Add (Last created unit) to AAAGroupVillager3
                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                              • Unit - Add Villager M.Servant of Man to (Last created unit)
                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm3)
                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms3)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AAARollVillagerFarm Equal to 5
                                                • Then - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 3 (Teal) at AAAPositionVillagerFarm3 facing Default building facing degrees
                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager3
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Thug to (Last created unit)
                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm3)
                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms3)
                                                • Else - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 3 (Teal) at AAAPositionVillagerFarm3 facing Default building facing degrees
                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager3
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Engineer to (Last created unit)
                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm3)
                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms3)
                        • Else - Actions
                          • Do nothing
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Picked player) Equal to Player 4 (Purple)
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in AAAGroupVillager4) Less than 15
                            • Then - Actions
                              • Set AAAGroupAllFarms4 = (Random 1 units from (Units owned by Player 4 (Purple) of type Farmhouse))
                              • Unit Group - Pick every unit in AAAGroupAllFarms4 and do (Actions)
                                • Loop - Actions
                                  • Set AAAPositionVillagerFarm4 = (Position of (Picked unit))
                                  • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AAARollVillagerFarm Equal to 1
                                    • Then - Actions
                                      • Unit - Create 1 Dummy Villager System for Player 4 (Purple) at AAAPositionVillagerFarm4 facing Default building facing degrees
                                      • Unit Group - Add (Last created unit) to AAAGroupVillager4
                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                      • Unit - Add Villager M.Crossbowman to (Last created unit)
                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm4)
                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms4)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AAARollVillagerFarm Equal to 2
                                        • Then - Actions
                                          • Unit - Create 1 Dummy Villager System for Player 4 (Purple) at AAAPositionVillagerFarm4 facing Default building facing degrees
                                          • Unit Group - Add (Last created unit) to AAAGroupVillager4
                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                          • Unit - Add Villager M.Peasant to (Last created unit)
                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm4)
                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms4)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AAARollVillagerFarm Equal to 3
                                            • Then - Actions
                                              • Unit - Create 1 Dummy Villager System for Player 4 (Purple) at AAAPositionVillagerFarm4 facing Default building facing degrees
                                              • Unit Group - Add (Last created unit) to AAAGroupVillager4
                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                              • Unit - Add Villager M.Peasant to (Last created unit)
                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm4)
                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms4)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AAARollVillagerFarm Equal to 4
                                                • Then - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 4 (Purple) at AAAPositionVillagerFarm4 facing Default building facing degrees
                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager4
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Servant of Man to (Last created unit)
                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm4)
                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms4)
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • AAARollVillagerFarm Equal to 5
                                                    • Then - Actions
                                                      • Unit - Create 1 Dummy Villager System for Player 4 (Purple) at AAAPositionVillagerFarm4 facing Default building facing degrees
                                                      • Unit Group - Add (Last created unit) to AAAGroupVillager4
                                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                      • Unit - Add Villager M.Thug to (Last created unit)
                                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm4)
                                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms4)
                                                    • Else - Actions
                                                      • Unit - Create 1 Dummy Villager System for Player 4 (Purple) at AAAPositionVillagerFarm4 facing Default building facing degrees
                                                      • Unit Group - Add (Last created unit) to AAAGroupVillager4
                                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                      • Unit - Add Villager M.Engineer to (Last created unit)
                                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm4)
                                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms4)
                            • Else - Actions
                              • Do nothing
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked player) Equal to Player 5 (Yellow)
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Number of units in AAAGroupVillager5) Less than 15
                                • Then - Actions
                                  • Set AAAGroupAllFarms5 = (Random 1 units from (Units owned by Player 5 (Yellow) of type Farmhouse))
                                  • Unit Group - Pick every unit in AAAGroupAllFarms5 and do (Actions)
                                    • Loop - Actions
                                      • Set AAAPositionVillagerFarm5 = (Position of (Picked unit))
                                      • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AAARollVillagerFarm Equal to 1
                                        • Then - Actions
                                          • Unit - Create 1 Dummy Villager System for Player 5 (Yellow) at AAAPositionVillagerFarm5 facing Default building facing degrees
                                          • Unit Group - Add (Last created unit) to AAAGroupVillager5
                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                          • Unit - Add Villager M.Crossbowman to (Last created unit)
                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm5)
                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms5)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AAARollVillagerFarm Equal to 2
                                            • Then - Actions
                                              • Unit - Create 1 Dummy Villager System for Player 5 (Yellow) at AAAPositionVillagerFarm5 facing Default building facing degrees
                                              • Unit Group - Add (Last created unit) to AAAGroupVillager5
                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                              • Unit - Add Villager M.Peasant to (Last created unit)
                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm5)
                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms5)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AAARollVillagerFarm Equal to 3
                                                • Then - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 5 (Yellow) at AAAPositionVillagerFarm5 facing Default building facing degrees
                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager5
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Peasant to (Last created unit)
                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm5)
                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms5)
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • AAARollVillagerFarm Equal to 4
                                                    • Then - Actions
                                                      • Unit - Create 1 Dummy Villager System for Player 5 (Yellow) at AAAPositionVillagerFarm5 facing Default building facing degrees
                                                      • Unit Group - Add (Last created unit) to AAAGroupVillager5
                                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                      • Unit - Add Villager M.Servant of Man to (Last created unit)
                                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm5)
                                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms5)
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • AAARollVillagerFarm Equal to 5
                                                        • Then - Actions
                                                          • Unit - Create 1 Dummy Villager System for Player 5 (Yellow) at AAAPositionVillagerFarm5 facing Default building facing degrees
                                                          • Unit Group - Add (Last created unit) to AAAGroupVillager5
                                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                          • Unit - Add Villager M.Thug to (Last created unit)
                                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm5)
                                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms5)
                                                        • Else - Actions
                                                          • Unit - Create 1 Dummy Villager System for Player 5 (Yellow) at AAAPositionVillagerFarm5 facing Default building facing degrees
                                                          • Unit Group - Add (Last created unit) to AAAGroupVillager5
                                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                          • Unit - Add Villager M.Engineer to (Last created unit)
                                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm5)
                                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms5)
                                • Else - Actions
                                  • Do nothing
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked player) Equal to Player 6 (Orange)
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Number of units in AAAGroupVillager6) Less than 15
                                    • Then - Actions
                                      • Set AAAGroupAllFarms6 = (Random 1 units from (Units owned by Player 6 (Orange) of type Farmhouse))
                                      • Unit Group - Pick every unit in AAAGroupAllFarms6 and do (Actions)
                                        • Loop - Actions
                                          • Set AAAPositionVillagerFarm6 = (Position of (Picked unit))
                                          • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AAARollVillagerFarm Equal to 1
                                            • Then - Actions
                                              • Unit - Create 1 Dummy Villager System for Player 6 (Orange) at AAAPositionVillagerFarm6 facing Default building facing degrees
                                              • Unit Group - Add (Last created unit) to AAAGroupVillager6
                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                              • Unit - Add Villager M.Crossbowman to (Last created unit)
                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm6)
                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms6)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AAARollVillagerFarm Equal to 2
                                                • Then - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 6 (Orange) at AAAPositionVillagerFarm6 facing Default building facing degrees
                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager6
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Peasant to (Last created unit)
                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm6)
                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms6)
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • AAARollVillagerFarm Equal to 3
                                                    • Then - Actions
                                                      • Unit - Create 1 Dummy Villager System for Player 6 (Orange) at AAAPositionVillagerFarm6 facing Default building facing degrees
                                                      • Unit Group - Add (Last created unit) to AAAGroupVillager6
                                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                      • Unit - Add Villager M.Peasant to (Last created unit)
                                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm6)
                                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms6)
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • AAARollVillagerFarm Equal to 4
                                                        • Then - Actions
                                                          • Unit - Create 1 Dummy Villager System for Player 6 (Orange) at AAAPositionVillagerFarm6 facing Default building facing degrees
                                                          • Unit Group - Add (Last created unit) to AAAGroupVillager6
                                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                          • Unit - Add Villager M.Servant of Man to (Last created unit)
                                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm6)
                                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms6)
                                                        • Else - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • AAARollVillagerFarm Equal to 5
                                                            • Then - Actions
                                                              • Unit - Create 1 Dummy Villager System for Player 6 (Orange) at AAAPositionVillagerFarm6 facing Default building facing degrees
                                                              • Unit Group - Add (Last created unit) to AAAGroupVillager6
                                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                              • Unit - Add Villager M.Thug to (Last created unit)
                                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm6)
                                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms6)
                                                            • Else - Actions
                                                              • Unit - Create 1 Dummy Villager System for Player 6 (Orange) at AAAPositionVillagerFarm6 facing Default building facing degrees
                                                              • Unit Group - Add (Last created unit) to AAAGroupVillager6
                                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                              • Unit - Add Villager M.Engineer to (Last created unit)
                                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm6)
                                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms6)
                                    • Else - Actions
                                      • Do nothing
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Picked player) Equal to Player 7 (Green)
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Number of units in AAAGroupVillager7) Less than 15
                                        • Then - Actions
                                          • Set AAAGroupAllFarms7 = (Random 1 units from (Units owned by Player 7 (Green) of type Farmhouse))
                                          • Unit Group - Pick every unit in AAAGroupAllFarms7 and do (Actions)
                                            • Loop - Actions
                                              • Set AAAPositionVillagerFarm7 = (Position of (Picked unit))
                                              • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AAARollVillagerFarm Equal to 1
                                                • Then - Actions
                                                  • Unit - Create 1 Dummy Villager System for Player 7 (Green) at AAAPositionVillagerFarm7 facing Default building facing degrees
                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager7
                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                  • Unit - Add Villager M.Crossbowman to (Last created unit)
                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm7)
                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms7)
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • AAARollVillagerFarm Equal to 2
                                                    • Then - Actions
                                                      • Unit - Create 1 Dummy Villager System for Player 7 (Green) at AAAPositionVillagerFarm7 facing Default building facing degrees
                                                      • Unit Group - Add (Last created unit) to AAAGroupVillager7
                                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                      • Unit - Add Villager M.Peasant to (Last created unit)
                                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm7)
                                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms7)
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • AAARollVillagerFarm Equal to 3
                                                        • Then - Actions
                                                          • Unit - Create 1 Dummy Villager System for Player 7 (Green) at AAAPositionVillagerFarm7 facing Default building facing degrees
                                                          • Unit Group - Add (Last created unit) to AAAGroupVillager7
                                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                          • Unit - Add Villager M.Peasant to (Last created unit)
                                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm7)
                                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms7)
                                                        • Else - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • AAARollVillagerFarm Equal to 4
                                                            • Then - Actions
                                                              • Unit - Create 1 Dummy Villager System for Player 7 (Green) at AAAPositionVillagerFarm7 facing Default building facing degrees
                                                              • Unit Group - Add (Last created unit) to AAAGroupVillager7
                                                              • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                              • Unit - Add Villager M.Servant of Man to (Last created unit)
                                                              • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm7)
                                                              • Custom script: call DestroyGroup (udg_AAAGroupAllFarms7)
                                                            • Else - Actions
                                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                • If - Conditions
                                                                  • AAARollVillagerFarm Equal to 5
                                                                • Then - Actions
                                                                  • Unit - Create 1 Dummy Villager System for Player 7 (Green) at AAAPositionVillagerFarm7 facing Default building facing degrees
                                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager7
                                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                                  • Unit - Add Villager M.Thug to (Last created unit)
                                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm7)
                                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms7)
                                                                • Else - Actions
                                                                  • Unit - Create 1 Dummy Villager System for Player 7 (Green) at AAAPositionVillagerFarm7 facing Default building facing degrees
                                                                  • Unit Group - Add (Last created unit) to AAAGroupVillager7
                                                                  • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                                  • Unit - Add Villager M.Engineer to (Last created unit)
                                                                  • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm7)
                                                                  • Custom script: call DestroyGroup (udg_AAAGroupAllFarms7)
                                        • Else - Actions
                                          • Do nothing
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Picked player) Equal to Player 8 (Pink)
                                        • Then - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Number of units in AAAGroupVillager8) Less than 15
                                            • Then - Actions
                                              • Set AAAGroupAllFarms8 = (Random 1 units from (Units owned by Player 8 (Pink) of type Farmhouse))
                                              • Unit Group - Pick every unit in AAAGroupAllFarms8 and do (Actions)
                                                • Loop - Actions
                                                  • Set AAAPositionVillagerFarm8 = (Position of (Picked unit))
                                                  • Set AAARollVillagerFarm = (Random integer number between 1 and 6)
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • AAARollVillagerFarm Equal to 1
                                                    • Then - Actions
                                                      • Unit - Create 1 Dummy Villager System for Player 8 (Pink) at AAAPositionVillagerFarm8 facing Default building facing degrees
                                                      • Unit Group - Add (Last created unit) to AAAGroupVillager8
                                                      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                      • Unit - Add Villager M.Crossbowman to (Last created unit)
                                                      • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm8)
                                                      • Custom script: call DestroyGroup (udg_AAAGroupAllFarms8)
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • AAARollVillagerFarm Equal to 2
                                                        • Then - Actions
                                                          • Unit - Create 1 Dummy Villager System for Player 8 (Pink) at AAAPositionVillagerFarm8 facing Default building facing degrees
                                                          • Unit Group - Add (Last created unit) to AAAGroupVillager8
                                                          • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
                                                          • Unit - Add Villager M.Peasant to (Last created unit)
                                                          • Custom script: call RemoveLocation(udg_AAAPositionVillagerFarm8)
                                                          • Custom script: call DestroyGroup (udg_AAAGroupAllFarms8)
                                                        • Else - Actions