- Joined
- Jun 14, 2008
- Messages
- 191
I'm working on an RTS with different resource types for each race. My first question is...what takes up more space...units or destructibles? My second problem is...my trigger for collecting the food resource works, but tells all the gathering workers to gather food from that specific source...
What I mean is, if I have 1 worker gathering food, it works properly, but if I have 2 gathering from 2 different spots, 1 of them will go over to the first worker and gather there instead. How do I get him not to do that? If at all possible, I don't want to use a huge array with a counter to separate out the workers. :/
Here's the Trigger.
What I mean is, if I have 1 worker gathering food, it works properly, but if I have 2 gathering from 2 different spots, 1 of them will go over to the first worker and gather there instead. How do I get him not to do that? If at all possible, I don't want to use a huge array with a counter to separate out the workers. :/
Here's the Trigger.
-
Counting Food
-
Events
- Unit - A unit Is issued an order targeting an object
-
Conditions
- (Issued order) Equal to (Order(smart))
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Ordered unit)) Equal to |c00aa9900T|rausri |c00aa9900E|rlder
-
Or - Any (Conditions) are true
-
Conditions
- (Destructible-type of (Target destructible of issued order)) Equal to *Bush
- (Destructible-type of (Target destructible of issued order)) Equal to *Mushroom
- (Destructible-type of (Target destructible of issued order)) Equal to *Vegtable
- (Destructible-type of (Target destructible of issued order)) Equal to *Wild Grain
-
Conditions
-
Then - Actions
- Set Doodad_Life = (Current life of (Target destructible of issued order))
- Wait until ((Current life of (Target destructible of issued order)) Less than Doodad_Life), checking every 0.30 seconds
- Game - Display to (All players) the text: smart issued
- Unit - Increase level of Food Count for (Ordered unit)
- Unit - Order (Ordered unit) to Stop
- Wait 0.10 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Food Count for (Ordered unit)) Not equal to 20
-
Then - Actions
- Unit - Order (Ordered unit) to Right-Click (Target destructible of issued order)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events