Frictional Games Forum (read-only)
Force Credits Help! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Force Credits Help! (/thread-9912.html)



Force Credits Help! - JetlinerX - 08-22-2011

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 ()
{

}



RE: Force Credits Help! - Obliviator27 - 08-22-2011

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.


RE: Force Credits Help! - JetlinerX - 08-22-2011

No, the perimeters are right, because they work if they are in the other function, but what is the callback for starting credits?


RE: Force Credits Help! - Obliviator27 - 08-22-2011

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.


RE: Force Credits Help! - JetlinerX - 08-22-2011

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...


RE: Force Credits Help! - Obliviator27 - 08-22-2011

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.


RE: Force Credits Help! - JetlinerX - 08-22-2011

(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!