AH! I had read on the Wiki that hashtables could only store strings, but I had stored numbers in them before so I just assumed that this was old news. I think I had determined that with input from a textbox, which must default to being a string even if it is a number? hope to not confuse more than helping, but you are talking about storing. And the value to store can be of any type. It is just the key that has to be a string.
-> Insert key "1" with value 2
the key "1" is created with the value number 2, accessible as HashTable("1")
-> Insert key "1" with value "2"
the key "1" is created with the value string 2, accessible as HashTable("1")
-> Insert key 1 with value 2
no key is created, because 1 is a number, not a string.
And a textbox indeed only knows strings, but CC is helpful enough ro autoconvert for you.
-> Set Text to str(1)
-> Set Text to "1"
-> Set Text to 1
all three examples lead to the same result: A textbox with the text/value "1" (string)
As for your point about why I care I'm not too sure if it's rhetoric or not so I'll answer:
This isn't a game, it's a map editor! So I expect myself and whoever else uses it to move files around. As I make maps they pile up pretty fast. If I were to split the file out of wanting to take the easier route I would end up having to make 3 files each per map (not including the optional tileset save file)... so it just starts to get kinda messy.
And I could use folders, but I think it is just easier if I want to share a map with someone to just send one map file.
The second thing is that while I'm mostly making this for me (maybe a couple of friends, and I plan to share it on the forum) I'd rather not have to code for an exception if one of the files is missing. Just easier, once I hit the bug squashing phase I'm going to have my hands pretty full anyways.I see. Apart from the possibility of compressing such folders in an archive before sharing it, I think you have an argument with the exception code. The one-file-route should be easier to maintain.
If you are heading for one final file containing the map structure with all its levels and the like, you may want to develop a naming convention for the keys. Something like
"countL" (number of levels)
"01_tiles" (the tileset of level 01)
"01_countM" (number of maps of level 01)
"01_01" (map 01 of level 01)
could easily be retrieved again. And instead of storing one key per array value, I would convert the array to a string and store the array in one key. In the example above the key "01_01" would contain a string with all the array data of map 01 of level 01. I made an example cap showing how this can be achieved: array2hashtable.rar
You make a great point about spending more time helping people too. I find when I look (and I do whenever I'm on here) I don't have anything to contribute to questions about physics, or controller issues, or AI. This will change when I'm done this map editor and actually focusing on making games, but in the meantime I am constantly amazed at the frequency that you and Jayjay and R0j0hound help people.
If I haven't said it before, thank you so much. hope I didn't offend you, because my words weren't addressed at you but at the people that didn't help although they could have. I was just a bit disappointed coming back here after two month just to see, that so many questions are unanswered for weeks. There are so many talented developer out there, and even those who got help themselves don't contribute. It's not the way a community works: If most of the people are only leeching then the system breaks. And that would be very sad...
Please don't think that I meant you, it was just the first thread that I answered in <img src="smileys/smiley1.gif" border="0" align="middle">