Frictional Games Forum (read-only)

Full Version: Force Credits Help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all-

Just wondering how I can get the credits to start rolling on my script, it seems all it does is fade to black and you hear Danial breathing, but I need the credits to start rolling when its faded out. Here is my script:

Code:
void OnEnter ()
{
        AddEntityCollideCallback("Player", "ScriptArea_1", "FirstScriptArea", true, 1);
        AddEntityCollideCallback("Player", "ScriptArea_2", "SecondScriptArea", true, 1);
        AddEntityCollideCallback("Player", "ScriptArea_3", "ThirdScriptArea", true, 1);
        AddEntityCollideCallback("Player", "ScriptArea_4", "LastScriptArea", true, 1);
}
void FirstScriptArea(string &in asParent, string &in asChild, int alState)
{
        SetMessage("Messages", "DerrekMother", 0);
        SetPlayerMoveSpeedMul(0.5f);
        SetPlayerJumpDisabled(true);
        SetPlayerCrouchDisabled(true);
        PlayMusic("EndFile1.ogg", false, 20, 0, 0, true);
}
void SecondScriptArea(string &in asParent, string &in asChild, int alState)
{
        StartEffectFlash(0.1f, 1.0f, 0.1f);
        SetEntityActive("ScriptArea_4", true);
        SetEntityActive("armour_nice_complete_4", true);
        SetEntityActive("armour_nice_complete_5", true);
        SetEntityActive("armour_nice_complete_6", true);
        SetEntityActive("armour_nice_complete_3", false);
        SetEntityActive("armour_nice_complete_1", false);
        SetEntityActive("armour_nice_complete_2", false);
}
void ThirdScriptArea(string &in asParent, string &in asChild, int alState)
{
        AddPropHealth("final_door", -100);
        PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
        GiveSanityDamage(100, true);
        AddPlayerBodyForce(-55000, 25000, 0, false);
        FadePlayerRollTo(75, 5, 2);
        StartPlayerLookAt("display_1", 10, 10, "");
        SetPlayerCrouching(true);
        GivePlayerDamage(10, "BloodSplat", false, false);
        PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
}
void LastScriptArea(string &in asParent, string &in asChild, int alState)
{
        FadePlayerRollTo(75, 5, 2);
        StartPlayerLookAt("display_1", 10, 10, "");
        SetPlayerCrouching(true);
        PlayMusic("EndFile2.ogg", false, 20, 0, 0, true);
        FadeOut(5);
}
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
{
        StartCredits("THEATTICSONG.ogg" , true , "Endcredits" , "Credittext" , 1);
}
void OnLeave ()
{

}
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
{
StartCredits("THEATTICSONG.ogg" , true , "Endcredits" , "Credittext" , 1);
}

You lack a function that calls this callback, as well as using the function parameters incorrectly.
No, the perimeters are right, because they work if they are in the other function, but what is the callback for starting credits?
No, I mean, you need something along the lines of

AddEntityCollideCallback("Player", "CreditArea", "StartCredits", 1, true);

void StartCredits(string &in asParent, string &in asChild, int alState)
{
StartCredits("THEATTICSONG.ogg", true, "Endcredits", "Credittext", 1);
}

But perhaps I'm wrong. I've not played around with the credits as of yet. It's just what I see.
Dang it! Is there any way to do it at the end of the fade? I dont really want the player to get up and have to walk into another area...
Try adding in StartCredits(); in LastScriptArea. I'm not sure if it'll work for sure, though.
Also, change it up to void StartCredits()

This is all guesswork, though.
(08-22-2011, 05:46 AM)Obliviator27 Wrote: [ -> ]Try adding in StartCredits(); in LastScriptArea. I'm not sure if it'll work for sure, though.
Also, change it up to void StartCredits()

This is all guesswork, though.

Tested that before (without void) and it starts the credits the second the player enters the area :/

EDIT: Oh DUH! I can use a timer xD

Sorry bout that!