Dameon
"All the power in the world resides in the eyes"
- Reaction score
- 127
For some reason this trigger is causeing 3 to 4 secound lag the first time it runs, but then after that it dosen't lagg anymore, I tryed out 2 defrent forms of the trigger to stop the lag and I will post them both.
I did this one cause I thought removeing an ability from a unit that dosen't have it yet might be causeing the problim.
Code:
Ability Builder
Events
Unit - A unit Finishes construction
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Command Post [Builder-MA]
Actions
For each (Integer Main_Interger[0]) from 1 to 12, do (Actions)
Loop - Actions
Set Temp_UG = (Units owned by (Owner of (Triggering unit)) of type UT_Builder[Main_Interger[0]])
Unit Group - Pick every unit in Temp_UG and do (Actions)
Loop - Actions
Unit - Remove SB_Builder from (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit))) Greater than 0
Then - Actions
Unit - Add SB_Builder to (Picked unit)
Unit - Set level of Armor Bonus [Builder] for (Picked unit) to (Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit)))
Unit - Set level of Damage Bonus [Builder] for (Picked unit) to (Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit)))
Else - Actions
Custom script: call DestroyGroup (udg_Temp_UG)
I did this one cause I thought removeing an ability from a unit that dosen't have it yet might be causeing the problim.
Code:
Ability Builder
Events
Unit - A unit Finishes construction
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Command Post [Builder-MA]
Actions
For each (Integer Main_Interger[0]) from 1 to 12, do (Actions)
Loop - Actions
Set Temp_UG = (Units owned by (Owner of (Triggering unit)) of type UT_Builder[Main_Interger[0]])
Unit Group - Pick every unit in Temp_UG and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Boolean_Builder[(Player number of (Owner of (Triggering unit)))] Equal to False
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit))) Greater than 0
Then - Actions
Unit - Add SB_Builder to (Picked unit)
Unit - Set level of Armor Bonus [Builder] for (Picked unit) to (Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit)))
Unit - Set level of Damage Bonus [Builder] for (Picked unit) to (Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit)))
Else - Actions
Set Boolean_Builder[(Player number of (Owner of (Triggering unit)))] = True
Else - Actions
Unit - Remove SB_Builder from (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit))) Greater than 0
Then - Actions
Unit - Add SB_Builder to (Picked unit)
Unit - Set level of Armor Bonus [Builder] for (Picked unit) to (Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit)))
Unit - Set level of Damage Bonus [Builder] for (Picked unit) to (Number of living Command Post [Builder-MA] units owned by (Owner of (Triggering unit)))
Else - Actions
Custom script: call DestroyGroup (udg_Temp_UG)