Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   How would I call a const string list to display on screen? (http://forum.fulqrumpublishing.com/showthread.php?t=30901)

hc_wolf 04-04-2012 02:31 AM

How would I call a const string list to display on screen?
 
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?

Code:

    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
Code:

Objective_Total_Blue += (Objective_P);]
So when I want to display the accumulated list onscreen string " Objective_Total_Blue = ""; " How do I do it?
Code:

                        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):
Code:

Objective_Total_Blue += Objective_P;
To show the strings use:
Code:

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


All times are GMT. The time now is 02:57 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.