Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia Custom Story Error
TheGilgameshZocker Offline
Junior Member

Posts: 13
Threads: 11
Joined: Mar 2012
Reputation: 0
#1
Amnesia Custom Story Error

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 ;(
04-11-2012, 07:50 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#2
RE: Amnesia Custom Story Error

void func1(string &in asEntity)

{

AddLocalVarInt("Var1", 1);

Hebel1 ();

Add a bracket.

Noob scripting tutorial: From Noob to Pro

04-11-2012, 08:09 PM
Find
TheGilgameshZocker Offline
Junior Member

Posts: 13
Threads: 11
Joined: Mar 2012
Reputation: 0
#3
RE: Amnesia Custom Story Error

Now the game still says
ExecuteString (1,1): ERR : No matching signaturest to 'OnLeave()' and it says Expected '(' (41,1)
;(
04-11-2012, 09:16 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#4
RE: Amnesia Custom Story Error

(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();".

Noob scripting tutorial: From Noob to Pro

(This post was last modified: 04-11-2012, 09:30 PM by Cranky Old Man.)
04-11-2012, 09:28 PM
Find
TheGilgameshZocker Offline
Junior Member

Posts: 13
Threads: 11
Joined: Mar 2012
Reputation: 0
#5
RE: Amnesia Custom Story Error

Thanks for your attention, it worked! Big Grin
04-11-2012, 09:37 PM
Find
Mine Turtle Offline
Senior Member

Posts: 647
Threads: 32
Joined: Mar 2011
Reputation: 29
#6
RE: Amnesia Custom Story Error

''Development Support''

bolded on the top of this forum section.

use it wisely

[Image: 201107142327000.gif]
04-12-2012, 11:38 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#7
RE: Amnesia Custom Story Error

(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.


Noob scripting tutorial: From Noob to Pro

04-12-2012, 12:00 PM
Find
Mine Turtle Offline
Senior Member

Posts: 647
Threads: 32
Joined: Mar 2011
Reputation: 29
#8
RE: Amnesia Custom Story Error

(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

[Image: 201107142327000.gif]
04-12-2012, 12:03 PM
Find




Users browsing this thread: 1 Guest(s)