• 🏆 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!

[General] Problem in map with items says full!

Status
Not open for further replies.
Level 19
Joined
Feb 15, 2008
Messages
2,184
Trigger
  • Healing Salve Carried
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Healing Salve
    • Actions
      • Set Unit = (Triggering unit)
      • Set Item[1] = (Item being manipulated)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Item[2] = (Item carried by Unit in slot (Integer A))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item[2] Not equal to Item[1]) and ((Item-type of Item[2]) Equal to Healing Salve)
            • Then - Actions
              • Set Item[3] = Item[2]
            • Else - Actions
      • Custom script: if udg_Item[3] != null then
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in Item[3]) Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in Item[1]) Equal to 0
            • Then - Actions
              • Item - Set charges remaining in Item[3] to 2
            • Else - Actions
              • Item - Set charges remaining in Item[3] to (1 + (Charges remaining in Item[1]))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in Item[1]) Equal to 0
            • Then - Actions
              • Item - Set charges remaining in Item[3] to ((Charges remaining in Item[3]) + 1)
            • Else - Actions
              • Item - Set charges remaining in Item[3] to ((Charges remaining in Item[3]) + (Charges remaining in Item[1]))
      • Hero - Drop Item[1] from Unit
      • Item - Remove Item[1]
      • Custom script: set udg_Item[3] = null
      • Custom script: endif
have this trigger just a problem it says its full when i have full with items its supposed to make more of that item :/ how can i solve this?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
only solution I know of is to make all items power-ups, just as how dota does it and when you pick up power up then do checking

behavior you are experiencing is hard-coded and cannot be evaded with triggers(game checks if there are items in all slots of inventory before triggers run)
 
I made once an advanced stack system. I think I did something like...

1.Check if unit gets a order on an object, then you can check if it's your ItemClass (usually for stacking items it's "buyable")

2.Then you check if hero has an item of that type already in inventory AND you have no empty slot anymore.

3.If yes, hero will stop running, and error will come "no empty slot". So you order hero per trigger to run to point of item.

4. You periodicly check the distance of ItemPosition and HeroPosition. If distance is low enough, you remove the item, and add +1 in your item worried by hero.

Note: You need a trigger that turns off this periodic check, when hero gets a new order.
 
Status
Not open for further replies.
Top