- Joined
- Oct 19, 2010
- Messages
- 71
Hi. Thanks for taking the time to read this. I think I've narrowed down a bug in a map to this trigger. It sometimes stops doing what it is supposed to do for some reason. I have 3 related questions that I think are causing it:
1) Unit Groups
a) If a unit that was in a unit group is destroyed, is it removed from the unit group or do you have to do that manually?
b) If a unit that was in a unit group upgrades, how does that affect its being in the unit group?
2) Waits - What happens if a trigger is asked to wait a negative wait time?
I think those answers will help me figure this out. I'm pasting the trigger just in case someone wants to see it. Thanks for any help.
1) Unit Groups
a) If a unit that was in a unit group is destroyed, is it removed from the unit group or do you have to do that manually?
b) If a unit that was in a unit group upgrades, how does that affect its being in the unit group?
2) Waits - What happens if a trigger is asked to wait a negative wait time?
I think those answers will help me figure this out. I'm pasting the trigger just in case someone wants to see it. Thanks for any help.
-
MilkOudIlaz
-
Events
-
Time - Every 50.00 seconds of game time
-
-
Conditions
-
(Number of units in (Units in MilkingOudIlaz <gen> matching (((Matching unit) is in Milking) Equal to True))) Equal to 1
-
-
Actions
-
Trigger - Turn off (This trigger)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units in MilkingOudIlaz <gen> matching ((Unit-type of (Matching unit)) Equal to Sheep 1))) Equal to 0
-
-
Then - Actions
-
Trigger - Turn on (This trigger)
-
Skip remaining actions
-
-
Else - Actions
-
-
Custom script: set bj_wantDestroyGroup=true
-
Wait (66.66 - (WaitingTimeMilk x (Real((Number of units in (Units in MilkingOudIlaz <gen> matching ((Unit-type of (Matching unit)) Equal to Sheep 1))))))) seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units in MilkingOudIlaz <gen> matching ((Unit-type of (Matching unit)) Equal to Sheep 1))) Equal to 0
-
-
Then - Actions
-
Trigger - Turn on (This trigger)
-
Skip remaining actions
-
-
Else - Actions
-
-
Custom script: set bj_wantDestroyGroup=true
-
Wait (66.66 - (WaitingTimeMilk x (Real((Number of units in (Units in MilkingOudIlaz <gen> matching ((Unit-type of (Matching unit)) Equal to Sheep 1))))))) seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units in MilkingOudIlaz <gen> matching ((Unit-type of (Matching unit)) Equal to Sheep 1))) Equal to 0
-
-
Then - Actions
-
Trigger - Turn on (This trigger)
-
Skip remaining actions
-
-
Else - Actions
-
-
Custom script: set bj_wantDestroyGroup=true
-
Wait (66.66 - (WaitingTimeMilk x (Real((Number of units in (Units in MilkingOudIlaz <gen> matching ((Unit-type of (Matching unit)) Equal to Sheep 1))))))) seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units in MilkingOudIlaz <gen> matching ((Unit-type of (Matching unit)) Equal to Sheep 1))) Greater than 0
-
-
Then - Actions
-
Set StockOfMilk[(Player number of OwnerOfOudIlaz)] = (StockOfMilk[(Player number of OwnerOfOudIlaz)] + 1)
-
Custom script: set bj_wantDestroyGroup=true
-
Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Warehouse) and do (Actions)
-
Loop - Actions
-
Neutral Building - Remove |cffffcc00Grain |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Bread |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Grape |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Wine |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Iron Ore |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Weapon |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Silk |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Silk Fabric |r from (Picked unit)
-
Neutral Building - Remove |cffffcc00Milk |r from (Picked unit)
-
Neutral Building - Add |cffffcc00Grain |r to (Picked unit) with 0 in stock and a max stock of StockOfGrain[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Bread |r to (Picked unit) with 0 in stock and a max stock of StockOfBread[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Grape |r to (Picked unit) with 0 in stock and a max stock of StockOfGrape[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Wine |r to (Picked unit) with 0 in stock and a max stock of StockOfWine[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Iron Ore |r to (Picked unit) with 0 in stock and a max stock of StockOfIronOre[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Weapon |r to (Picked unit) with 0 in stock and a max stock of StockOfWeapon[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Silk |r to (Picked unit) with 0 in stock and a max stock of StockOfSilk[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Silk Fabric |r to (Picked unit) with 0 in stock and a max stock of StockOfSilkFabric[(Player number of (Owner of (Triggering unit)))]
-
Neutral Building - Add |cffffcc00Milk |r to (Picked unit) with 0 in stock and a max stock of StockOfMilk[(Player number of (Owner of (Triggering unit)))]
-
-
-
-
Else - Actions
-
-
Trigger - Turn on (This trigger)
-
-