Strings in arrays
Posted: Sat Jul 27, 2013 2:07 pm
I am trying to make a reporting system in our game, that would take random phrases from different arrays setup to store situational responses and reporting (such as loss of something, frontline advance, etc.) and possibly modify parts of them by changing single words from the base phrases so that it doesn't end up being monotone. Some stuff such as names etc would also be stored in these arrays.
I'm having a problem with arrays and strings; I've tried a coupple of methods I googled and dug up from the forum but none seem to work or print out anything. I guess I'm missing out something important in handling string arrays in C and GEscript.
I've tried making the arrays
And
What is a good way to store arrays/print them out later in GEscript? Also, how can I do a console-like printing output (so that it adds a newline then prints a new row of text after the previous row.)
I'm having a problem with arrays and strings; I've tried a coupple of methods I googled and dug up from the forum but none seem to work or print out anything. I guess I'm missing out something important in handling string arrays in C and GEscript.
I've tried making the arrays
- Code: Select all
const char *cmdnames;[20]
cmdnames[0] = "Lieutenant Powell";
cmdnames[1] = "Sergeant Mason";
And
- Code: Select all
char cmdnames[20][15];
strcpy(cmdnames[0], "Lieutenant Powell";
strcpy(cmdnames[1], "Sergeant Mason";
What is a good way to store arrays/print them out later in GEscript? Also, how can I do a console-like printing output (so that it adds a newline then prints a new row of text after the previous row.)