Storage system advice concerning talent system

Embrace_It

New Member
Reaction score
9
I'm making a sort of talent system for my project that will allow heroes to have talents that affect their abilities etc.

However, I was wondering what kind of system to use to store these details?
I considered using the native hastables so far.

Also, the structs containing the info will have array members so AIDS is not an option. This will be something only heroes can have.
 
Using an hashtable would be fine, link the handle unit as an integer with the rawcode of the affected ability, to store a struct index.
 
Ok :) so simply use the hero has the parent argument and whatever suitable thing for child argument?
 
For example:

call SaveInteger(myhashtable, myHero, ..., 'A001')

Sorry, but its my first time using hashtables, so I'm may seem a bit slow :p

If I don't want to limit this to 1 hero per player, what would be a good way to store each hashtable?

Wow! After reading this again, I realized how stupid it was. I've got it now I think, thanks! :)

Since this approach would use GetHandleId(...), would it be compatible with other indexing systems? (maybe if they didnt use SetUnitUserData?)
 
Erm, this approach has nothing to do with Unit User Data. At all.

In order I'm right assuming your talents are similar to WoW's one for examples, to use it i'd say organise it in something like 'dat:
[ljass]call SaveInteger(ht, GetHandleId(<HERO>), StringHash(<NAME OF TALENT>), <LEVEL OF TALENT FOR HERO>)[/ljass]
Or, oh, simply saving rawcode of the ability affected (if no ability is affected by more than 1 talent) instead of StringHash(<name>).
You would need only one hashtable for all heroes / players, no matter how many.
 
Instead of StringHash, just use keys (new pseudo type of vJass, basically it's just a constant integer, but you don't need give it a value, and each key got an unique value)
 
Thanks for the clarifications, and advice!

@ the Immortal: What I meant was that some indexing systems change a unit's game id, and that might complicate things with GetHandleId(...), but I'm not really sure though.

I'll get to coding right away! :thup:

EDIT: Another thing though :p, could I also store the struct's integer (since structs are integers) in a hashtable as well? I think I read somewhere that it doesnt work anymore though...
 
you could save struct data in hashtables cause my map uses it and works fine and a system of mine and works fine too.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top