• 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.

could trigger detect that there is X available items of type [Some Item] in shop?

Status
Not open for further replies.
Level 9
Joined
Nov 28, 2008
Messages
704
Using the items id as a key.

Whenever something is bought, save an integer on a random hashtable under the key of it's id. If you want to count how many times its been bought, up the count. If you want to count how many are available, you'll just have to init the hashtables key to something appropriate (which would be a pain).

If you want to get supersupersuper complicated, you couldd theoreticlaly recreate the shop and order a dummy unit to keep buying items from it and get a count of how much stuff there is, and use that as a starting count. (I'd actually use that, but I dont even know what the order is to get something to buy from a shop).
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Using the items id as a key.

Whenever something is bought, save an integer on a random hashtable under the key of it's id. If you want to count how many times its been bought, up the count. If you want to count how many are available, you'll just have to init the hashtables key to something appropriate (which would be a pain).

If you want to get supersupersuper complicated, you couldd theoreticlaly recreate the shop and order a dummy unit to keep buying items from it and get a count of how much stuff there is, and use that as a starting count. (I'd actually use that, but I dont even know what the order is to get something to buy from a shop).
i already had that idea and i am trying to make it more simple just by checking if with some function

btw this is how u can order thing with no order string

Custom script:call IssueImmediateOrderById(udg_USED_SHOP,(udg_NB))
used shop is uni,NB is integer variable (id number)


but that's not matter now,just if anyone knows how to detect it some special code ...tell me
 
Status
Not open for further replies.
Top