Frictional Games Forum (read-only)

Full Version: I can't randomize my loading screen entries..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. well here is my problem, i've made a loading screen and i added a picture and some text

but I cant get it to ramdomize between several texts so it will allways show only 1 text

here is the scripting..


The .hps file
void OnStart()
{
SetEntityPlayerInteractCallback("WindowForest", "Level_WindowForest", false);
SetEntityPlayerLookAtCallback("WindowForest", "ForestText", false);
}

void Level_WindowForest(string &in asEntity)

{
ChangeMap("Forest", "PlayerStartArea_3", "", "");
SetupLoadScreen("LoadingText", "Forest_", 2, "Dark_Forest2.jpg");
}

The .lang file


The Forest is dark and cold
Underneath the shadows in the withered forest secrets are buried


In the loading screen the only text that appears is the Forest_01

Please help Big Grin
Instead of using the function's random, maybe you could just create a random int variable named something like "i".

Generate a random number and store the value in "i".

then it should look like

void Level_WindowForest(string &in asEntity)

{
int i = RandInt(1, 2);
ChangeMap("Forest", "PlayerStartArea_3", "", "");
SetupLoadScreen("LoadingText", "Forest_0"+i, 0, "Dark_Forest2.jpg");

}

Wait, how exactly is your .lang file set up. XML format and all?
(04-29-2012, 03:10 PM)FragdaddyXXL Wrote: [ -> ]Instead of using the function's random, maybe you could just create a random int variable named something like "i".

Generate a random number and store the value in "i".

then it should look like

void Level_WindowForest(string &in asEntity)

{
int i = RandInt(1, 2);
ChangeMap("Forest", "PlayerStartArea_3", "", "");
SetupLoadScreen("LoadingText", "Forest_0"+i, 0, "Dark_Forest2.jpg");

}

Wait, how exactly is your .lang file set up. XML format and all?
Oh it worked many thanks man Big Grin

and yea my .lang is XML Smile