06-28-2012, 11:12 PM
So I've been using this script for a while, but after I added the latest section it says: main (58, 2) : ERR Unexpected end of file. Any suggestions? It's been working so far :/ It crashes on game startup and it started after I added the "CastleSecret" func and the void for it, the bottom part of the script.
Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "FlyingBodyArea", "FlyingBody", true, 1);
AddEntityCollideCallback("Player", "PotExplodeArea", "Explode", true, 1);
SetEntityConnectionStateChangeCallback("CastleLever", "CastleDoorOpen");
SetEntityConnectionStateChangeCallback("SecretLever", "CastleSecret");
}
void FlyingBody(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("pant1", "24_iron_maiden.snt", "Player", 2, true);
SetPropHealth("CorpseWindow", 0);
SetEntityActive("FlyingCorpse", true);
AddPropImpulse("FlyingCorpse", -30, 0, 0, "world");
}
void Explode(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("pant2", "scare_wind.snt", "Player", 2, true);
SetPropHealth("ExplodePot", 0);
}
void CastleDoorOpen(string &in asEntity, int alState)
{
if (alState == 1)
{
SetSwingDoorLocked("mansion_3", false, true);
SetSwingDoorLocked("CastleDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
return;
}
void CastleSecret(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("CastleSecretShelf",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
return;
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}