1. Please help test custom maps and more on the latest PTR!
    Dismiss Notice
  2. Create competitive 1v1 maps in the Melee Mapping Contest #2!
    Dismiss Notice
  3. Evolution complete! Make Darwin proud and go vote in the Techtree Contest #12 - Poll.
    Dismiss Notice
  4. Icon Contest #17 - Results are out! Step by to congratulate our winners!
    Dismiss Notice
  5. Succumb to the whispers and join our Texturing Contest #29 - Old Gods!
    Dismiss Notice
  6. The results for Texturing Contest #28 are out! Step by to congratulate our winners!
    Dismiss Notice
  7. We've created the Staff Job Openings thread. We're currently in need of icon, video production, and social/multimedia positions to be filled. Thank you!
    Dismiss Notice

Can I do this?

Discussion in 'World Editor Help Zone' started by Rugarus, Jul 14, 2018.

  1. Rugarus

    Rugarus

    Joined:
    Dec 2, 2016
    Messages:
    547
    Resources:
    0
    Resources:
    0
    Is it possible to add/remove items to a unit that sells items?
     
  2. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,363
    Resources:
    21
    Spells:
    21
    Resources:
    21
    Yes, by using Trigger Editor. Create a new one and there's should be an event that fires when unit sells an item. Creating and removing item can be done by the actions.
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    24,632
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Unless new natives were added that allow one to change the stocks of any item seller, one might only be limited to changing item stocks on marketplaces with the appropriate actions/natives.

    Marketplaces have different mechanics from normal item shops because they are designed to change out random items periodically.
     
  4. Rugarus

    Rugarus

    Joined:
    Dec 2, 2016
    Messages:
    547
    Resources:
    0
    Resources:
    0
    Like I have a unit that has the ability sell items. So I can essentially trigger remove and add items to be sold by that unit?
     
  5. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,363
    Resources:
    21
    Spells:
    21
    Resources:
    21
    ^Ah, I've misunderstood your question previously. I thought selling/giving an item to a shop and creating or removing the items from the inventory slot of the unit. As super good mentioned earlier, I don't think you can manipulate or change the item stocks that can be sold by the shops or item sellers through Trigger Editor as they were only initiated at the Object Editor only, in my opinion. But there is a possible way of doing what you wanted to... You can replace the unit seller by the another unit seller that is having different item stocks through Object Editor and by triggering the replacement. The method is untested and I'm not sure if it works but you should try.
     
  6. Rugarus

    Rugarus

    Joined:
    Dec 2, 2016
    Messages:
    547
    Resources:
    0
    Resources:
    0
    ah okay, that was my first thought. Thanks.
     
  7. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    24,632
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    One can manipulate marketplace stocks with triggers. Marketplaces sell random items. One can even manipulate units sold at market places.
     
  8. Rui

    Rui

    Joined:
    Jan 7, 2005
    Messages:
    8,299
    Resources:
    8
    Maps:
    8
    Resources:
    8
    Marketplaces aren't entirely random in the sense that they only generate dropped items (and dropped by neutral hostile units, I assume).

    Also, last I checked, the natives to control marketplaces' stocks weren't working. Give it a try anyway; I could have made a mistake or Blizzard may have fixed it in the meantime.
     
  9. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    24,632
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    They used to work long ago, some people used them for alternative solutions to problems that required one to swap buildings or have multiple buildings. Any particular patch they stopped working at?
     
  10. Rui

    Rui

    Joined:
    Jan 7, 2005
    Messages:
    8,299
    Resources:
    8
    Maps:
    8
    Resources:
    8
    Correct. I have confirmed they do work. The natives demand those shops to have the Sell Items ability, however. I believe I may have accidentally removed it, which is why it wasn't working.

    The behavior also differs depending on (1) the owner of the marketplace and (2) the widget type being sold.
    • If the marketplace sells a unit, the unit is permanently for sale (though with the replenishment cooldown that's set in object editor)
    • If the marketplace sells an item,
      • The item is permanently for sale if the marketplace is owned by a player1 (with replenishment cooldown)
      • The item vanishes from the marketplace when bought if the marketplace's owned by neutral passive.

    1 — I have not checked whether the player needs to have specific characteristics, such as being human.