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
Unexpected end of file
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#1
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.)
06-20-2012, 08:47 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Unexpected end of file

void Give_Up(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("BruteInRoom") != 1) return;
if(alState == 1)

StartBangDoorEvent();
else
StopBangDoorEvent();

}
missing parantheses.
06-20-2012, 08:55 PM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#3
RE: Unexpected end of file

(06-20-2012, 08:55 PM)FastHunteR Wrote: void Give_Up(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("BruteInRoom") != 1) return;
if(alState == 1)

StartBangDoorEvent();
else
StopBangDoorEvent();

}
missing parantheses.
That line of script did work before I added more stuff to the script
06-20-2012, 08:58 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: Unexpected end of file

Sorry, misread Smile
There are no missing parantheses, and I can't find anything missing by that way. Since when is that error occuring, and what section of this code is new?
06-20-2012, 09:04 PM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#5
RE: Unexpected end of file

AddEntityPlayerInteractCallback("Key_Upper_Levels", "monsterscare", true);
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();
}

I think thats all the new stuff
06-20-2012, 09:09 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#6
RE: Unexpected end of file

AddEntityPlayerInteractCallback("Key_Upper_Levels", "monsterscare", true);
it's SetEntity, not AddEntity.

(That's the only thing I noticed)
(This post was last modified: 06-20-2012, 09:14 PM by Cruzore.)
06-20-2012, 09:13 PM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#7
RE: Unexpected end of file

(06-20-2012, 09:13 PM)FastHunteR Wrote: AddEntityPlayerInteractCallback("Key_Upper_Levels", "monsterscare", true);
it's SetEntity, not AddEntity.

(That's the only thing I noticed)
oh I didn't see that and I fixed it but im still getting the same error message pop up
06-20-2012, 09:19 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#8
RE: Unexpected end of file

AddEntityCollideCallback("servant_brute_2", "monster_disable_area", monsterdisable", false, 1);
No monsterdisable function?
06-20-2012, 09:22 PM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#9
RE: Unexpected end of file

(06-20-2012, 09:22 PM)FastHunteR Wrote: AddEntityCollideCallback("servant_brute_2", "monster_disable_area", monsterdisable", false, 1);
No monsterdisable function?
oh I completely forgot about that and now that iv added it im still get the same message
06-20-2012, 09:30 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#10
RE: Unexpected end of file

You appear to be missing a ":
AddEntityCollideCallback("servant_brute_2", "monster_disable_area", monsterdisable", false, 1);


Try:
AddEntityCollideCallback("servant_brute_2", "monster_disable_area", "monsterdisable", false, 1);
(This post was last modified: 06-20-2012, 09:35 PM by Apjjm.)
06-20-2012, 09:34 PM
Find




Users browsing this thread: 1 Guest(s)