Since SC2 doesn't allow actual file I/O (other than banks), does the API allow any way to read information from a resource as in a text file I added to the map with the Import Manager? Just looking for alternatives to hard-coding database information right into my custom script source code.
You could try using User Types - You set up its fields whatever way you like, then fill out the "instances +" field with all the information you need. I don't know how to use galaxy, so I can't tell you what the script is to read User Type information, someone else will have to do that (or try making a GUI trigger and then switching to raw data, I think that in a lot of cases shows you how the function is writting in galaxy)
User Types are essentially databases. The "Fields +" field allows you to set up the fields - What type of field (Integer/Boolean/Game Link/etc.), how many values it has (i.e. how many array indexes), and whether its modifiable via triggers/galaxy.
You can't reference variables or other trigger-only stuff in User Types though, as its a data thing, but they are useful for storing tons of information. zeldarules and I are using them in our pokemon map for the moves, pokemon, etc. For example, the "Pokemon" User Type has fields like "Name", "Type" and "Moves". In the "Instances+" field I add one instance per pokemon and fill out those fields - Name only has 1 possible value, types has 2 possible simultaneous values (i.e. indexes) and Moves has 100 (to correspond to the level the move is learned on) and its all in one instance, so I guess a instance can be compared to a variable record (Or struct or whatever its called in galaxy)
You can find User Types in the data editor, I think its under the advanced tabs.
As for importing text files, I don't think that's possibly, but I guess you could import a galaxy script in which you define a million variables, but you could just as well just copy+paste that into your galaxy script in the trigger editor anyway. Same goes for XML code for User Types, can write them in a text editor and just copy them into XML view
That sounds sweet! Like a Data Editor but for my own types. Yes, I'll look into that as I think that's exactly what I need. This database information I'm storing is constant, so won't need write access, only read.
The work strings/text work in GUI is that it assigns anything you type to a param/value/identifier=<text>
So, when the game runs, it'll call up this file and replace the text with the param values. I know that the galaxy language uses the same method of referencing files like C+ + does. So, for example, you could make a dialog image with it's path as "C:/ /SC2Test/ /imgpath.dds" (without the spaces in the slashes), and if it's stored on the local hard drive, it will actually pull it up and display it.
With that in mind, perhaps you can manipulate the GameStrings.txt file which houses all the param/values/identifiers, and somehow get it to go back a folder, read a file, and then store that string.
Since SC2 doesn't allow actual file I/O (other than banks), does the API allow any way to read information from a resource as in a text file I added to the map with the Import Manager? Just looking for alternatives to hard-coding database information right into my custom script source code.
@soulzek: Go
You could try using User Types - You set up its fields whatever way you like, then fill out the "instances +" field with all the information you need. I don't know how to use galaxy, so I can't tell you what the script is to read User Type information, someone else will have to do that (or try making a GUI trigger and then switching to raw data, I think that in a lot of cases shows you how the function is writting in galaxy)
User Types are essentially databases. The "Fields +" field allows you to set up the fields - What type of field (Integer/Boolean/Game Link/etc.), how many values it has (i.e. how many array indexes), and whether its modifiable via triggers/galaxy.
You can't reference variables or other trigger-only stuff in User Types though, as its a data thing, but they are useful for storing tons of information. zeldarules and I are using them in our pokemon map for the moves, pokemon, etc. For example, the "Pokemon" User Type has fields like "Name", "Type" and "Moves". In the "Instances+" field I add one instance per pokemon and fill out those fields - Name only has 1 possible value, types has 2 possible simultaneous values (i.e. indexes) and Moves has 100 (to correspond to the level the move is learned on) and its all in one instance, so I guess a instance can be compared to a variable record (Or struct or whatever its called in galaxy)
You can find User Types in the data editor, I think its under the advanced tabs.
As for importing text files, I don't think that's possibly, but I guess you could import a galaxy script in which you define a million variables, but you could just as well just copy+paste that into your galaxy script in the trigger editor anyway. Same goes for XML code for User Types, can write them in a text editor and just copy them into XML view
@TheAlmaity: Go
That sounds sweet! Like a Data Editor but for my own types. Yes, I'll look into that as I think that's exactly what I need. This database information I'm storing is constant, so won't need write access, only read.
@soulzek: Go
The work strings/text work in GUI is that it assigns anything you type to a param/value/identifier=<text>
So, when the game runs, it'll call up this file and replace the text with the param values. I know that the galaxy language uses the same method of referencing files like C+ + does. So, for example, you could make a dialog image with it's path as "C:/ /SC2Test/ /imgpath.dds" (without the spaces in the slashes), and if it's stored on the local hard drive, it will actually pull it up and display it.
With that in mind, perhaps you can manipulate the GameStrings.txt file which houses all the param/values/identifiers, and somehow get it to go back a folder, read a file, and then store that string.