• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Return Lumber and Stacking Item

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2014
Messages
111
Ok, so i need to know how to give a unit an item, in this case Lumber. Unit will get an amount of stack equal to how much lumber it currently harvested. I'm using Easy Item Stack 'n Split v2.7.4 for the system. I tried to detect lumber before and after the unit returning the lumber and give it the item but the total stack isn't match the current harvested lumber, it instead gives me a total lumber gathered and it cause lag everytime the lumber returns because the amount of items created. I need help fixing this. And is this problem because of the system or my poor trigger?
Here's the trigger and the testmap.

Update : It seems like if i didn't reset the variable in the end, the error would seem decreased as if it's not increasing the value too high anymore. But we have still the main problem. The value seems increased while right before the unit start harvesting and then it got canceled. The order still counts. OR its maybe because the second order that required to detect when the unit finished harvesting is wrong or something.


  • Lumber Harvesting
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(harvest))
          • (Issued order) Equal to (Order(resumeharvesting))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(harvest))
        • Then - Actions
          • Set LumberA = ((Owner of (Ordered unit)) Current lumber)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(resumeharvesting))
            • Then - Actions
              • Set LumberB = ((Owner of (Ordered unit)) Current lumber)
            • Else - Actions
      • Set LumberDiff = (1 x (LumberA - LumberB))
      • Set LumberDropPoint = (Position of (Ordered unit))
      • For each (Integer LumberInt) from 1 to LumberDiff, do (Actions)
        • Loop - Actions
          • Item - Create Lumber at LumberDropPoint
          • Hero - Give (Last created item) to (Ordered unit)
      • Custom script: call RemoveLocation(udg_LumberDropPoint)
 

Attachments

  • SystemTest.w3x
    33.3 KB · Views: 41
Last edited:
Status
Not open for further replies.
Top