PDA

View Full Version : How would I call a const string list to display on screen?


hc_wolf
04-04-2012, 02:31 AM
Hi,

I am trying to call a list on screen of objectives completed.
Is there a way to call the cost string into a list?


const string Objective_P = " German Supply Tankers Survived,"; //BlueObjective3 Survived
const string Objective_Q = " English Supply Tankers Survived,"; //RedObjective4 Survived
const string Objective_R = " English Supply Tankers Destroyed,"; //BlueObjective5 Destroyed

string Objective_Total_Red = "";
string Objective_Total_Blue = "";


When an objective is completed I add the Objective to the String "string Objective_Total_Blue" like this

Objective_Total_Blue += (Objective_P);]


So when I want to display the accumulated list onscreen string " Objective_Total_Blue = ""; " How do I do it?

GamePlay.gpHUDLogCenter(new Player[] { player }, "Objective_Total_Red ("")": "Objective_Total_Blue("")", new object[] { Objective_Total_Red.ToString(), Objective_Total_Blue.ToString() });

FG28_Kodiak
04-04-2012, 05:02 AM
To Add the string use (the strings should declared global):

Objective_Total_Blue += Objective_P;


To show the strings use:

GamePlay.gpHUDLogCenter(null, "Red Objective Total: {0} :: Blue Objective Total: {1} ", new object[] { Objective_Total_Red, Objective_Total_Blue });


But be aware not every player has a screenresolution of 1920*1080 or higher, so it would be better to show the strings with a timedelay.

hc_wolf
04-04-2012, 05:23 AM
Thanks kodiak, i think I am getting the hang of those now

I have the global string already :) so thats good. Now this string code I am getting the hang of it and can use lots now. thanks.

Will test when i get home, code looks good and should work fine.

Thanks. I will be putting your name in lights for Credit in helping me build this new ATAG mega mission RedvBlue1.0.

2200 lines of coding and no errors feels goooood. :D