- 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:
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?
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)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in (Units of type Farmhouse) and do (Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Player Group - Pick every player in (All players) and do (Actions)
-
Events