Frictional Games Forum (read-only)
NEED HELP AMNESIA ERROR!! - 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: NEED HELP AMNESIA ERROR!! (/thread-14334.html)



NEED HELP AMNESIA ERROR!! - Wapez - 03-29-2012

Hi my Amnesia crashes and gives me an error when i try to load my map. It gives me the number 41.2, which I assume is the last line in my file. it also says, "unexpected ending of file." please, whats wrong with my file?


//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "key_5", "door_5", "UsedKeyOnDoor5", true);
SetEntityPlayerInteractCallback("key_5, "ActivateMonster", true);
}
//KEYS THAT UNLOCK DOORS
void UsedKeyOnDoor5(string &in item, string &in door)
{
SetSwingDoorLocked("door_5", false, true);
PlaySoundAtEntity("", "unlock_door", "door_5", 0, false);
RemoveItem("key_5");
}

//THINGS THAT HAPPENS TO DOORS
void ExplodeDoor(string &in asParent, string &in asChild, int alState)
{
}

//ACTIVATE MONSTERS
void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNode_1, 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNode_2, 0, "Idle");
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}


RE: NEED HELP AMNESIA ERROR!! - Tanshaydar - 03-29-2012

Here:
SetEntityPlayerInteractCallback("key_5, "ActivateMonster", true);
You forgot to close "
it should've been:
SetEntityPlayerInteractCallback("key_5", "ActivateMonster", true);


RE: NEED HELP AMNESIA ERROR!! - Wapez - 03-29-2012

(03-29-2012, 05:30 PM)Tanshaydar Wrote: Here:
SetEntityPlayerInteractCallback("key_5, "ActivateMonster", true);
You forgot to close "
it should've been:
SetEntityPlayerInteractCallback("key_5", "ActivateMonster", true);
I changed the thing you mentioned, and some more scripts. Now it says:
ERROR
main 28,29 "servant_grunt_1" not declared

So, what's the problem now?

my new file:


//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "key_5", "door_5", "UsedKeyOnDoor5", true);
SetEntityPlayerInteractCallback("key_5", "ActivateMonster", true);
}
//KEYS THAT UNLOCK DOORS
void UsedKeyOnDoor5(string &in item, string &in door)
{
SetSwingDoorLocked("door_5", false, true);
PlaySoundAtEntity("", "unlock_door", "door_5", 0, false);
RemoveItem("key_5");
}

//THINGS THAT HAPPENS TO DOORS
void ExplodeDoor(string &in asParent, string &in asChild, int alState)
{
}

//ACTIVATE MONSTERS
void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition(servant_grunt_1);
SetEnemyIsHallucination("servant_grunt_1", true);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}
(03-29-2012, 06:46 PM)Wapez Wrote:
(03-29-2012, 05:30 PM)Tanshaydar Wrote: Here:
SetEntityPlayerInteractCallback("key_5, "ActivateMonster", true);
You forgot to close "
it should've been:
SetEntityPlayerInteractCallback("key_5", "ActivateMonster", true);
I changed the thing you mentioned, and some more scripts. Now it says:
ERROR
main 28,29 "servant_grunt_1" not declared

So, what's the problem now?

my new file:


//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "key_5", "door_5", "UsedKeyOnDoor5", true);
SetEntityPlayerInteractCallback("key_5", "ActivateMonster", true);
}
//KEYS THAT UNLOCK DOORS
void UsedKeyOnDoor5(string &in item, string &in door)
{
SetSwingDoorLocked("door_5", false, true);
PlaySoundAtEntity("", "unlock_door", "door_5", 0, false);
RemoveItem("key_5");
}

//THINGS THAT HAPPENS TO DOORS
void ExplodeDoor(string &in asParent, string &in asChild, int alState)
{
}

//ACTIVATE MONSTERS
void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition(servant_grunt_1);
SetEnemyIsHallucination("servant_grunt_1", true);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}
oh i found it. now it works. thanks anyway