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

[General] GetUnitItemsSold

Status
Not open for further replies.
Level 1
Joined
Apr 8, 2020
Messages
110
Is there such a function or something similar to get the items sold by a shop? I would like to do something similar to what one would do by getting an item from an inventory slot.
 
Level 5
Joined
Jul 31, 2020
Messages
103
If you're thinking of getting a list of sold items, I believe there's no easy way of doing that. If my hunch is correct, it would be a unit integer array field, and array fields are not even fully implemented for abilities which is currently their only presence in the editor. However, I could see it being possible in some warped way where you:
  1. Create a dummy unit.
  2. Optionally create a dummy shop as well in case you have stocks in there or something and don't want to fiddle with them.
  3. Force the dummy to buy every item, then sell them back after storing what item-type it was, one by one.
This would give you an item-type array of sold items. It sounds very rough, and it is. I think it would work though, but I'm not going to dive into it at 1 in the morning. Maybe tomorrow if I remember it, and it keeps my attention for long enough.
 
Level 1
Joined
Apr 8, 2020
Messages
110
Your method will require knowing the item type ids, so I would be better off just setting an array for the items and shop since I will have to do anyway with your method. I would like to avoid that because it is tedious with a lot of shops and items.

A better method would be storing object data in some way (hashtable) and retrieving it later via one function.

One used to be able to use a tool known as ODE (short for object data extractor) to do this.
 
Status
Not open for further replies.
Top