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!! ;(
cooleoj Offline
Junior Member

Posts: 24
Threads: 6
Joined: Aug 2011
Reputation: 0
#1
Unexpected end of file!! ;(

So i get a error when i start my map and i really suck at scripting so i could really need some help Smile



void OnStart()

{
AddEntityCollideCallback("Player", "scarearea1", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("scaredoor1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);

AddUseItemCallback("", "hollowneedle1", "lockeddoor1", "FUNCTION", true);

}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockeddoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "lockeddoor1", 0, false);
RemoveItem("hollowneedle1");

{
AddEntityCollideCallback("Player", "monstertrigger1", "MonsterFunction", "true", 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState);
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");

}


That is my script.

__________________________________________________
http://www.youtube.com/user/TheMRcooleoj20?feature=mhee
10-06-2011, 07:41 AM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#2
RE: Unexpected end of file!! ;(

No wait. This is completely wrong! Give me 2 minutes to fix this up and please take the time to read through the code and see what was wrong!
PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""scarearea1""func_slam"true1);
    
AddEntityCollideCallback("Player""monstertrigger1""MonsterFunction""true"1); 
    
AddUseItemCallback("""hollowneedle1""lockeddoor1""FUNCTION"true);


void func_slam(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("scaredoor1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
    
PlaySoundAtEntity("""react_scare""Player"0false); PlaySoundAtEntity("""close_door.snt""Player"0false); 
    
GiveSanityDamage(5.0ftrue);

}
void FUNCTION(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("lockeddoor1"falsetrue);
PlaySoundAtEntity("""unlock_door""lockeddoor1"0false);
RemoveItem("hollowneedle1");
}


void MonsterFunction(string &in asParentstring &in asChildint alState);
{
    
SetEntityActive("servant_grunt_1"true); 
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_10"4"");


The problem was you had code in the wrong places, put backets where they werent supposed to go to and it wasnt indented correctly..

Rep if like me or im helpful or you love my stories!
Stephanos house
(This post was last modified: 10-06-2011, 07:56 AM by Gamemakingdude.)
10-06-2011, 07:52 AM
Find
cooleoj Offline
Junior Member

Posts: 24
Threads: 6
Joined: Aug 2011
Reputation: 0
#3
RE: Unexpected end of file!! ;(

Nope...
Now it crashes and says this instead:
main (25,1) : ERR : Unexpected token '{'

__________________________________________________
http://www.youtube.com/user/TheMRcooleoj20?feature=mhee
10-06-2011, 07:59 AM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#4
RE: Unexpected end of file!! ;(

void OnStart()

{
AddEntityCollideCallback("Player", "scarearea1", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("scaredoor1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
AddUseItemCallback("", "hollowneedle1", "lockeddoor1", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockeddoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "lockeddoor1", 0, false);
RemoveItem("hollowneedle1");
}

AddEntityCollideCallback("Player", "monstertrigger1", "MonsterFunction", "true", 1);
{
void MonsterFunction(string &in asParent, string &in asChild, int alState);
}

{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

This might work.

BTW: if it works, don't be mad if your script doesn't work because it's like Gamemakingdude said "completly wrong".
If you can launch your map without any errors, tell me and I can fix the script for you.

[Image: 44917299.jpg]Dubstep <3
10-06-2011, 08:09 AM
Find
cooleoj Offline
Junior Member

Posts: 24
Threads: 6
Joined: Aug 2011
Reputation: 0
#5
RE: Unexpected end of file!! ;(

main (23,25) : ERR : Expected identifier
main (24,1) : ERR : unexpected token '{'
main (28,1) : ERR : unexpected token '{'
hmmm..

BTW everything worked before i tried to add a monster script

__________________________________________________
http://www.youtube.com/user/TheMRcooleoj20?feature=mhee
(This post was last modified: 10-06-2011, 08:27 AM by cooleoj.)
10-06-2011, 08:13 AM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#6
RE: Unexpected end of file!! ;(

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""scarearea1""func_slam"true1);
    
AddEntityCollideCallback("Player""monstertrigger1""MonsterFunction""true"1); 
    
AddUseItemCallback("""hollowneedle1""lockeddoor1""FUNCTION"true);


void func_slam(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("scaredoor1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
    
PlaySoundAtEntity("""react_scare""Player"0false); PlaySoundAtEntity("""close_door.snt""Player"0false); 
    
GiveSanityDamage(5.0ftrue);

}
void FUNCTION(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("lockeddoor1"falsetrue);
PlaySoundAtEntity("""unlock_door""lockeddoor1"0false);
RemoveItem("hollowneedle1");
}


void MonsterFunction(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"true); 
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_10"4"");



Fixed it i found an ; at the end of one of your procedures.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-06-2011, 08:27 AM
Find
cooleoj Offline
Junior Member

Posts: 24
Threads: 6
Joined: Aug 2011
Reputation: 0
#7
RE: Unexpected end of file!! ;(

main (4,5) : ERR : no matching signatures to 'AddEntityCollideCallback("Player", "monstertrigger1", "MonsterFunction", "true", 1); '
Gahhh seems i messed up some crazy shit

__________________________________________________
http://www.youtube.com/user/TheMRcooleoj20?feature=mhee
10-06-2011, 08:36 AM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#8
RE: Unexpected end of file!! ;(

Have you got that trigger in the map by any chance and is it named right?

Rep if like me or im helpful or you love my stories!
Stephanos house
10-06-2011, 08:45 AM
Find
cooleoj Offline
Junior Member

Posts: 24
Threads: 6
Joined: Aug 2011
Reputation: 0
#9
RE: Unexpected end of file!! ;(

Yes i have and its named "monstertrigger1"

__________________________________________________
http://www.youtube.com/user/TheMRcooleoj20?feature=mhee
10-06-2011, 08:46 AM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#10
RE: Unexpected end of file!! ;(

Try changing true to false.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-06-2011, 09:07 AM
Find




Users browsing this thread: 1 Guest(s)