Frictional Games Forum (read-only)
ERR: Expected identifier - 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: ERR: Expected identifier (/thread-20545.html)



ERR: Expected identifier - TheHunter - 02-28-2013

Hello, I need help with a Script: I want to put a script when you open a closet Insanity and sanity will drop the character. But what I want to rip out and says ERR: Expected identifier. Here I leave the script to see the error Huh
Thanks for your attention.Big Grin

////////////////////////////
// Run when entering map
void OnStart()
{
for(int i = 0;i < 2;i++) {GiveItemFromFile("tinderbox", "tinderbox.ent");}
AddUseItemCallback("", "llave_placar01", "Puerta_pieza_comienzo", "UsedKeyOnDoor", true);

}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Puerta_pieza_comienzo", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Puerta_pieza_comienzo", 0, false);
RemoveItem("llaveplacar01");
}
AddEntityCollideCallback("cabinet_nice_1", "InsanityPlacar_1", "Cordurabaja", true, 0);

////////////////////////////
// Run when entering map
void OnEnter()
{

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

}
void Cordurabaja(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(20, true);
}

Sorry for my bad english =(

HEEEELP!


RE: ERR: Expected identifier - Your Computer - 02-28-2013

You've misplaced AddEntityCollideCallback.


RE: ERR: Expected identifier - NaxEla - 02-28-2013

Move the line
Code:
AddEntityCollideCallback("cabinet_nice_1", "InsanityPlacar_1", "Cordurabaja", true, 0);
to your OnStart function. So, your OnStart will look like this:
PHP Code:
void OnStart()
{
for(
int i 0;2;i++) {GiveItemFromFile("tinderbox""tinderbox.ent");}
AddUseItemCallback("""llave_placar01""Puerta_pieza_comienzo""UsedKeyOnDoor"true); 
AddEntityCollideCallback("cabinet_nice_1""InsanityPlacar_1""Cordurabaja"true0);


If this doesn't solve the problem, please post the whole error, not just part of it. Also, you might be able to solve this on your own by reading this: http://www.frictionalgames.com/forum/thread-19868.html


RE: ERR: Expected identifier - TheHunter - 02-28-2013

(02-28-2013, 02:33 AM)NaxEla Wrote: Move the line
Code:
AddEntityCollideCallback("cabinet_nice_1", "InsanityPlacar_1", "Cordurabaja", true, 0);
to your OnStart function. So, your OnStart will look like this:
PHP Code:
void OnStart()
{
for(
int i 0;2;i++) {GiveItemFromFile("tinderbox""tinderbox.ent");}
AddUseItemCallback("""llave_placar01""Puerta_pieza_comienzo""UsedKeyOnDoor"true); 
AddEntityCollideCallback("cabinet_nice_1""InsanityPlacar_1""Cordurabaja"true0);


If this doesn't solve the problem, please post the whole error, not just part of it. Also, you might be able to solve this on your own by reading this: http://www.frictionalgames.com/forum/thread-19868.html

TANKS MAN! You helped me quite Big Grin Big Grin