• 🏆 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!

Saving local group in hashtable

Status
Not open for further replies.
Level 8
Joined
Aug 5, 2014
Messages
194
Hello, maybe it will seem a very retarded question. But really cant understant what seems to be a problem. I just making a map for myself for fun and tried to port trigger from Open Dota, Warlock SpellBound. It was very old version with returnbug, so i replace it with hashtable and stuff. And im stuck with the problem where it save local unit group in hashtable, and then must load it in funtion where units in this local group takes damage. After that i tried to debug it and found out when local group is created and in the moment of saving into hashtable, it has some units, but when it loaded in other function its empty. I tried to make a simple trigger model, where local group is filled, saved in hashtable, than loaded from hashtable, and its count displayed in the game. And the same result. I even extract war3map.j from more modern versions to see how its done(returnbug replacement), and its done the same way with local groups and hashtables. I dont get what i missed?

Here is example of simple LocalGroupTest, which i did when i tried to understand why group is empty after loading.

1622989168713.png

I tried different ways to that. SaveGroupHandleBJ, SaveGroupHandle. Same with Load.

One major thing, Im working with old version of editor 1.31, pre reforged. I also tried to test it on more older 1.28, results are the same.

Thank you in advance.
 
Level 23
Joined
Apr 3, 2018
Messages
460
Was the hashtable initialized? As in, the Create Hashtable function called on map initialization, and then udg_HT set to "Last Created Hashtable"?

The GUI hashtable-type variables are empty by default. If the hashtable is not there you can't save anything in it... So the count unit in group returns 0 as there's no group being loaded from the non-existant hashtable.
 
Last edited:
Level 8
Joined
Aug 5, 2014
Messages
194
Thank you. Really retarded mistake. I create hashtable varible, i initialized it, but i forgot to add create hash table and set hashtable varible(HT) to it. Damn, i thought when i create hashtable as varible, i create actual hashtable for use. Now its working correctly. At least the example.
 
Status
Not open for further replies.
Top