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
ERR: Expected identifier
TheHunter Offline
Junior Member

Posts: 4
Threads: 2
Joined: Feb 2013
Reputation: 0
#1
ERR: Expected identifier

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!
(This post was last modified: 02-28-2013, 02:14 AM by TheHunter.)
02-28-2013, 01:52 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: ERR: Expected identifier

You've misplaced AddEntityCollideCallback.

Tutorials: From Noob to Pro
02-28-2013, 02:29 AM
Website Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: ERR: Expected identifier

Move the line
AddEntityCollideCallback("cabinet_nice_1", "InsanityPlacar_1", "Cordurabaja", true, 0);
to your OnStart function. So, your OnStart will look like this:
PHP Code: (Select All)
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

In Ruins [WIP]
02-28-2013, 02:33 AM
Find
TheHunter Offline
Junior Member

Posts: 4
Threads: 2
Joined: Feb 2013
Reputation: 0
#4
RE: ERR: Expected identifier

(02-28-2013, 02:33 AM)NaxEla Wrote: Move the line
AddEntityCollideCallback("cabinet_nice_1", "InsanityPlacar_1", "Cordurabaja", true, 0);
to your OnStart function. So, your OnStart will look like this:
PHP Code: (Select All)
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
02-28-2013, 03:46 PM
Find




Users browsing this thread: 1 Guest(s)