RE: Amnesia Editor Unexpected { error
{
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 ()
{
}
|