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
Amnesia Editor Unexpected { error
AnnoyingIB Offline
Junior Member

Posts: 2
Threads: 1
Joined: Feb 2012
Reputation: 0
#3
RE: Amnesia Editor Unexpected { error

(02-04-2012, 12:42 PM)Khyrpa Wrote: {
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "AreaHelp", "CollideAreaHelp", false, 1);
}
{
AddEntityCollideCallback("Player", "Area1", "CollideArea1", true, 1);
}

those can't just lay in the script file without giving info on when and from what they should be triggered.
I assume you want those to happen right when the game starts the first time so inside void OnStart like this:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Bedroomkey_1", "Bedroom_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "AreaHelp", "CollideAreaHelp", false, 1);
AddEntityCollideCallback("Player", "Area1", "CollideArea1", true, 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Bedroom_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Bedroom_1", 0, false);
RemoveItem("Bedroomkey_1");
}

void CollideArea1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_1");
}
////////////////////////////
// Run when entering map
void OnEnter ()
{
}
////////////////////////////
// Run when leaving map
void OnLeave ()
{
}
Thanks for taking your time.
Now I got the error that said that (22,5) still existed (or something like that). It was the *void KeyOnDoor(string &in asItem, string &in asEntity)*.
So I removed it, but then I got the error that said: main (22,1): ERR Unexpected token '{'
What have I done wrong?

EDIT: Now I finally got what you said. And now it works! Thank you very much! Big Grin
(This post was last modified: 02-04-2012, 05:19 PM by AnnoyingIB.)
02-04-2012, 01:15 PM
Find


Messages In This Thread
Amnesia Editor Unexpected { error - by AnnoyingIB - 02-04-2012, 11:46 AM
RE: Amnesia Editor Unexpected { error - by Khyrpa - 02-04-2012, 12:42 PM
RE: Amnesia Editor Unexpected { error - by AnnoyingIB - 02-04-2012, 01:15 PM



Users browsing this thread: 1 Guest(s)