Frictional Games Forum (read-only)
Amnesia Custom Story 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: Amnesia Custom Story Error (/thread-14714.html)



Amnesia Custom Story Error - TheGilgameshZocker - 04-11-2012

Hi, I've got a problem, if I enter my room, which I have created, there will be an error in the .hps file. The error says: ExecuteString (1,1): ERR : No matching signaturest to 'OnLeave()' (102,5): ERR : Unexpected end of file
Here is my script:


void OnStart()

{
SetEntityPlayerInteractCallback("door1", "func_slam", true);
}

void func_slam(string &in asEntity)
{
SetPropHealth("door1", 0.0f);


PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);


PlaySoundAtEntity("", "react_scare", "Player", 0, false);


PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);


GiveSanityDamage(5.0f, true);
}

void OnEnter()
{
AddUseItemCallback("", "archive1", "door4", "FUNCTION", true);
AddEntityCollideCallback("Player", "script1", "HolyJesus", true, 1);
AddEntityCollideCallback("Jesus_1", "script1", "Sound", true, 1);
AddUseItemCallback("", "archive1", "door4", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("archive1", "OnPickup");
SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("lever1", "func1", true);
}
void func1(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
Hebel1 ();

void Hebel1
{
if(GetLocalVarInt("Var1") == 1)
{
SetSwingDoorLocked("bonus1", false, false);
PlaySoundAtEntity("", "unlock_door.snt", "bonus1", 0.5f, false);
GetPlayerSanity(2.0f, true);
}
}

void HolyJesus(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus_1", true);
AddPropForce("Jesus_1", 30000, 0, 0, "World");
}

void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.snt", "script1", 0, false);

GiveSanityDamage(7.0f, true);
}

void FUNCTION (string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(item);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door4", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door4", 0, false);
RemoveItem("archive1");
}

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("grunt1", true);
AddEnemyPatrolNode("grunt1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_5", 3, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_8", 5, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_11", 5, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_14", 7, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_15", 3, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_17", 3, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("grunt1", "PathNodeArea_20", 0, "");
}

void OnLeave()

{

}

What have I done wrong? Please help me ;(


RE: Amnesia Custom Story Error - Cranky Old Man - 04-11-2012

Code:
void func1(string &in asEntity)

{

AddLocalVarInt("Var1", 1);

Hebel1 ();

Add a bracket.



RE: Amnesia Custom Story Error - TheGilgameshZocker - 04-11-2012

Now the game still says
ExecuteString (1,1): ERR : No matching signaturest to 'OnLeave()' and it says Expected '(' (41,1)
;(


RE: Amnesia Custom Story Error - Cranky Old Man - 04-11-2012

(04-11-2012, 09:16 PM)TheGilgameshZocker Wrote: Now the game still says
ExecuteString (1,1): ERR : No matching signaturest to 'OnLeave()' and it says Expected '(' (41,1)
;(
When I said "Add a bracket.", I meant "}", not ")".
Oh, and "Hebel1 ();" should probably be "Hebel1();".



RE: Amnesia Custom Story Error - TheGilgameshZocker - 04-11-2012

Thanks for your attention, it worked! Big Grin


RE: Amnesia Custom Story Error - Mine Turtle - 04-12-2012

''Development Support''

bolded on the top of this forum section.

use it wisely


RE: Amnesia Custom Story Error - Cranky Old Man - 04-12-2012

(04-12-2012, 11:38 AM)darkadders Wrote: ''Development Support''
bolded on the top of this forum section.
use it wisely
I've seen weirder problems than this, if that's what you mean.




RE: Amnesia Custom Story Error - Mine Turtle - 04-12-2012

(04-12-2012, 12:00 PM)Cranky Old Man Wrote:
(04-12-2012, 11:38 AM)darkadders Wrote: ''Development Support''
bolded on the top of this forum section.
use it wisely
I've seen weirder problems than this, if that's what you mean.
was simply stating the fact that even though a section is clearly visible to people, they still manage to post in the wrong place