Unexpected end of file 
			 
			
				Hi, I have been working on my first custom story for a little while now and I just came across an error that says "main (221, 2) :ERR: unexpected end of file. Can anyone one tell me what the problem is? 
 
This is what I have for my script 
 
void OnStart() 
{ 
SetEntityConnectionStateChangeCallback("secret_lever", "Open_Secret_Door"); 
SetEntityConnectionStateChangeCallback("secret_lever_2", "Close_Secret_Door"); 
SetEntityPlayerInteractCallback("Discoveries", "Brute_Spawn", true); 
SetEntityPlayerInteractCallback("Locked_Door", "LockedDoor", false); 
PlayMusic("07_amb.ogg", true, 2, 10, 0, true); 
CheckPoint("check01", "PlayerStartArea_2", "CheckPoint01", "", ""); 
AddEntityPlayerInteractCallback("Key_Upper_Levels", "monsterscare", true); 
} 
void CheckPoint01(string &in asName, int alCount) 
{ 
SetPlayerHealth(RandFloat(80, 95)); 
SetEntityActive("servant_brute_1", true); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 1, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 2, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 3, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, ""); 
AddEntityCollideCallback("servant_brute_1", "MonsterOpenDoorArea", "Monster_Open_Door", true, 1); 
SetEntityPlayerInteractCallback("door_barricade_1", "CloseDoor", true); 
AddQuest("SecretDoor", "SecretDoor"); 
ResetProp("Locked_Door"); 
ResetProp("castle_5"); 
} 
void LockedDoor(string &in Entity) 
{ 
SetMessage("Messages", "Locked", 0); 
} 
void Brute_Spawn(string &in asEntity) 
{ 
SetEntityActive("servant_brute_1", true); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 1, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 2, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 3, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, ""); 
AddEntityCollideCallback("servant_brute_1", "MonsterOpenDoorArea", "Monster_Open_Door", true, 1); 
SetEntityPlayerInteractCallback("door_barricade_1", "CloseDoor", true); 
AddQuest("SecretDoor", "SecretDoor"); 
} 
void Monster_Open_Door(string &in asParent, string &in asChild, int alState) 
{ 
SetSwingDoorClosed("castle_5", false, false); 
SetSwingDoorDisableAutoClose("castle_5", true); 
AddPropForce("castle_5", 70.0f, 0, 0, "World"); 
AddTimer("", 2.0, "New_Path"); 
} 
void New_Path(string &in asTimer) 
{ 
ClearEnemyPatrolNodes("servant_brute_1"); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 2, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 2, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 2, ""); 
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 2, ""); 
} 
void Open_Secret_Door(string &in Entity, int level_state) 
{ 
if (level_state ==1) 
{ 
SetMoveObjectState("shelf_secret_door_rot_1", 1.0f); 
SetMoveObjectState("secret_door", 1.0f); 
return; 
} 
}  
void Close_Secret_Door(string &in Entity, int level_state) 
{ 
if (level_state ==1) 
{ 
SetMoveObjectState("shelf_secret_door_rot_1", 0.0f); 
SetMoveObjectState("secret_door", 0.0f); 
SetMoveObjectState("secret_door_2", 1.0f); 
CompleteQuest("SecretDoor", "SecretDoor"); 
GiveSanityBoostSmall(); 
return; 
} 
}  
void CloseDoor(string &in asEntity) 
{ 
SetSwingDoorClosed("castle_5", true, true); 
SetSwingDoorLocked("castle_5", true, false); 
AddTimer("", 0.5f, "Timer_CloseBarricade"); 
} 
void Timer_CloseBarricade(string &in asTimer) 
{ 
SetSwingDoorClosed("door_barricade_1", true, true);  
AddTimer("", 0.5f, "Timer_LockBarricade"); 
} 
void Timer_LockBarricade(string &in asTimer) 
{ 
SetEntityActive("door_barricade_1", false); 
SetEntityActive("door_barricade_locked_1", true); 
PlaySoundAtEntity("", "lock_door.snt", "Area_BarricadeLockDust", 0.0f, false); 
CreateParticleSystemAtEntity("", "ps_hit_dirt.ps", "Area_BarricadeLockDust", false); 
CreateParticleSystemAtEntity("", "ps_hit_metal.ps", "Area_BarricadeLockDust", false); 
AddEntityCollideCallback("Player", "MonsterActive", "Give_Up", false, 0); 
SetLocalVarInt("BruteInRoom", 1); 
} 
void Give_Up(string &in asParent, string &in asChild, int alState) 
{ 
if(GetLocalVarInt("BruteInRoom") != 1) return; 
if(alState == 1) 
 
StartBangDoorEvent(); 
else 
StopBangDoorEvent(); 
 
} 
void StartBangDoorEvent() 
{ 
SetEntityActive("servant_brute_1", false); 
AddTimer("BangDoor", RandFloat(1.0, 2.0f), "BangDoor"); 
} 
void StopBangDoorEvent() 
{ 
RemoveTimer("BangDoor"); 
SetLocalVarInt("BangDoor", 0); 
if(GetLocalVarInt("Stop") == 2) 
{ 
SetEntityActive("MonsterActive", false); 
} 
 
} 
void BangDoor(string &in asTimer) 
{ 
string sEvent =asTimer; 
AddLocalVarInt(sEvent, 1); 
bool bPauseAtStep = false; 
float fEventSpeed = 0.5f; 
switch(GetLocalVarInt(sEvent)) 
{ 
case 1: 
BangOnDoorEffects("brute", "brute/notice.snt", false); 
break; 
case 2: 
BangOnDoorEffects("bang2", "lurker_hit_wood.snt", true); 
fEventSpeed = RandFloat(0.2f, 0.8f); 
break; 
 
case 3: 
BangOnDoorEffects("bang3", "lurker_hit_wood.snt", true); 
fEventSpeed = RandFloat(0.2f, 0.8f); 
break; 
case 4: 
BangOnDoorEffects("bang4", "lurker_hit_wood.snt", true); 
AddLocalVarInt("Stop", 1); 
if(GetLocalVarInt("Stop") == 2) 
StopBangDoorEvent(); 
break; 
default: 
bPauseAtStep = true; 
break; 
} 
if(!bPauseAtStep) AddTimer(sEvent, fEventSpeed, sEvent); 
} 
void BangOnDoorEffects(string &in sName, string &in sSound, bool bParticle) 
{ 
PlaySoundAtEntity(sName, sSound, "castle_5", 0.0f, false); 
if(bParticle) 
CreateParticleSystemAtEntity("ps"+sName, "ps_hit_wood.ps", "castle_5", false); 
} 
void monsterscare(string &in asEntity) 
{ 
AddEntityCollideCallback("Player", "monsterscarearea", "monsterscare2" true, 1); 
SetSwingDoorClosed("castle_arched02", false, false); 
SetSwingDoorDisableAutoClose("castle_arched02", true); 
AddPropForce("castle_arched02", 70.0f, 0, 0, "World"); 
SetSwingDoorLocked("castle_arched02_1", false, false); 
SetSwingDoorClosed("castle_arched02_1", false, false); 
SetSwingDoorDisableAutoClose("castle_arched02_1", true); 
AddPropForce("castle_arched02_1", 70.0f, 0, 0, "World"); 
SetEntityActive("monsterscarearea", true); 
SetEntityActive("MonsterActive", false); 
} 
void monsterscare2(string &in asParent, string &in asChild, int alState) 
{ 
SetEntityActive("servant_brute_2", true); 
AddEnemyPatrolNode("servant_brute_2", "monster_disable_node", 0, "run.dae_anim"); 
AddEntityCollideCallback("servant_brute_2", "monster_disable_area", monsterdisable", false, 1); 
StartPlayerLookAt("castle_arched02", 10, 10, ""); 
AddTimer("stoplook", 2.0, "PlayerStopLook"); 
GiveSanityDamage(0, true); 
} 
void PlayerStopLook(string &in asTimer) 
{ 
StopPlayerLookAt(); 
} 
void OnLeave() 
{ 
StopMusic( 0,0); 
PlayMusic("09_amb_safe.ogg", true, 2, 10, 0, true); 
}
			 
			
			
			
				
(This post was last modified: 06-20-2012, 09:51 PM by drunkmonk.)
 
				
			 
		 |