I've decided to make my own program to make levels for my SC game. Chances are if I do it right it could be reprogrammed to work for Space Marines or other games.
The following code lets you select a text file and imports that data:
void setup() {
selectInput("Select a file to process:", "fileSelected");
}
void fileSelected(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
} else {
println("User selected " + selection.getAbsolutePath());
}
String lines[] = loadStrings(selection);
println("there are " + lines.length + " lines");
for (int i =0 ; i < lines.length; i++) {
println(lines[i]);
}
}
I think Processing will be perfect since it has a lot of convenient functions for file I/O. And real 2D arrays.
I'm very proud of this latest development. I'm making a mockup of a game concept that will hopefully be complete enough in a couple days for me to submit as a Ludum Dare/Jam entry. What I've done today is I began to port my "grid-nav" engine to Processing, beginning with a way to store levels. I just got a function working which reads files from the sketch data folder line by line. The input is of course the filename to load. Most of the following is borrowed directly from the reference page on createReader().
void loadLevel(String lvl) {
String line;
boolean loop = true;
BufferedReader reader = createReader(lvl);
while (loop) {
try {
line = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
line = null;
}//catch
if (line == null) {
loop = false;
} else {
println(line);
}//if
}//while loop
}