• 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] Need a Quick help

Status
Not open for further replies.
Level 12
Joined
Aug 7, 2004
Messages
875
I'm making a trigger that orders a unit to harvest a goldmine which is selected by the rally point of the townhall.

  • [COLOR="Yellow"][B]Events[/B]
    • Time - Every 1.00 seconds of game time
  • [B]Actions[/B]
    • Set p = (Rally-Point of Barracks 0029 <gen> as a point)
    • Unit Group - Pick every unit in (Units within 800.00 of p) and do (Actions)
      • Loop - Actions
        • If ((Unit-type of (Picked unit)) Equal to Mine Cart) then do (Set
  • MineCart = (Picked unit)) else do (Do nothing)[/COLOR]
  • [COLOR="YellowGreen"][B]Events[/B]
    • Time - Every 1.00 seconds of game time
  • [B]Conditions[/B]
    • (Triggering unit) Equal to Peasant 0009 <gen>
  • [B]Actions[/B]
    • If ((Current order of Peasant 0009 <gen>) Equal to (Order(harvest))) then do (Do nothing) else do (Unit - Order Peasant 0009 <gen> to Harvest MineCart)[/COLOR]
The problem with the second code is that as soon as the peasant returns the gold, it keeps going back to harvest the gold again instead of returning.

So I'm asking you if these two things.
Is there such thing as a Order(return)?
Is there an event where a rally point is set?
Or do you guys have any other solutions?

Waiting for ur reply, and ofcourse +rep for ur help
 
Last edited by a moderator:
Level 8
Joined
Sep 13, 2006
Messages
431
The order is "resumeharvesting"
Just found it. So, basically, you can't order the unit to harvest every second or it will cancel "resumeharvesting"
Change it to (order is not harvest or resumeharvesting) and it should work fine...
 
Last edited:
Level 8
Joined
Sep 13, 2006
Messages
431
hmmmm.... that's really weird. Checking it out right now...

Well, it worked for me. Make sure you typed it correctly.
  • If (((Current order of Peasant 0002 <gen>) Not equal to (Order(harvest))) or ((Current order of Peasant 0002 <gen>) Not equal to (Order(resumeharvesting)))) then do (Unit - Order Peasant 0002 <gen> to Harvest Gold Mine 0003 <gen>) else do (Do nothing)
 
Last edited by a moderator:
Level 12
Joined
Aug 7, 2004
Messages
875
it works, my bad it was some silly mistake

Another question, I don't know why this trigger ain't workin
  • Events
    • Unit - A unit Finishes research
  • Conditions
    • (Researched tech-type) Equal to Improved Gold Harvesting - |c00C3F968[Level 1]|r
  • Actions
    • Unit Group - Pick every unit in MinErs[(Player number of (Owner of (Researching unit)))] and do (Actions)
      • Loop - Actions
        • Unit - Increase level of Collect Gold for (Picked unit)
 
Last edited by a moderator:
Level 8
Joined
Sep 13, 2006
Messages
431
Don't think this is the problem, but maybe try "set level of x to x" rather than "increase level of x".
In addition, it may not be picking the units, as the triggering unit is no longer researching. Try using triggering unit instead.

  • Actions
  • Unit Group - Pick every unit in MinErs[(Player number of (Owner of ([U]Triggering unit[/U])))] and do (Actions)
 
Status
Not open for further replies.
Top