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

[Solved] Remove/Add itens from marketplace

Level 12
Joined
Oct 28, 2019
Messages
475
Sometimes I think the editor trolls, everything seems ok but simply dont work

  • Initializing
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Neutral Building - Add Warrior to Tavern 0006 <gen> with 14 in stock and a max stock of 14
I´ve add Itens in marketplace owned by player 1 (maybe this is the problem). And then trying remove them if 6 archers (item) are sell.

  • IntegerArcher
    • Events
      • Unit - A unit owned by Player 1 (Red) Sells an item (from shop)
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Sold Item)) Equal to Bowman
          • (Item-type of (Sold Item)) Equal to Archer
      • IntegerArcher Equal to 6
    • Actions
      • Neutral Building - Remove Archer from all marketplaces
      • Neutral Building - Remove Bowman from all marketplaces
this is cause the map has 2 types of archers but a limited number need be avaliable, so if reach the integer, both must removed. IDK what is wrong.
Even add, or remove no one is working
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
Is there another trigger that increase IntegerArcher? Otherwise it's never going to be = 6. In general it's better to compare 'greater/less than (or equal)' for quantities like this in case something weird happens to the counter variable for some reason. You can do one trigger:
  • Events
    • Unit - A unit owned by Player 1 (Red) Sells an item (from shop)
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • Item-type of (Sold Item)) Equal to Bowman
        • Item-type of (Sold Item)) Equal to Archer
  • Actions
    • Set IntegerArcher = (IntegerArcher + 1)
    • If (All conditions are true) then (Actions) else (Actions)
      • If - Conditions
        • IntegerArcher greater than or equal to 6
      • Then - Actions
        • Neutral Building - Remove Archer from all marketplaces
        • Neutral Building - Remove Bowman from all marketplaces
        • Trigger - Turn off (This trigger)
      • Else - Actions
 
Top