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

[AI] Item Pools

Status
Not open for further replies.
Level 17
Joined
Feb 11, 2011
Messages
1,860
Hi guys. I am learning JASS and I would like to convert my GUI AI to JASS. The main thing I would like to do is convert the AI's item builds to JASS. Can someone help me or point me to a good tutorial? I have heard about item pools but don't know how to use them.

I would like to have 3 item builds to start off with - one for each agility, intelligence and strength heroes.

Thanks for any help. You will get +rep and credits in my map!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
you could make a sort of item list. This stores an item type and a point value in order of magnitude of point value. The AI aquires the lowest (usually cheapest) point value item first. It then progresses sequentially down the list and discardes the lowest point value item. You can also optionally add a number field if you want the AI to have more than 1. You might wish to have many such item systems compete for piority and change piority depending on enemies for better item builds. An example of a competing item piority could be a potion (always make sure AI has a potion early on and make sure it does so before buying new items).
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
JASS:
set table = InitHashtable()
call SaveStr(table,'I000',0,"Some value stored here, use different native for different type.")
set somestr = LoadStr(table,'I000',0)

As you know, 'I000' is the default custom item ID. Anything that returns an item ID integer can be used on that field.
 
Status
Not open for further replies.
Top