| 08-07-2009, 09:57 PM | #1 |
I have been getting weird results with saving effects and retrieving them using hashtables if anyone has any idea what may be causing it or can see a thread crash better i'd appreciate it. i know it's not leak free since it's GUI but if that's the problem then let me know. Is there anything funky with saving/destroying effect handles? thanks. |
| 08-07-2009, 10:17 PM | #2 |
you forgot to clear the hashtable entries/save slots you're using. Trigger: Hashtable - Clear all child hashtables of child 1 in holdeffects |
| 08-07-2009, 10:31 PM | #3 |
so you cant overwrite it with new data to clear out the old data? that seems a pain, what if i wanted to create the effect for different units. would I need a hashtable for each unit? they would have different parent keys yet the same child key in that hash table. |
| 08-07-2009, 10:34 PM | #4 |
Just remember to clear the hashtable before you use it. EDIT: Oh I misunderstood, sorry, try setting it to a null value. Create a special effect variable then set the initial value to none, every time you are finished using the special effects just do this: Trigger: ![]() Hashtable - Save Handle Of null as 1 of 2 in holdeffects![]() Hashtable - Save Handle Of null as 1 of 3 in holdeffects![]() Hashtable - Save Handle Of null as 1 of 4 in holdeffectsWhere null is an agent type that corresponds with the Hashtable save slot type. EDIT: I think you're right, you can't overwrite values inside the hashtable, if you're doing it too fast(not sure), I also encounter an access violation everytime I exit the game. |
| 08-08-2009, 01:32 AM | #5 |
Okay, yea, now you starting to see my problem. It's a strange thing. It's actually weirder in the map which I started to find the problem. One solution I've (accidently) found is when I tried to make a debug multiboard which loaded the effecthandles every 0.1 seconds and put them on the board. When doing this I get no errors upon closing or running my map. I think the problem is either in the destroyeffect() which somehow is influencing the hashtable? or some bug in the hashtables? I am very clueless, but I would not like to flush the table if at all possible. EDIT: I'm also curious if trying to load a value of a hashtable in which there is no value saved, will 'save' a value at that place? All though the value would be null,0,"" or something of the sort. EDIT 2: I got it figured out, I was simply adding/destroying effects too fast. :] Thanks for your help. |
