Frictional Games Forum (read-only)

Full Version: Script causing game to randomly crash (No FATAL ERROR)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Try this

Code:
void OnStart()
{
if(ScriptDebugOn());
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100);
}
AddEntityCollideCallback("Player", "BruteWalkAway", "ActivateBrute", true, 1);
AddEntityCollideCallback("servant_brute_1", "Disappear", "FadeEnemy", true, 1);
}

void ActivateBrute(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddTimer("Freeze", 2.0f, "FreezePlayer");
SetLightVisible("torch_static01_6", false);
SetLightVisible("torch_static01_7", false);
SetLightVisible("torch_static01_8", false);
SetLightVisible("torch_static01_9", false);
SetLightVisible("torch_static01_10", false);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.5f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.5f, "");

}

void FreezePlayer(string &in asTimer)
{
SetPlayerActive(false);
StartPlayerLookAt("servant_brute_1", "", "", "");
AddTimer("Look", 5.0f, "LookAt");
}

void LookAt(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

void FadeEnemy(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_brute_1", false);
}
May I ask what you guys changed? Tongue
Semi-colon after the script de-bug.

I had the same problem a while ago, and that fixed it for me.

Did I fix it for you?
Oh wow, I was putting it all in the wrong script...
I will re-try both of them...
Nope not working...

Anything else?
Bumpsssssssssssssss
Is my question literally impossible to fix???
.... HELP MEEEE
Code:
void OnStart()
{
    if(ScriptDebugOn())
    {
        GiveItemFromFile("lantern", "lantern.ent");
        SetPlayerLampOil(100);
    }
    
    AddEntityCollideCallback("Player", "BruteWalkAway", "ActivateBrute", true, 1);
    AddEntityCollideCallback("servant_brute_1", "Disappear", "FadeEnemy", true, 1);
}

void ActivateBrute(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("servant_brute_1", true);
    AddTimer("Freeze", 2.0f, "FreezePlayer");
    SetLightVisible("torch_static01_6", false);
    SetLightVisible("torch_static01_7", false);
    SetLightVisible("torch_static01_8", false);
    SetLightVisible("torch_static01_9", false);
    SetLightVisible("torch_static01_10", false);
    AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.5f, "");
    AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.5f, "");
}

void FreezePlayer(string &in asTimer)
{
    SetPlayerActive(false);
    StartPlayerLookAt("servant_brute_1", 5, 10, "");
    AddTimer("Look", 5.0f, "LookAt");
}

void LookAt(string &in asTimer)
{
    StopPlayerLookAt();
    SetPlayerActive(true);
}

void FadeEnemy(string &in asParent, string &in asChild, int alState)
{
    FadeEnemyToSmoke("servant_brute_1", false);
}

>_>
(09-09-2011, 03:48 AM)Your Computer Wrote: [ -> ]
Code:
void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100);
}

AddEntityCollideCallback("Player", "BruteWalkAway", "ActivateBrute", true, 1);
AddEntityCollideCallback("servant_brute_1", "Disappear", "FadeEnemy", true, 1);
}

void ActivateBrute(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddTimer("Freeze", 2.0f, "FreezePlayer");
SetLightVisible("torch_static01_6", false);
SetLightVisible("torch_static01_7", false);
SetLightVisible("torch_static01_8", false);
SetLightVisible("torch_static01_9", false);
SetLightVisible("torch_static01_10", false);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.5f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.5f, "");
}

void FreezePlayer(string &in asTimer)
{
SetPlayerActive(false);
StartPlayerLookAt("servant_brute_1", 5, 10, "");
AddTimer("Look", 5.0f, "LookAt");
}

void LookAt(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

void FadeEnemy(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_brute_1", false);
}

>_>
-asplodes-

THANK YOU.

Just wondering, what did you change?

Also getting a new crash, but this time it should be an easily fixable FATAL ERROR script crash...

I can't remember it exactly, but its something like this..


(1,1) something about OnEnter()
(1,1) something about Activation(string@)
and some other line I forgot, I will have to play through again today.

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1, "Credits", true, 1);
}

void Credits(string &in asParent, string &in asChild, int alState)
{
StartCredits("", false, "Ending", "StartCredits", 4);
}

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14