• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] item order issue

Status
Not open for further replies.
Level 3
Joined
Feb 7, 2011
Messages
29
Hello,

I'm new to triggering so take it easy on me please ><, I'm a bit stuck with this trigger
  • Farm income Copy
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set FIUG = (Units in (Playable map area) owned by Player 1 (Red))
      • Unit Group - Pick every unit in FIUG and do (Actions)
        • Loop - Actions
          • Set BIUG = (Picked unit)
          • Set FIUG = (Units in (Playable map area) owned by Player 1 (Red))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of BIUG) Equal to Farm
            • Then - Actions
              • Set FBP = (Position of BIUG)
              • Item - Create Bread at FBP
              • Set BIP = (Last created item)
              • Unit - Create 1 item Dummy for Player 1 (Red) at FBP facing Default building facing degrees
              • Set BIUP = (Last created unit)
              • Unit - Order BIUP to Right-Click BIP
              • Wait 0.50 game-time seconds
              • Unit - Order BIUP to give BIP to BIUG
            • Else - Actions
The dummy units spawn and they pick up the item, but they do not give the item to the Farm as they are supposed too[and yes i put inventory option on it] and I am not sure if I should even put the wait time there.

Regards.
- zheavy -
 
Level 3
Joined
Feb 7, 2011
Messages
29
Hello,

I understand u wanted me to remove the wait action, so i did but it still isn't working.

Regards.
- zheavy -
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
You could do something like
  • Farm income
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to Player 1 (Red)) and ((Unit-type of (Matching unit)) Equal to Farm))) and do (Actions)
        • Loop - Actions
          • Hero - Create Bread and give it to (Picked unit)
The function
  • Custom script: set bj_wantDestroyGroup = true
just clears the unit group leak.
For more info about leaks,consult this link: http://www.hiveworkshop.com/forums/...torials-279/essentials-tutorial-141191/#Leaks
 
Level 3
Joined
Feb 7, 2011
Messages
29
Hello,

Thank you very much for help, u technically solved my whole map idea;)
Included u in credits;)

And as for the leaks, it's just I am new to triggering and using the custom script to remove them one by one, but thank you for the link, will go through it, that would probably make my work faster then setting so many variables.

Regards.
- zheavy -
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Rather keep track of all the farms on the map in a separate group and enum through them adding the item. Groups of all units on the map are really bad for efficency.

The reason your fixed way did not work is that a unit can not do 2 orders at the same time.
 
Status
Not open for further replies.
Top