• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Flushing Parent hashtable question

Status
Not open for further replies.
Level 13
Joined
Jan 2, 2016
Messages
973
Last time I was flushing a parent hashtable - I couldn't save any values in that hashtable anymore. It was like the hashtable was destroyed.

So I need to ask - what do I need to do to be able to re-fill a hashtable, which parent has been flushed?
 
Level 13
Joined
Jan 2, 2016
Messages
973
yeah, but I was talking about native FlushParentHashtable takes hashtable table returns nothing
I haven't had any problems with FlushChildHashtable, but last time I used FlushParentHashtable - the table became unuseable.
(It took me a lot of tests till I figured out what was wrong :D)
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
yeah, but I was talking about native FlushParentHashtable takes hashtable table returns nothing
I haven't had any problems with FlushChildHashtable, but last time I used FlushParentHashtable - the table became unuseable.
(It took me a lot of tests till I figured out what was wrong :D)

You never use FlushParentHashtable. At least I have not found any use for it, and I use hashtables for every system I create.
 
Level 13
Joined
Jan 2, 2016
Messages
973
As far as I know, FlushParentHashtable() will "destroy" the hashtable. You will have to re-initialize it if you want to use it.

EDIT: Confirmed by Nestharus

I see (suspected as much)
However, since there is a limit of 256 hashtables.
Does "FlushParentHashtable" free up space?
Like.. if you have 256 tables, and you flush the parent of one, will you be able to re-create it, or does it reduce the limit of hashtables you can have?
 
I see (suspected as much)
However, since there is a limit of 256 hashtables.
Does "FlushParentHashtable" free up space?
Like.. if you have 256 tables, and you flush the parent of one, will you be able to re-create it, or does it reduce the limit of hashtables you can have?

Yes. FlushParentHashtable basically deletes the hashtable. For the situation you described, you would be able to re-create it.

Systems like "Table" partitions keys so that you really only need to use one hashtable for your entire map (they perform quite well even with a lot of entries). But there isn't anything wrong with using a bunch of hashtables. You usually won't need to destroy them though--unless you want to quickly clear all entries.
 
Status
Not open for further replies.
Top