AutoHarvest
v1.1
What is Auto Harvest?
Auto Harvest simply means that whenever you train a harvesting unit, it will automatically harvest nearby lumber.
AutoHarvest can often be seen in maps like Vampirism Fire and Speed.
Can it be turned Off and On?
Yes, it can be turned off and on by clicking on the item/ability.
Variables used:
AutoHarvest Boolean Array of Size 12
HarvestG Empty Player Group
v1.1
What is Auto Harvest?
Auto Harvest simply means that whenever you train a harvesting unit, it will automatically harvest nearby lumber.
AutoHarvest can often be seen in maps like Vampirism Fire and Speed.
Can it be turned Off and On?
Yes, it can be turned off and on by clicking on the item/ability.
Variables used:
AutoHarvest Boolean Array of Size 12
HarvestG Empty Player Group
Code:
Trigger:
- Toggle ON and OFF
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to AutoHarvest Turn On/Off
- Actions
- Player Group - Add (Owner of (Triggering unit)) to HarvestG
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- AutoHarvest[(Player number of (Owner of (Triggering unit)))] Equal to True
- Then - Actions
- Set AutoHarvest[(Player number of (Owner of (Triggering unit)))] = False
- Game - Display to HarvestG for 5.00 seconds the text: -------AutoHarvest ...
- Else - Actions
- Set AutoHarvest[(Player number of (Owner of (Triggering unit)))] = True
- Game - Display to HarvestG for 5.00 seconds the text: -------AutoHarvest ...
- If - Conditions
- Player Group - Remove (Owner of (Triggering Unit)) from HarvestG
- Events
Trigger:
- AutoHarvest
- Events
- Unit - A unit Finishes training a unit
- Conditions
- AutoHarvest[(Player number of (Owner of (Trained unit)))] Equal to True
- (Level of Harvest (Gold and Lumber) for (Trained unit)) Greater than or equal to 1
- Actions
- Unit - Order (Trained unit) to Harvest Nearby Lumber
- Events
version 1.1 Changelog:
1. Autoharvest on and off text is only displayed to the owner of the trained unit
2. Unit type Condition of AutoHarvest trigger changed to a Harvest Ability level Condition.