Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Timer Problems
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#1
Timer Problems

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", "", "");
}


[Image: qg_logo.png]
(This post was last modified: 12-27-2011, 06:47 AM by Nomad923.)
12-27-2011, 06:05 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Timer Problems

(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)
(This post was last modified: 12-27-2011, 07:13 AM by Statyk.)
12-27-2011, 07:11 AM
Find




Users browsing this thread: 1 Guest(s)