Frictional Games Forum (read-only)

Full Version: Timer Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the beginning of a custom story im making will be a cut scene that brings up text on the screen which is explaining the story, then changes the map, but the only thing that comes up is the first line, here is what i got.



void OnStart()
{

}

void OnEnter()
{
PlayMusic("10_paper_daniel01", true, 1.3f, 0.0f, 5, true);
SetPlayerActive(false);
SetMessage("PersonalThoughts", "intro-a", 3);
AddTimer("movea",4.0f,"MessageB");
}

void OnLeave()
{

}

void MessageB(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-b", 3);
AddTimer("moveb",4.0f,"MessageC");
}

void MessageC(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-c", 3);
AddTimer("movec",4.0f,"MessageD");
}

void MessageD(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-d", 3);
AddTimer("moved",4.0f,"MessageE");
}

void MessageE(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-e", 3);
AddTimer("movee",4.0f,"MessageF");
}

void MessageF(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-f", 3);
AddTimer("movef",4.0f,"MessageG");
}

void MessageG(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-g", 3);
AddTimer("moveg",4.0f,"Change");
}

void Change(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound)
{
ChangeMap("S-1.map", "PlayerStartArea_1", "", "");
}

(12-27-2011, 06:05 AM)NoMaD923 Wrote: [ -> ]In the beginning of a custom story im making will be a cut scene that brings up text on the screen which is explaining the story, then changes the map, but the only thing that comes up is the first line, here is what i got.



void OnStart()
{

}

void OnEnter()
{
PlayMusic("10_paper_daniel01", true, 1.3f, 0.0f, 5, true);
SetPlayerActive(false);
SetMessage("PersonalThoughts", "intro-a", 3);
AddTimer("movea",4.0f,"MessageB");
}

void OnLeave()
{

}

void MessageB(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-b", 3);
AddTimer("moveb",4.0f,"MessageC");
}

void MessageC(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-c", 3);
AddTimer("movec",4.0f,"MessageD");
}

void MessageD(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-d", 3);
AddTimer("moved",4.0f,"MessageE");
}

void MessageE(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-e", 3);
AddTimer("movee",4.0f,"MessageF");
}

void MessageF(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-f", 3);
AddTimer("movef",4.0f,"MessageG");
}

void MessageG(string& asTextCategory, string& asTextEntry, float afTime)
{
SetMessage("PersonalThoughts", "intro-g", 3);
AddTimer("moveg",4.0f,"Change");
}

void Change(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound)
{
ChangeMap("S-1.map", "PlayerStartArea_1", "", "");
}

The bolded statements are the incorrect syntax. You are putting in what the wiki is telling you that gives that function its abilities. A function that has a callback in it, such as AddTimer, has a seperate syntax.

To fix your issue, all of the bolded statements should be replaced with: (string &in asTimer)