• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
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).
 
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.
Back
Top