• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Shop is removing wrong item

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,928
Hello, I'm making that a shop sells 3 items but one of them only appears if there is no player unit in a specific region, so when the condition is met I add the item, if not I remove it, the problem is when is no unit of mine nearby the shop, it removes another item instead of what I wanted. It just works fine if I have a unit nearby (just in case I'm saying that I also added this item via triggers, but it is no supposed to dissapear).

What's happening?
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
Nope, I added this trigger and the item still dissapear:
  • Untitled Trigger 002
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: PauseTimer(bj_stockUpdateTimer)
      • Custom script: DisableTrigger(bj_stockItemPurchased)
But I noticed what really happened is the wrong item dissapears like 10 seconds after I added the another item that appears when the condition I mentioned before is met.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Shops are buggy, I think you need to rebuild the whole thing from scratch each time. I made a system a while back where I was using a workflow like this:
  • Shop - Limit items sold to 0
  • Shop - Limit items sold to 12
  • For Loop from X to Y add Item[X] to Shop
Item[X] was loaded from a Hashtable. If I wanted an item gone, I would remove it from the Hashtable and run the above logic again. The limit stuff was to quickly clear the Shop.
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
Shops are buggy, I think you need to rebuild the whole thing from scratch each time. I made a system a while back where I was using a workflow like this:
  • Shop - Limit items sold to 0
  • Shop - Limit items sold to 12
  • For Loop from X to Y add Item[X] to Shop
Item[X] was loaded from a Hashtable. If I wanted an item gone, I would remove it from the Hashtable and run the above logic again. The limit stuff was to quickly clear the Shop.
The problem for me is that the items are being added from 2 different and unrelated systems, so that won't be practical, probably I could try something else.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
The problem for me is that the items are being added from 2 different and unrelated systems, so that won't be practical, probably I could try something else.
Well, I would either use custom UI for the shops and avoid all of these annoying limitations, or look into reworking those other systems. It sounds weird to me to have more than 1 shop system, you could probably combine them all into one thing.
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
Well, I would either use custom UI for the shops and avoid all of these annoying limitations, or look into reworking those other systems. It sounds weird to me to have more than 1 shop system, you could probably combine them all into one thing.
In reality... they are not really shop systems I just used items to do actions when they are being bought, if I didn't used spells is to also get the player unit who run the event, at least this last case I realized that I don't need it to be an item because I don't need who "buy" the item, so I can use an spell.
 
Status
Not open for further replies.
Top