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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Amnesia Custom Story main(7,19): ERR Unexpected identifier
lalakakaka Offline
Junior Member

Posts: 2
Threads: 1
Joined: Aug 2013
Reputation: 0
#1
Amnesia Custom Story main(7,19): ERR Unexpected identifier

Hi!
I thought to make amnesia the dark descent custom story.
But i have a script error. (Sorry my bad english)
I launch my Custom Story and i get this message: FATAL ERROR:Could not load script file 'custom_stories/Hospital/maps/01.hps'!
main(7,19) :ERR Unexpected identifier
main(8,1) :ERR Unexpected token '{'

My script file:

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
}
AddUseItemCallback("", "kulcs_2", "ajto_2", "UsedKeyOnDoor", true);
{
AddUseItemCallback("", "key_3", "kinyitas_3", "UsedKeyOnDoor", true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ajto_2", false, true);
PlaySoundAtEntity("", "unlock_door", "ajto_2", 0, false);
RemoveItem("kulcs_2");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("kinyitas_3", false, true);
PlaySoundAtEntity("", "unlock_door", "kinyitas_3", 0, false);
RemoveItem("key_3");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

What is the problem?
I need help. Thanks for everyone.
09-06-2013, 03:32 PM
Find
summit Offline
Senior Member

Posts: 273
Threads: 20
Joined: Jun 2013
Reputation: 7
#2
RE: Amnesia Custom Story main(7,19): ERR Unexpected identifier

I edited the code. There were errors. Try this one:

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "kulcs_2", "ajto_2", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_3", "kinyitas_3", "UsedKeyOnDoor", true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("ajto_2", false, true);
PlaySoundAtEntity("", "unlock_door", "ajto_2", 0, false);
RemoveItem("kulcs_2");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("kinyitas_3", false, true);
PlaySoundAtEntity("", "unlock_door", "kinyitas_3", 0, false);
RemoveItem("key_3");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

This should work.
(This post was last modified: 09-06-2013, 03:41 PM by summit.)
09-06-2013, 03:36 PM
Find
lalakakaka Offline
Junior Member

Posts: 2
Threads: 1
Joined: Aug 2013
Reputation: 0
#3
RE: Amnesia Custom Story main(7,19): ERR Unexpected identifier

(09-06-2013, 03:36 PM)Arbies Wrote: I edited the code. There were errors. Try this one:

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "kulcs_2", "ajto_2", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_3", "kinyitas_3", "UsedKeyOnDoor", true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("ajto_2", false, true);
PlaySoundAtEntity("", "unlock_door", "ajto_2", 0, false);
RemoveItem("kulcs_2");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("kinyitas_3", false, true);
PlaySoundAtEntity("", "unlock_door", "kinyitas_3", 0, false);
RemoveItem("key_3");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

This should work.

Just i get this message: main(10,1) :ERR : Unexpected token'{'
main(16,1) :ERR : Unexpected token '{'
main(22,1) :ERR : Unexpected token '{'
09-06-2013, 06:17 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#4
RE: Amnesia Custom Story main(7,19): ERR Unexpected identifier

Function declaration doesn't require a semicolon.

void UseKeyOnDoor(string &in asItem, string &in asEntity);
//Should be
void UseKeyOnDoor(string &in asItem, string &in asEntity)
09-06-2013, 06:26 PM
Find
summit Offline
Senior Member

Posts: 273
Threads: 20
Joined: Jun 2013
Reputation: 7
#5
RE: Amnesia Custom Story main(7,19): ERR Unexpected identifier

(09-06-2013, 06:26 PM)Tomato Cat Wrote: Function declaration doesn't require a semicolon.

void UseKeyOnDoor(string &in asItem, string &in asEntity);
//Should be
void UseKeyOnDoor(string &in asItem, string &in asEntity)
You are right, I couldn't see that.

I send a PM to lalakakaka so problem solved.
09-06-2013, 06:48 PM
Find




Users browsing this thread: 1 Guest(s)