Frictional Games Forum (read-only)
Amnesia Custom Story Error [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: Hints, help and spoilers (https://www.frictionalgames.com/forum/forum-34.html)
+--- Thread: Amnesia Custom Story Error [Help] (/thread-29630.html)



Amnesia Custom Story Error [Help] - LemoN123SVK - 02-19-2015

PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player", "ScriptArea_2", "uvezen", true, 1);
    
AddEntityCollideCallback("Player", "ScriptArea_3", "utek", true, 1);
    
AddEntityCollideCallback("Player", "ScriptArea_4", "DoorExplode", true, 1);
    
AddEntityCollideCallback("Player", "ScriptArea_5", "Suitor", true, 1);
    
AddUseItemCallback("", "hollow_needle_1", "cellar_wood01_2", "Dvere", true);
    
AddUseItemCallback("", "crowbar_1", "cellar_wood01_3", "Dvere1", true);
    
AddEntityCollideCallback("Player", "ScriptArea_6", "SuitorUtek", true, 1);
    
AddEntityCollideCallback("Player", "ScriptArea_7", "Room", true, 1);
    
SetEntityPlayerInteractCallback("button_simple_1", "ButtonFunc", true);
    
AddEntityCollideCallback("Player", "ScriptArea_8", "Room1", true, 1);
    
AddEntityCollideCallback("Player", "ScriptArea_10", "Exit", true, 1);
    
AddEntityCollideCallback("Player", "ScriptArea_12", "Suitor1", true, 1);
}

void Exit(string& asTextCategory, string& asTextEntry, float afTime)
{
     
SetEntityActive("sewer_grate_broken_1", true);
     
AddQuest("prohledat","prohledat");
}


void Suitor(string& asTextCategory, string& asTextEntry, float afTime)
{

     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 1, "");
     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 1, "");
     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 1, "");
     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 1, "");
     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 1, "");
     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 1, "");
     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 1, "");
     
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 1, "");
     
SetEntityActive("servant_grunt_1", true);
     
GiveSanityDamage(5.0f, true);
     
SetMessage("TheVoice", "00_04", 0);
     
AddQuest("roomutek","roomutek");
     
CheckPoint(“newcheckpoint”, “PlayerStartArea_3”, “Happening”, “DeathCategory”, “Deathtext1”); 
}

void Suitor1(string& asTextCategory, string& asTextEntry, float afTime)
{

     
SetEntityActive("servant_grunt_1", true);

}

void ButtonFunc(string &in asEntity)
{
   
SetEntityActive("sewer_grate_new_1", false);
   
SetEntityActive("sewer_grate_broken_1", true);
   
PlaySoundAtEntity("Mechanism1", "move_gate", "button_simple_1", 0, false);
   
AddTimer("", 3.0f, "ButtonFunc2");
}

void ButtonFunc2(string &in asTimer)
{
   
StopSound("Mechanism1", 3.0f);
}

void Room(string& asTextCategory, string& asTextEntry, float afTime)
{
     
SetSwingDoorLocked("mansion_1", true, true);
     
AddQuest("prohledat","prohledat");
}

void Room1(string& asTextCategory, string& asTextEntry, float afTime)
{
     
SetSwingDoorLocked("cellar_wood01_4", true, true);
     
SetEntityActive("servant_brute_2", false);
}

void SuitorUtek(string& asTextCategory, string& asTextEntry, float afTime)
{
     
SetSwingDoorLocked("cellar_wood01_3", true, true);
     
SetEntityActive("servant_grunt_1", false);
}

void DoorLockedPlayer1(string &in entity)
 
{
    if(
GetSwingDoorLocked("cellar_wood01_2") == true)
    {
 
        
SetMessage("Messages", "lock7", 0);
 
    }
}

void DoorLockedPlayer4(string &in entity)
 
{
    if(
GetSwingDoorLocked("cabinet_simple_1") == true)
    {
 
        
SetMessage("Messages", "lock10", 0);
 
    }
}


void DoorLockedPlayer2(string &in entity)
 
{
    if(
GetSwingDoorLocked("cellar_wood01_3") == true)
    {
 
        
SetMessage("Messages", "lock8", 0);
 
    }
}

void DoorLockedPlayer3(string &in entity)
 
{
    if(
GetSwingDoorLocked("cellar_wood01_3") == true)
    {
 
        
SetMessage("Messages", "lock9", 0);
 
    }
}

void Dvere1(string &in asItem, string &in asEntity)
{
     
SetSwingDoorLocked("cellar_wood01_3", false, true);
     
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_3", 0, false);
     
RemoveItem("crowbar_1");
}


void Dvere(string &in asItem, string &in asEntity)
{
     
SetSwingDoorLocked("cellar_wood01_2", false, true);
     
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_2", 0, false);
     
RemoveItem("hollow_needle_1");
}


void DoorExplode(string &in asParent, string &in asChild, int alState)
{
    
SetPropHealth("cellar_wood01_1", 0.0f);
    
GiveSanityDamage(5.0f, true);
}

void uvezen(string& asTextCategory, string& asTextEntry, float afTime)
{
     
SetSwingDoorLocked("dvere", true, true);
     
PlaySoundAtEntity("", "lock_door", "dvere", 0, false);
     
SetEntityActive("servant_brute_1", true);
     
GiveSanityDamage(60.0f, true);
     
SetMessage("TheVoice","00_02",9.0);
     
AddQuest("sklepeniutek","sklepeniutek");
     
StartPlayerLookAt("dvere", 3, 3, "");
     
AddTimer("Timerw", 5, "Timer1");
}

void utek(string& asTextCategory, string& asTextEntry, float afTime)
{
     
SetEntityActive("servant_brute_1", false);
     
SetMessage("TheVoice","00_03",9.0);
     
AddQuest("sklepenistoky","sklepenistoky");
}


void Timer1(string &in asEntity)
{
    
StopPlayerLookAt();
    
StartPlayerLookAt("hatch_drainage_1", 2, 2, "");
    
AddTimer("Timer", 5, "Timer2");
}

void Timer2(string &in asEntity)
{
    
StopPlayerLookAt();

}


void OnEnter()
{
    
AddQuest("sklepenivstup","sklepenivstup");
}

void OnLeave()
{

} 

I cannot find the right error. Please find that error and tell me... Thank you..

ERROR: Expected Expression value


RE: Amnesia Custom Story Error [Help] - 7heDubz - 02-19-2015

What are the two numbers it gave you?
(x,y)

x = Line
Y = Character over from the left where error occurred.


RE: Amnesia Custom Story Error [Help] - Romulator - 02-20-2015

Most of your entity collide callback syntaxes are wrong when being used in the "void" lines.

Instead of:
PHP Code:
(string& asTextCategory, string& asTextEntry, float afTime) 
Use:
PHP Code:
(string &in asParent, string &in asChild, int alState) 

This is only for the AddEntityCollideCallback syntaxes which are later in the void sections. Nowhere else.
There may be more errors, so fix all of these, and then run the game again, but like 7heDubz above me said, tell us what your error says.