• 🏆 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] Removing and Adding Item From Building

Status
Not open for further replies.
Level 2
Joined
Jun 9, 2018
Messages
10
I was working on a system where when a Hero acquires level 1 item, the shop will remove the item acquired from its list of items being sold, and replace it with a higher level of the item acquired.


  • Upgrade Item Paladin
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Type_of_Hero
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero manipulating item) Equal to Variable_of_Hero[0]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to Item_lvl_1
            • Then - Actions
              • Neutral Building - Remove (Item-type of (Item being manipulated)) from Marketplace <gen>
              • Neutral Building - Add Item_lvl_2 to Marketplace <gen> with 1 in stock and a max stock of 1
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Item_lvl_2
                • Then - Actions
                  • Neutral Building - Remove (Item-type of (Item being manipulated)) from Marketplace <gen>
                  • Neutral Building - Add Item_lvl_3 to Marketplace <gen> with 1 in stock and a max stock of 1
                • Else - Actions
        • Else - Actions


But whenever the hero acquires an item, the shop does not replace it with a higher level. :(
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Put debug messages in your trigger to figure out which condition is failing and why. I still bet it's that one of your variables is not properly set. You can also try changing the event to "A unit sells an item (from shop)" and then use Buying Unit to refer to the hero, but I'm not sure the event is the problem here.
 
Status
Not open for further replies.
Top