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

Hashtables, items and equipement

Status
Not open for further replies.
Level 4
Joined
Feb 12, 2007
Messages
99
Hello, following Heroes and Empires map update, I am changing the equipment system for heroes. And now I have a problem on Hash tables.

The system consist in a virtualisation/emulation of the Abilities of items (and no the items themselves). To simply put it, I need to attach to an item references : 4 abilities with each their own level (up to 100 for now). Thus allowing players to craft their equipment into a large panel of items and evolving as they wish to.

Beware, it isn't making an item in the WE and giving him abilities in a list, no, it's adding those abilities in game as well as upgrading those abilities ranks/levels.

Unfortunately my first try with hash tables had not been a success, fatal error of WE, function of hash tables that don't appear both in GUI or Jass.
In worse case, I could eventually link the abilities to heroes and not item but that'd be a lost of a lot of advantages so... need that system to work somehow.

Finally If someone know a way to rename an item in game, (which from my research isn't possible) then it'd be perfect.

Going back to those damn ha(r)sh tables I thank you in advance.

ArnaudB
 
Level 13
Joined
Apr 15, 2008
Messages
1,063
Ok, maybe you should describe your system a bit more (how you wanted to make it work), you can't really tell much from what you wrote.
Here is what you could do: Don't even use the warcraft inbuilt "items", they are useless for this (they can be used to lie on ground and wait for being picked up, but that's all). Use some alternative inventory (like in Diablo 3 or Kingdom of Kaliron), where the item stats and name get displayed in multiboard, or with floating text. (btw. using those full-screen inventorys with pre-generated items is a travesty)

Then just create some indexing system for items. You'll save the item indexes in hero item slots and item abilities in hashtable under the item's index.
Now to make the abilities work, you'll need a set of hero abilities for each stat you want to modify. Those abilities will have bonuses equal to powers of 2 (1,2,4,8,16...) (using those you can combine any number). Then, every time hero equips items, just count the bonuses from all items and add/remove the hero abilities to combine the correct bonuses.

You'll need a lot of time and skill to pull something like this off, good luck.
 
Status
Not open for further replies.
Top