1. The poll for our 11th Music Contest is up! Help us choose the most awesome cinematic tracks by casting a vote!
    Dismiss Notice
  2. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  3. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  4. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    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:
    593
    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,362
    Resources:
    20
    Spells:
    20
    Resources:
    20
    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,984
    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:
    593
    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,362
    Resources:
    20
    Spells:
    20
    Resources:
    20
    ^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:
    593
    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,984
    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,362
    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,984
    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,362
    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.