• 🏆 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] Farming Plant Growth

Status
Not open for further replies.
Level 11
Joined
Sep 12, 2008
Messages
657
Hey, me and my friend are making this farming map, and we were wondering if someone could help us fix this trigger out of leaks..

The Trigger:
  • Plant Growth
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Corn Plant (Small)) and (((Mana of (Matching unit)) Greater than or equal to 100.00) and (((Matching unit) is alive) Equal to True)))) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
          • Item - Create Corn Seed at (Position of (Picked unit))
          • Item - Create Corn Seed at (Position of (Picked unit))
          • Item - Create Corn at (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than or equal to 30
            • Then - Actions
              • Item - Create Corn at (Position of (Picked unit))
            • Else - Actions
Thanks =]
 
Level 8
Joined
Dec 9, 2009
Messages
397
save "Position of Picked unit" to a variable
then clear it at end of each loop

Thats the only one I see, but I'm not the most experienced.
 
Level 11
Joined
Sep 12, 2008
Messages
657
like this?

  • Plant Growth
    • Events
      • Time - Every 2.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 (((Unit-type of (Matching unit)) Equal to Corn Plant (Small)) and (((Mana of (Matching unit)) Greater than or equal to 100.00) and (((Matching unit) is alive) Equal to True)))) and do (Actions)
        • Loop - Actions
          • Set Corn_PickedUnit = (Picked unit)
          • Set Corn_Points[2] = (Position of (Picked unit))
          • Unit - Kill Corn_PickedUnit
          • Item - Create Corn Seed at Corn_Points[2]
          • Item - Create Corn Seed at Corn_Points[2]
          • Item - Create Corn at Corn_Points[2]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than or equal to 30
            • Then - Actions
              • Item - Create Corn at Corn_Points[2]
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Corn_Points[2])
ops.. i forgot to destroy corn_pickedunit and corn_points, ill fix it right away :p *fixed the trigger*
 
Status
Not open for further replies.
Top