• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Couple of Q's

Status
Not open for further replies.
Level 6
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.

  • 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
        • 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
        • Else - Actions
 
Level 7
Joined
Jul 20, 2008
Messages
377
I have a theory it has to do with the fact you're using waits, so Ordered Unit and Target Destructible of Issued Order are possibly different after the wait finishes.

Try using Triggering Unit.
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
I am not sure about that but if you want the workers to harvest you must use destructibles/doodads unless you want to see a lot of lifebars when you click alt.
Anyway, if I am not wrong, I think destructibles takes about 60 bytes less filesize than units.
Now, you could give the unit the ability to train something then disable the training of that unit. That way your peasant should have a rally-point. Use the rally point to mark which destructible you want the peasant to harvest. Then replace ordered unit with triggering unit (not sure ifit works but its MUI).
 
Status
Not open for further replies.
Top