Frictional Games Forum (read-only)

Full Version: Need Help with credits.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok, so I set my credits to its own map and have it so the player will spawn on an area and it will start the credits, anyway here is my script for it:
Spoiler below!
////////////////////////////// Run when entering map
void OnStart()
//OnEnter
{
AddEntityCollideCallback("Player", "ending_area", "StartCredits", true, 1);
}
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum)
{
StartCredits("05_paper_transformation.ogg", true, "Ending", "MainCredits", "1");
}

// Run when leaving map
void OnLeave()
{

}

also, the error message I'm receiving when the game crashes is this:
Spoiler below!
main (7,1) : ERR : A function with the same name and parameters already exist
main (9,2) :ERR: No matching signatures to 'StartCredits(string@&, constbool, string@&, string@&, string@&)'

If you need anymore information, just tell me, and thanks for any help in advance.
Code:
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum)


should be:

Code:
void StartCredits(string &in asParent, string &in asChild, int alState)

(10-17-2011, 09:46 PM)schmupper Wrote: [ -> ]
Code:
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum)


should be:

Code:
void StartCredits(string &in asParent, string &in asChild, int alState)
That seemed to work for the first error, but I'm still getting the second error in (9,2).
(10-18-2011, 08:46 PM)A Tricky Carnie Wrote: [ -> ]That seemed to work for the first error, but I'm still getting the second error in (9,2).

For the HPL2 StartCredits function, you're supposed to provide an integer for the last parameter, not a string.
(10-18-2011, 09:04 PM)Your Computer Wrote: [ -> ]
(10-18-2011, 08:46 PM)A Tricky Carnie Wrote: [ -> ]That seemed to work for the first error, but I'm still getting the second error in (9,2).

For the HPL2 StartCredits function, you're supposed to provide an integer for the last parameter, not a string.
so I should change the last @&string to a @&int?
(10-18-2011, 09:08 PM)A Tricky Carnie Wrote: [ -> ]so I should change the last @&string to a @&int?

Simply remove the quotation marks around the number 1 from:
Code:
StartCredits("05_paper_transformation.ogg", true, "Ending", "MainCredits", "1");
(10-18-2011, 09:16 PM)Your Computer Wrote: [ -> ]
(10-18-2011, 09:08 PM)A Tricky Carnie Wrote: [ -> ]so I should change the last @&string to a @&int?

Simply remove the quotation marks around the number 1 from:
Code:
StartCredits("05_paper_transformation.ogg", true, "Ending", "MainCredits", "1");
Oh, thanks, didn't realize those didnt belong there.


Hi I'm trying this script atm. but it gives me an error message:

main(198,1) : ERR : Unexpected token '{'


void OnStart()
{
AddEntityCollideCallback("Player", "Ending_Area_1", "StartCredits", true, 1);
}

"197" void StartCredits(string &in asParent, string &in asChild, int alState);
"198" {
"199" StartCredits("05_paper_transformation.ogg", true, "Ending", "MainCredits", 1);
"200" }

Help plox so close to wrapping my custom story up.