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

Showing the inventory while buying

Status
Not open for further replies.
Level 9
Joined
Dec 21, 2006
Messages
490
as far as i remember in tft you always see your inventory while buying. everything else would be idiotic, well in sc2 no inventory is shown.

is there a way to show the current inventory with dialogs? i am using the standard 6 slot inventory of the data editor.

so my question is, is there a way to do this without the need of n (number of items) if then elses?

like if
slot 1 = item 1
then
change text of dialog to picture 1

if
slot 1 = item 2
then ....
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Yes, the pictures of items are probably retreviable via catalogs. Thus all you do is itterate through all 6 item slots, and if an item is present you then look up its image path for the item type via catalogs. The catalog lookup will have O(1) complexity and is dynamic (so no hard coded tables).

Catalog natives basically give you direct access to all the data entries you define in the data editor from triggers. They are also highly dynamic meaning you can even make trigger systems autodetect new data types that are created (eg, for a new version). Be aware that although there are natives to change catalog field values, these only work on "upgradable" data fields as they are per player. I hope Blizzard introduces a global catalog field modifier to modify most other catalog enteries.
 
Level 9
Joined
Dec 21, 2006
Messages
490
O(1) sounds great but how do i access the img path via catalogs.

let's say unit = item1 ; item = item1item; face(the icon) = item1face; img path = tier1\item1

i can access the icon's img path but how to acess the img path of icon of item of unit?


hope i was able to explain this correctly
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Yeh its not straight foward (double depth).
You firstly get the "Face" of the item (The Button the icon is allocated). You then get the texture path the button uses (from the button ofcourse).

Getting the item from the unit is done via the corosponding unit item natives.
 
Status
Not open for further replies.
Top