Frictional Games Forum (read-only)
Fatal error help please - 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: Fatal error help please (/thread-8862.html)

Pages: 1 2


Fatal error help please - TheDavenia - 06-28-2011

Hey guys when i load my map on Amnesia it gives me this error:

[Image: fatalerror.png]

Here is my maps .hps file:

Code:
void OnStart()
{
AddEntityCollideCallback("korv_foreal", "korven", "BreakDoor", true, 1);
AddUseItemCallback("UseCrowbar", "crowbar_1", "korv_use_crowbar", "UseCrowbar", true);
SetLocalVarInt("CrowbarUsed", 0);
AddEntityCollideCallback("Player", "ScriptArea_1", "RollCredits", true, 1);
AddEntityCollideCallback("Player", "MonsterArea", "Spawn_Monster", true);
}

void UseCrowbar(string &in asItem, string &in asEntity)
{
    SetEntityActive("crowbar_joint_1", true);
    RemoveItem(asItem);
    AddLocalVarInt("CrowbarUsed", 1);
}

void BreakDoor(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("korv_foreal", false);
    SetSwingDoorLocked("korven_door", false, true);
    SetPropHealth("korven_door", 0);
    SetSwingDoorClosed("korven_door", false, false);
    PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false);
    CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
    SetEntityActive("broken_korv", true);
    GiveSanityBoostSmall();
}

void RollCredits(string &in asParent, string &in asChild, int alState)
{
    StartCredits("", true, "Ending", "MainCredits", 0);
}

void Spawn_Monster(string &in entity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}

void OnLeave()
{

}

And this is what i put inside of my .lang file for the SetMessage("Korv", "Korv2", 5.0f);:

Code:
<CATEGORY Name="Korv">
        <Entry Name="Korv2">Quickly! Run to the door!</Entry>
        </CATEGORY>
Please help Confused

Thanks,
TheDavenia


RE: Fatal error help please - Kyle - 06-28-2011

Try this:

Code:
void OnStart()
{
AddEntityCollideCallback("korv_foreal", "korven", "BreakDoor", true, 1);
AddUseItemCallback("UseCrowbar", "crowbar_1", "korv_use_crowbar", "UseCrowbar", true);
SetLocalVarInt("CrowbarUsed", 0);
AddEntityCollideCallback("Player", "ScriptArea_1", "RollCredits", true, 1);
AddEntityCollideCallback("Player", "MonsterArea", "Spawn_Monster", true, 1);
}

void UseCrowbar(string &in asItem, string &in asEntity)
{
    SetEntityActive("crowbar_joint_1", true);
    RemoveItem(asItem);
    AddLocalVarInt("CrowbarUsed", 1);
}

void BreakDoor(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("korv_foreal", false);
    SetSwingDoorLocked("korven_door", false, true);
    SetPropHealth("korven_door", 0);
    SetSwingDoorClosed("korven_door", false, false);
    PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false);
    CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
    SetEntityActive("broken_korv", true);
    GiveSanityBoostSmall();
}

void RollCredits(string &in asParent, string &in asChild, int alState)
{
    StartCredits("", true, "Ending", "MainCredits", 0);
}

void Spawn_Monster(string &in entity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}

void OnEnter()
{

}

void OnLeave()
{

}



RE: Fatal error help please - TheDavenia - 06-28-2011

(06-28-2011, 11:10 PM)Kyle Wrote: Try this:

Code:
void OnStart()
{
AddEntityCollideCallback("korv_foreal", "korven", "BreakDoor", true, 1);
AddUseItemCallback("UseCrowbar", "crowbar_1", "korv_use_crowbar", "UseCrowbar", true);
SetLocalVarInt("CrowbarUsed", 0);
AddEntityCollideCallback("Player", "ScriptArea_1", "RollCredits", true, 1);
AddEntityCollideCallback("Player", "MonsterArea", "Spawn_Monster", true, 1);
}

void UseCrowbar(string &in asItem, string &in asEntity)
{
    SetEntityActive("crowbar_joint_1", true);
    RemoveItem(asItem);
    AddLocalVarInt("CrowbarUsed", 1);
}

void BreakDoor(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("korv_foreal", false);
    SetSwingDoorLocked("korven_door", false, true);
    SetPropHealth("korven_door", 0);
    SetSwingDoorClosed("korven_door", false, false);
    PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false);
    CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
    SetEntityActive("broken_korv", true);
    GiveSanityBoostSmall();
}

void RollCredits(string &in asParent, string &in asChild, int alState)
{
    StartCredits("", true, "Ending", "MainCredits", 0);
}

void Spawn_Monster(string &in entity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}

void OnEnter()
{

}

void OnLeave()
{

}

Error is gone but this whole thing just doesent work now:

Code:
void Spawn_Monster(string &in entity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}
Confused

Thanks for trying anyways Smile


RE: Fatal error help please - Kyle - 06-28-2011

(06-28-2011, 11:19 PM)TheDavenia Wrote: Error is gone but this whole thing just doesent work now:

Code:
void Spawn_Monster(string &in entity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}
Confused

Thanks for trying anyways Smile

So I take it the part of code you posted now doesn't work? I spotted the problem. Try this:

Code:
void Spawn_Monster(string &in asEntity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}



RE: Fatal error help please - TheDavenia - 06-28-2011

(06-28-2011, 11:33 PM)Kyle Wrote:
(06-28-2011, 11:19 PM)TheDavenia Wrote: Error is gone but this whole thing just doesent work now:

Code:
void Spawn_Monster(string &in entity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}
Confused

Thanks for trying anyways Smile

So I take it the part of code you posted now doesn't work? I spotted the problem. Try this:

Code:
void Spawn_Monster(string &in asEntity)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}

Weird... Still doesn't work... Confused


RE: Fatal error help please - Kyle - 06-29-2011

Whoops. I didn't look at your full script until now in comparison with the other chunk you gave me. Try this:

Code:
void Spawn_Monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}



RE: Fatal error help please - TheDavenia - 06-29-2011

(06-29-2011, 12:15 AM)Kyle Wrote: Whoops. I didn't look at your full script until now in comparison with the other chunk you gave me. Try this:

Code:
void Spawn_Monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Korven", true);
ShowEnemyPlayerPosition("Korven");
SetMessage("Korv", "Korv2", 5.0f);
GiveSanityDamage(9.0f, true);
StartPlayerLookAt("Korven", 10, 50, "");
AddTimer("", 1.0f, "TimerStopPlayerLookAtKorven");
}

void TimerStopPlayerLookAtKorven(string &in asTimer)
{
StopPlayerLookAt();
}

Nope still nothing Confused
everything works except for the text


RE: Fatal error help please - Kyle - 06-29-2011

Is any of you text working?


Do you have a description for your custom story? If yes, does it say "No Description" or something like that? If that is the case, then your "extra_english.lang" is messed up. :/


RE: Fatal error help please - TheDavenia - 06-29-2011

Nope everything is working it's just when you look at the monster its supposed to say Quick! Run to the door!
But it doesn't do that Confused


RE: Fatal error help please - Fnoigy - 06-29-2011

This is why you have the game running and your map loaded BEFORE you start editing your script. Go to the wiki and follow the directions for setting up a dev environment. This will make your life so much easier!