I fixed part of it by removing starcode lib but it couldn't have taken up too much space (I stopped needing to use it).
I think it may be because I have a lot of data table saves for my trait trees, about 250 entries each with a description saved as a string. The string has to be parsed to replace like %C with class %R with race %G with gender specific stuff etc etc so I cant store it as text.
Is there a better way to do this? I'm pretty much using the GUI editor entirely as I don't really know how to hardcode this stuff very well.
Edit: This is a massive project I've been working on for months and there's a LOT of stuff in it.
Part of the problem is that since I have to create a lot of data table entries for items and traits I have a large portion of code devoted to defining those things. Theyre static values that are simply read and don't change. Is there a better way to handle them? I don't think we can create custom catalogs to use for referencing but that sure would be nice.
Edit 2: Currently theres 13869 lines of code. My uncompressed trigger size is 8.85 MB compressed is 1.45mb
4931 actions 3414 function calls 873 variables 1313 conditions 75 triggers (working on lowering triggers)
Do comments count? I have a lot of comments I use to keep myself on track.
How are you currently structuring your data tables? Its not very clear to me without a screenshot. If im interpreting this right, you have 1 data table for each trait tree (how many trait trees to you have?)? and each trait tree has 250 entries? If you could provide more detail on how your descriptions are saved, (specifically a sample string)
I might be able to suggest a way you can optimize the way your strings are stored. I've got something off the top of my head but I don't know whether it'll work for your scenario.
Edit: Um.. you haven't answered my question? Can you post a sample of the string you are saving?
Btw..
Quote:
I'm pretty much using the GUI editor entirely as I don't really know how to hardcode this stuff very well.
I think you mean scripting with galaxy right? Cos hard coding is actually a very bad thing to do when you're programming, its often inefficient because it doesn't make use of code reuse.
Theres 22 classes with 13-16 traits in their trees.
Theres 209 total traits defined like this:
Using ID#[1001] create a Trait named "Ferocity" showing image "Assets\Textures\ui_tip_questionmark.dds" with a Max Rank of [5] costing [1] per rank and a description of "Increases the %C's strength by %R1/2/3/4/5/%.".
Theyre then formed into the trees (since some get reused) here:
Ok.. I'm really horrible with GUI, but if im understanding this correct, your first screenshot shows a function that basically stores your trait data into a record/table right?
The second screenshot, the "For A as index B set trait C etc etc" is another function that connects the traits to your character trees right? Could I take a look at that function as well?
Could you try this, copy the code from just the first screenshot into a new map, press CTRL+F11, copy the script and paste it here? I code in Galaxy so It might help me get a heads up on how the game engine is compiling your code. And from there maybe we can work something out
Ignore the text above, im processing your updated information.
Edit:
Assuming here each character in the string uses up some memory, you could save a lot by changing
"Assets\Textures\ui_tip_questionmark.dds"
to
"ui_tip_questionmark"
When you retrieve this string later, just do a string concatenation: "Assets\Textures\" + image + ".dds" when you apply the image.
Thats 20 characters * 209 shaved, about 4020 characters.
On further speculation, You may be able to do without the LABEL variable, assuming data tables automatically store your data into index 1001, though i can't say for certain, i need to see the code first.
Heres how i would store your data, you have 6 parameters
ID,Name,Descrpition,Image,MaxRank,CostPerRank
1001,"Ferocity","Increases the %C's strength by %R1/2/3/4/5/%.", "ui_tip_questionmark",5,1
ID basically just identifies the location the following string will be stored in your data table (which is an array i suspect).
Think of a character that you won't be using in your strings, use it as a delimiter, Iets just use [ ] square brackets as an example. I encode your data into a single string
s = [Ferocity][Increases the %C's strength by %R1/2/3/4/5/%.][ui_tip_questionmark][5][1];
When you want to decode the data later, I just use StringFind("[]") To search for the index of the delimiter, Extract the strings you need, then populate the trait tree.
The decoder function: string decode(string s); Returns the first string preceding your delimiter, in this case []
To decode, Use StringFind() to get the index of "[]" (should return 9 i think)
Then use SubString() to extract the data from index 1 to 9-1, which should take out the word "Ferocity"
Replace "["+"Ferocity"+"]" with "" (a blank string), then use the decoder to keep extracting the rest of your strings.
Once StringFind() returns a -1, it means you've reached the end of the string, so you would know for sure that is your cost per rank data.
The advantage of this is that instead of 209 x 5 variables, you instead have 209 variables. This should cut memory allocation to about 1/5th of what you're currently using.
I definitely think the image storing part is a good way to cut down on code, I will do that for sure. What about descriptions tho? Isn't there a way to use string external or something to store those outside of the code?
I just have to make sure I retrieve the descriptions as strings not text cause they have to be run through my function to convert the %C to the players class etc.
Here's the implementation (sorry not the second screenshot ><):
gf_def_trs_sub(1001,"Ferocity","Increases the %C's strength by %R1/2/3/4/5/%.","Assets\\Textures\\ui_tip_questionmark.dds",5,1);gf_def_trs_sub(1002,"Ferocity II","Increases the %C's strength by %R1/2/3/4/%.","Assets\\Textures\\ui_tip_questionmark.dds",4,2);gf_def_trs_sub(1003,"Guile","Increases the %C's agility by %R1/2/3/4/5/%.","Assets\\Textures\\ui_tip_questionmark.dds",5,1);gf_def_trs_sub(1004,"Guile II","Increases the %C's agility by %R1/2/3/4/%.","Assets\\Textures\\ui_tip_questionmark.dds",4,2);gf_def_trs_sub(1005,"Expertise","Increases the %C's Dexterity by %R1/2/3/4/5/%.","Assets\\Textures\\ui_tip_questionmark.dds",5,1);gf_def_trs_sub(1006,"Expertise II","Increases the %C's Dexterity by %R1/2/3/4/%.","Assets\\Textures\\ui_tip_questionmark.dds",4,2);gf_def_trs_sub(1007,"Acumen","Increases the %C's Intelligence by %R1/2/3/4/5/%.","Assets\\Textures\\ui_tip_questionmark.dds",5,1);gf_def_trs_sub(1008,"Acumen II","Increases the %C's Intelligence by %R1/2/3/4/%.","Assets\\Textures\\ui_tip_questionmark.dds",4,2);gf_def_trs_sub(1009,"Insight","Increases the %C's Wisdom by %R1/2/3/4/5/%.","Assets\\Textures\\ui_tip_questionmark.dds",5,1);gf_def_trs_sub(1010,"Insight II","Increases the %C's Wisdom by %R1/2/3/4/%.","Assets\\Textures\\ui_tip_questionmark.dds",4,2);gf_def_trs_sub(1011,"Tenacity","Increases the %C's Stamina by %R1/2/3/4/5/%.","Assets\\Textures\\ui_tip_questionmark.dds",5,1);gf_def_trs_sub(1012,"Tenacity II","Increases the %C's Stamina by %R1/2/3/4/%.","Assets\\Textures\\ui_tip_questionmark.dds",4,2);
You should be able to use StringExternal to store and access text values; however I did not find a possibility to just add a text to the text editor (maybe I am blind tho)
If it indeed should not be possible, you can always add random data objects, which support text entries and access these texts via StringExternal (for example create new dummy buttons and use the Editorsuffix for your descriptions or something)
Maybe there is a possibility to just add a text, in this case it becomes a lot easier, of course.
Looks to me like the data table uses a key sort of structure. Its not exactly what I expected. I would try to go with what Kueken said for the descriptions. I'm currently working on a simple encoder that will hopefully give you some ideas, will post it up when its done. Rather than store all the information into data tables, How I would do it is store it in a string array or record instead (which is basically a struct). Encode then decode it later. Instead of using ID, you can just index your traits.
string [209] traitInfo;
Creates an array with 209 spaces for you to store your trait strings.
Ok, I'm trying to convert what you said from galaxy script to something I can actually use in the editor I think I found most of what you were saying and can create my function.
Edit: oh ok, well I'll keep at it then :x
The original idea was to store it as a record (struct) but I wasn't sure if storing it in the data table was a better way.
As far as I know the data table is the same method that the game stores data for units etc, like when you read the data table it reads it as a catalog like it would a unit or ability. (I think at least)
Basically I'm looking for the best way to store large amounts of read-only data.
Just press spacebar to test it out for the file attached. It will set the string then print out the strings. I've tried to make it as simple as possible for your understanding. Used the GUI (Although frankly i hate it, all that clicking just to use a SubString function, blarrgghhh)
For the encoder, its pretty straightforward, just have a function that accepts the values, encodes the string, the stores it into the string array of your choice.
For the decoder, I declared a few variables, you don't actually need them. You just need the decoder function to return the last string that was decoded, so 1 local string variable is enough. Decode the string 4 times in succession and your data is basically split into 5 parts. So just slot the 5 parts in where you need em. :)
edit: you might want to just use "|" as your delimiter, its simpler. I just used "[]" for illustration purposes
Heres the sample debugger output:
00:00:01.06SetString00:00:01.06Runninggt_SetString_Func(Event:TriggerDebug/EventPlayerKeyPressed)00:00:01.06Ferocity[]Increasesthe%C's strength by %R1/2/3/4/5/%.[]ui_tip_questionmark[]5[]100:00:01.06 Ferocity00:00:01.06 Increases the %C'sstrengthby%R1/2/3/4/5/%.[]ui_tip_questionmark[]5[]100:00:01.06Runninggt_GetString_Func(Event:TriggerDebug/EventPlayerKeyPressed)00:00:04.19Increasesthe%C's strength by %R1/2/3/4/5/%.[]ui_tip_questionmark[]5[]100:00:04.19 Increases the %C'sstrengthby%R1/2/3/4/5/%.00:00:04.19ui_tip_questionmark[]5[]100:00:04.19Runninggt_GetString_Func(Event:TriggerDebug/EventPlayerKeyPressed)00:00:13.19ui_tip_questionmark[]5[]100:00:13.19ui_tip_questionmark00:00:13.195[]100:00:13.19Runninggt_GetString_Func(Event:TriggerDebug/EventPlayerKeyPressed)00:00:15.635[]100:00:15.63500:00:15.63100:00:15.63Runninggt_GetString_Func(Event:TriggerDebug/EventPlayerKeyPressed)
I think I see what it's doing but I think its generating it in a strange way like its putting in [] instead of containing the data in the [] its using [] as a delimator but I get it... I think lol.
Well good luck mate, time for me to hit the sack, look forward to hear how it turns out :) I might not have net the next week or so, but if I can drop by to see if theres any troubles, I will.
One more important thing, copy the trait information string OUT of the trait information array before passing it to the decoder, cos the decoder is going to break it apart, you don't want that happening to the data in your trait information array or is no going to be there anymore should you try to access it again.
If you want to create a large-scale project, I highly suggest you learn scripting.
You can optimize all functions and arrange your data in a lot more efficient way.
What kind of limit in script size is it? Does it get converted fine into galaxy code, but the resulting code refuses to run when loading the map?
I'm just asking because you could potentially reduce the size of your MapScript.galaxy file by around 40%, with a little program/script to strip everything that isn't necessary and renaming all variables to 2-3 letters. It's not entirely clear if that would solve your problem though.
Btw.. with reference to your second screenshot in post 3, I can see further potential for optimization. It is possible for you to loop all those actions, but you will need to store some information into a record/struct with the following architecture
Quote:
For [Fighter] as index [1] with trait [4020] at [6],[1] requiring level [1] and trait [0]
Lets simplify this to:
Quote:
For [A] as index [B] with trait [C] at [D],[E] requiring level [F] and trait [G]
A and B can both be looped, Where A becomes the record identifier. and B is looped according to the string length of D,E,F or G within the struct below
struct classes{
int traitCount; / /Number of traits for this class
string traitList; / /Encode the list of traits here with a delimiter
string D; / /A string of all the locations of where the traits go
string E; / /Same as D
string F; / /Level string
string G; / /Trait requirement string
};
classes[X] classInfo; Declares the struct
X is the number of classes (A) you have
To write data into the record, just create a function that allows you to save data. In order to copy data into your record, the syntax is as follows (I'm sorry, I'm not sure how to do it in GUI as I don't have access to the API right now, hopefully someone else might be able to help)
To pull the data out, just call classInfo[A].D, then just decode it as what was done before
Same goes for the rest of the inputs to your functions. After that, Just loop all classes class by the number of traits inside it.
This should shave the length of your generated code quite a bit.
for A = 1 : Number of classes
for B = 1 : Number of traits for class (You should be able to get this value by indexing classInfo[A].traitCount)
Run action where you apply trait to the different locations using the information in the record
end
end
Hope this makes sense.. I understand its very vague as I don't have the time to fill in all the details right now.
I was thinking of doing that actually, I also had an idea. From looking at stringexternal would it be possible to define a large one of those and parse it into data inputs? I recently modified some of my data storage for traits removing the X and Y component of how I saved the positions of traits into 5 universal sets depending on how the classes trait tree is displayed and how many actual traits there are.
Right now my problem is not that gui generates bad code really from the looks of it its mostly fine as I use a lot of custom stuff and barely anything built in, I just prefer having to not worry about typos as I tend to typo a LOT when trying to write script "manually." The problem I am having is I have a large database of items/abilities that I have to load within the script rather than by some other means thus taking up huge amounts of the script size limit.
StringExternal returns a text variable, so no parsing can be done. Should say TextExternal...
I don't know if creating structs wouldn't be counterproductive. DataTables don't take up additional memory, but structs and all contained variables do. The string literals would eat memory one way or another, so staying with a DataTable is probably more memory conservative.
If im understanding correctly, data tables use some sort of "key" in a similar way to how JASS handles keys right? By reading his GUI trigger it appears as if each variable is assigned to a string?
What makes data tables so special in that they don't eat up additional memory? I'd like to understand how it handles memory as opposed to using records/structs. Also, we're talking about memory in the context of the 2 MB variable limit that i've read about here and there right?
Oh and uh, How do I declare a data table in Galaxy? Assuming there is a need to do so.
Looks like its time to do some further optimization on my projects when I get hands on on the editor again.
According to s3rius' statement, rather than using a struct with a string inside. Come to think of it, using the data table would be an even better solution as you don't need to index the struct at all.
DataTableSetString(true, "4020", s); / / Where 4020 is the name of the key which doubles up as your trait ID.
As long as the name of the key is unique, you shouldn't have to worry about it. If I'm not mistaken as well, should need be, its possible to have a String Key and Int Key in the same data table without them overriding each other (right s3rius?)
Where s is of course the string with the encoded trait information.
I think I have built a better version of my save now using your idea what I plan to do is something like this:
for [class] store [trait] as [index], I could probably even remove the index and have that created automatically. Maybe using getword I could do like:
1 4012 1 4013 1 4014 where 1 is the class and the 4 digit number is the trait... I could store that entire thing as one string.
The data table entry would look like TRT1.0 with 4012 as the value TRT1.1 = 4013. Yeah I think I like that...
Since my trees are really structured into tiers and the prereq's are the tier before and each tier can be auto assigned a level req I really just need to put in what the trait and index are the rest I think can be automated based on the class and its trait tree structure. I prolly will use the data table still cause yeah thats what I thought about them that they dont count as variables.
Now I just need to figure out a way to store the descriptions better, curse you no text to string!!!!
Edit: ugh now I just have to redo all 260 trait tree entries :(
I fixed part of it by removing starcode lib but it couldn't have taken up too much space (I stopped needing to use it).
I think it may be because I have a lot of data table saves for my trait trees, about 250 entries each with a description saved as a string. The string has to be parsed to replace like %C with class %R with race %G with gender specific stuff etc etc so I cant store it as text.
Is there a better way to do this? I'm pretty much using the GUI editor entirely as I don't really know how to hardcode this stuff very well.
Edit: This is a massive project I've been working on for months and there's a LOT of stuff in it. Part of the problem is that since I have to create a lot of data table entries for items and traits I have a large portion of code devoted to defining those things. Theyre static values that are simply read and don't change. Is there a better way to handle them? I don't think we can create custom catalogs to use for referencing but that sure would be nice.
Edit 2: Currently theres 13869 lines of code. My uncompressed trigger size is 8.85 MB compressed is 1.45mb 4931 actions 3414 function calls 873 variables 1313 conditions 75 triggers (working on lowering triggers) Do comments count? I have a lot of comments I use to keep myself on track.
@Sneakervek: Go
How are you currently structuring your data tables? Its not very clear to me without a screenshot. If im interpreting this right, you have 1 data table for each trait tree (how many trait trees to you have?)? and each trait tree has 250 entries? If you could provide more detail on how your descriptions are saved, (specifically a sample string) I might be able to suggest a way you can optimize the way your strings are stored. I've got something off the top of my head but I don't know whether it'll work for your scenario.
Edit: Um.. you haven't answered my question? Can you post a sample of the string you are saving?Btw..
I think you mean scripting with galaxy right? Cos hard coding is actually a very bad thing to do when you're programming, its often inefficient because it doesn't make use of code reuse.
Theres 22 classes with 13-16 traits in their trees.
Theres 209 total traits defined like this:
Using ID#[1001] create a Trait named "Ferocity" showing image "Assets\Textures\ui_tip_questionmark.dds" with a Max Rank of [5] costing [1] per rank and a description of "Increases the %C's strength by %R1/2/3/4/5/%.".
Theyre then formed into the trees (since some get reused) here:
In-game shot of the current version:
Ok.. I'm really horrible with GUI, but if im understanding this correct, your first screenshot shows a function that basically stores your trait data into a record/table right?The second screenshot, the "For A as index B set trait C etc etc" is another function that connects the traits to your character trees right? Could I take a look at that function as well?Could you try this, copy the code from just the first screenshot into a new map, press CTRL+F11, copy the script and paste it here? I code in Galaxy so It might help me get a heads up on how the game engine is compiling your code. And from there maybe we can work something out
Ignore the text above, im processing your updated information.Edit: Assuming here each character in the string uses up some memory, you could save a lot by changing
Thats 20 characters * 209 shaved, about 4020 characters.
On further speculation, You may be able to do without the LABEL variable, assuming data tables automatically store your data into index 1001, though i can't say for certain, i need to see the code first.
Heres how i would store your data, you have 6 parameters
Think of a character that you won't be using in your strings, use it as a delimiter, Iets just use [ ] square brackets as an example. I encode your data into a single string
s = [Ferocity][Increases the %C's strength by %R1/2/3/4/5/%.][ui_tip_questionmark][5][1];
When you want to decode the data later, I just use StringFind("[]") To search for the index of the delimiter, Extract the strings you need, then populate the trait tree.
The decoder function: string decode(string s); Returns the first string preceding your delimiter, in this case []
Once StringFind() returns a -1, it means you've reached the end of the string, so you would know for sure that is your cost per rank data.
The advantage of this is that instead of 209 x 5 variables, you instead have 209 variables. This should cut memory allocation to about 1/5th of what you're currently using.
Hope this helps solve your problem.
@FuzzYD: Go
I definitely think the image storing part is a good way to cut down on code, I will do that for sure. What about descriptions tho? Isn't there a way to use string external or something to store those outside of the code?
I just have to make sure I retrieve the descriptions as strings not text cause they have to be run through my function to convert the %C to the players class etc.
Here's the first screenshot:
Here's the implementation (sorry not the second screenshot ><):
You should be able to use StringExternal to store and access text values; however I did not find a possibility to just add a text to the text editor (maybe I am blind tho)
If it indeed should not be possible, you can always add random data objects, which support text entries and access these texts via StringExternal (for example create new dummy buttons and use the Editorsuffix for your descriptions or something)
Maybe there is a possibility to just add a text, in this case it becomes a lot easier, of course.
@Sneakervek: Go
Looks to me like the data table uses a key sort of structure. Its not exactly what I expected. I would try to go with what Kueken said for the descriptions. I'm currently working on a simple encoder that will hopefully give you some ideas, will post it up when its done. Rather than store all the information into data tables, How I would do it is store it in a string array or record instead (which is basically a struct). Encode then decode it later. Instead of using ID, you can just index your traits.
string [209] traitInfo;
@FuzzYD: Go
Ok, I'm trying to convert what you said from galaxy script to something I can actually use in the editor I think I found most of what you were saying and can create my function.
Edit: oh ok, well I'll keep at it then :x
The original idea was to store it as a record (struct) but I wasn't sure if storing it in the data table was a better way.
As far as I know the data table is the same method that the game stores data for units etc, like when you read the data table it reads it as a catalog like it would a unit or ability. (I think at least)
Basically I'm looking for the best way to store large amounts of read-only data.
Done, Encoder and Decoder functions.
Just press spacebar to test it out for the file attached. It will set the string then print out the strings. I've tried to make it as simple as possible for your understanding. Used the GUI (Although frankly i hate it, all that clicking just to use a SubString function, blarrgghhh)
For the encoder, its pretty straightforward, just have a function that accepts the values, encodes the string, the stores it into the string array of your choice.
For the decoder, I declared a few variables, you don't actually need them. You just need the decoder function to return the last string that was decoded, so 1 local string variable is enough. Decode the string 4 times in succession and your data is basically split into 5 parts. So just slot the 5 parts in where you need em. :)
edit: you might want to just use "|" as your delimiter, its simpler. I just used "[]" for illustration purposes
Heres the sample debugger output:
@FuzzYD: Go
I think I see what it's doing but I think its generating it in a strange way like its putting in [] instead of containing the data in the [] its using [] as a delimator but I get it... I think lol.
@Sneakervek: Go
Well good luck mate, time for me to hit the sack, look forward to hear how it turns out :) I might not have net the next week or so, but if I can drop by to see if theres any troubles, I will.
One more important thing, copy the trait information string OUT of the trait information array before passing it to the decoder, cos the decoder is going to break it apart, you don't want that happening to the data in your trait information array or is no going to be there anymore should you try to access it again.
Are you using any large GUI loops? GUI loops duplicate all their contents twice (with nested loops it's even worse).
@SexLethal: Go
I use whiles where I use loops, not fors. And most of these definitions are not looped. There's simply 209 different entries each one unique.
If you want to create a large-scale project, I highly suggest you learn scripting. You can optimize all functions and arrange your data in a lot more efficient way.
What kind of limit in script size is it? Does it get converted fine into galaxy code, but the resulting code refuses to run when loading the map?
I'm just asking because you could potentially reduce the size of your MapScript.galaxy file by around 40%, with a little program/script to strip everything that isn't necessary and renaming all variables to 2-3 letters. It's not entirely clear if that would solve your problem though.
@Sneakervek: Go
Btw.. with reference to your second screenshot in post 3, I can see further potential for optimization. It is possible for you to loop all those actions, but you will need to store some information into a record/struct with the following architecture
Lets simplify this to:
struct classes{
};
To write data into the record, just create a function that allows you to save data. In order to copy data into your record, the syntax is as follows (I'm sorry, I'm not sure how to do it in GUI as I don't have access to the API right now, hopefully someone else might be able to help)
classInfo[A].D = "6|4|6|8|3|5|7|9|2|4|6|8|10|8|6|8";
To pull the data out, just call classInfo[A].D, then just decode it as what was done before
Same goes for the rest of the inputs to your functions. After that, Just loop all classes class by the number of traits inside it. This should shave the length of your generated code quite a bit.
Hope this makes sense.. I understand its very vague as I don't have the time to fill in all the details right now.
@FuzzYD: Go
I was thinking of doing that actually, I also had an idea. From looking at stringexternal would it be possible to define a large one of those and parse it into data inputs? I recently modified some of my data storage for traits removing the X and Y component of how I saved the positions of traits into 5 universal sets depending on how the classes trait tree is displayed and how many actual traits there are.
@StragusMapster: Go
Right now my problem is not that gui generates bad code really from the looks of it its mostly fine as I use a lot of custom stuff and barely anything built in, I just prefer having to not worry about typos as I tend to typo a LOT when trying to write script "manually." The problem I am having is I have a large database of items/abilities that I have to load within the script rather than by some other means thus taking up huge amounts of the script size limit.
@Sneakervek: Go
StringExternal returns a text variable, so no parsing can be done. Should say TextExternal...
I don't know if creating structs wouldn't be counterproductive. DataTables don't take up additional memory, but structs and all contained variables do. The string literals would eat memory one way or another, so staying with a DataTable is probably more memory conservative.
@s3rius: Go
If im understanding correctly, data tables use some sort of "key" in a similar way to how JASS handles keys right? By reading his GUI trigger it appears as if each variable is assigned to a string?
What makes data tables so special in that they don't eat up additional memory? I'd like to understand how it handles memory as opposed to using records/structs. Also, we're talking about memory in the context of the 2 MB variable limit that i've read about here and there right?
Oh and uh, How do I declare a data table in Galaxy? Assuming there is a need to do so.
Looks like its time to do some further optimization on my projects when I get hands on on the editor again.
@Sneakervek: Go
According to s3rius' statement, rather than using a struct with a string inside. Come to think of it, using the data table would be an even better solution as you don't need to index the struct at all.
DataTableSetString(true, "4020", s); / / Where 4020 is the name of the key which doubles up as your trait ID.
As long as the name of the key is unique, you shouldn't have to worry about it. If I'm not mistaken as well, should need be, its possible to have a String Key and Int Key in the same data table without them overriding each other (right s3rius?)
Where s is of course the string with the encoded trait information.
@s3rius: Go
Awww, I was REALLY hoping that was storing them as strings. So sad inside now.
@FuzzYD: Go
I think I have built a better version of my save now using your idea what I plan to do is something like this:
for [class] store [trait] as [index], I could probably even remove the index and have that created automatically. Maybe using getword I could do like:
1 4012 1 4013 1 4014 where 1 is the class and the 4 digit number is the trait... I could store that entire thing as one string.
The data table entry would look like TRT1.0 with 4012 as the value TRT1.1 = 4013. Yeah I think I like that...
Since my trees are really structured into tiers and the prereq's are the tier before and each tier can be auto assigned a level req I really just need to put in what the trait and index are the rest I think can be automated based on the class and its trait tree structure. I prolly will use the data table still cause yeah thats what I thought about them that they dont count as variables.
Now I just need to figure out a way to store the descriptions better, curse you no text to string!!!!
Edit: ugh now I just have to redo all 260 trait tree entries :(