Frictional Games Forum (read-only)

Full Version: ERR: Expected identifier
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
You've misplaced AddEntityCollideCallback.
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
(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