Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
Help - Unexpected end of file 
			 
			
				When I try to open my custom story, there is a fatal error (well, it is normal, but...) that says "Unexpected end of file", but there is NOTHING on the end of the file, just the normal  
 
void OnLeave() 
{ 
 
} 
 
But it says that there's something beyond the '}'. There is not. HELP PLEASE
			 
			
			
			
		 |  
	 
 | 
 
	| 12-05-2011, 11:17 PM  | 
	
		
	 | 
 
 
	
		
		GillFrog 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 26 
	Threads: 7 
	Joined: Mar 2011
	
 Reputation: 
1
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				 Quote:void OnLeave() 
{ 
 
}  
Is this the full script? 
If it is, try this:
 
void OnEnter() 
{ 
}
 
void OnLeave() 
{ 
}
			  
			
			
			
				
(This post was last modified: 12-05-2011, 11:46 PM by GillFrog.)
 
				
			 
		 |  
	 
 | 
 
	| 12-05-2011, 11:45 PM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				 (12-05-2011, 11:45 PM)GillFrog Wrote:  Quote:void OnLeave() 
{ 
 
}  
Is this the full script? 
If it is, try this: 
 
void OnEnter() 
{ 
} 
 
void OnLeave() 
{ 
} No, this isn't the whole script. There is the OnStart() with all the things I made, but this is the part where the game says that there is something wrong... 
			  
			
			
			
		 |  
	 
 | 
 
	| 12-06-2011, 01:28 AM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				 (12-06-2011, 01:28 AM)Victor Wrote:  No, this isn't the whole script. There is the OnStart() with all the things I made, but this is the part where the game says that there is something wrong... 
You have to show us the whole script regardless of what line the engine is reporting.
			  
			
			
 
			
		 |  
	 
 | 
 
	| 12-06-2011, 01:44 AM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				 (12-06-2011, 01:44 AM)Your Computer Wrote:   (12-06-2011, 01:28 AM)Victor Wrote:  No, this isn't the whole script. There is the OnStart() with all the things I made, but this is the part where the game says that there is something wrong...  
You have to show us the whole script regardless of what line the engine is reporting. Oh, ok!    
void OnStart() 
{ 
	SetEntityPlayerInteractCallback("button", "func1", true); 
	wakeUp(); 
	AddEntityCollideCallback("Player", "MonsterArea", "MonsterFunction", true, 1); 
	AddEntityCollideCallback("servant_grunt_1", "PNScriptArea", "MonsterFunction2", false, 1); 
	AddEntityCollideCallback("Crowbar_1", "AreaPutCrowbar", "CrowbarAppear", true, 1); 
}
 
void CrowbarAppear(string &in asParent, string &in asChild, int alState)  
{ 
SetEntityActive("Crowbar_joint", true); 
RemoveItem("Crowbar_1"); 
}
 
void BreakDoor(string &in asParent, string &in asChild, int alState) 
{ 
	SetSwingDoorLocked("door", false, false);' 
	CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false); 
	PlaySoundAtEntity("", "break_wood", "BreakEffect", 0.0, false); 
	SetEntityActive("Crowbar_joint", false); 
	SetEntityActive("crowbar_broken_1", true); //THIS SHOULD BE A CROWBAR ENTITY ONLY (NOT ITEM, NOT JOINT (name it crowbar) 
}
 
void MonsterFunction(string &in asParent, string &in asChild, int alState) 
{ 
	SetEntityActive("servant_grunt_1", true);  
	SetEntityActive("block_box_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", 5, ""); 
	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", 0, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 5, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, ""); 
	AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, ""); 
 for (int i = 1; i <11; i++) 
	{ 
 int x = i;  
 if (i == 1) 
 { 
 x = 2; 
 } 
 if (i = 18) 
 { 
 x = 4; 
 } 
 if (i != 1 || i != 18) 
 { 
 x = 0; 
 } 
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1"+17, 18, ""); 
	}
 
	SetMoveObjectState("shelf",0.0f); 
}
 
void MonsterFunction2() 
{ 
	for (int i = 1; i <6; i++) 
	{ 
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1"+17, 0, ""); 
	} 
}
 
void wakeUp()  
{ 
	PlayMusic("02_amb_strange.ogg", true, 5, 1, 1, true); 
 FadeOut(0); // Instantly fades the screen out. (Good for starting the game) 
 FadeIn(20); // Amount of seconds the fade in takes 
 FadeImageTrailTo(2, 2); 
 FadeSepiaColorTo(100, 4); 
 SetPlayerActive(false);  
 FadePlayerRollTo(50, 220, 220); // "Tilts" the players head 
 FadeRadialBlurTo(0.15, 2); 
 SetPlayerCrouching(true); // Simulates being on the ground 
 AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last 
	GiveSanityDamage(20, true); 
}
 
void beginStory(string &in asTimer) 
{ 
 ChangePlayerStateToNormal(); 
 SetPlayerActive(true); 
 FadePlayerRollTo(0, 33, 33); // Change all settings to defaults 
 FadeRadialBlurTo(0.0, 1); 
 FadeSepiaColorTo(0, 4); 
 SetPlayerCrouching(false); 
 FadeImageTrailTo(0,1); 
}
 
void func1(string &in asEntity) 
{ 
	SetMoveObjectState("shelf",1.0f); 
	PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false); 
	GiveSanityBoost(); 
}
 
void OnEnter() 
{ 
}
 
void OnLeave() 
{
 
}
			  
			
			
			
		 |  
	 
 | 
 
	| 12-06-2011, 01:52 AM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				You have a dangling apostrophe within the BreakDoor function at the end of SetSwingDoorLocked.
			 
			
			
 
			
		 |  
	 
 | 
 
	| 12-06-2011, 02:13 AM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				 (12-06-2011, 02:13 AM)Your Computer Wrote:  You have a dangling apostrophe within the BreakDoor function at the end of SetSwingDoorLocked. Thanks a lot! 
			  
			
			
			
		 |  
	 
 | 
 
	| 12-06-2011, 02:40 AM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				 (12-06-2011, 02:13 AM)Your Computer Wrote:  You have a dangling apostrophe within the BreakDoor function at the end of SetSwingDoorLocked. It worked, but now the crash log says that in the "AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 5, "");", expression must be of boolean type. I don't know what that means...
			  
			
			
			
		 |  
	 
 | 
 
	| 12-06-2011, 07:37 PM  | 
	
		
	 | 
 
 
	
		
		Fanskapi 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 23 
	Threads: 5 
	Joined: Nov 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				Boolean means true or false. It's a data type, so you have to write either of them to work. (But AddEnemyPatrolNode doesn't use bool, so i don't know whats wrong...) 
 
Also, to avoid future mishaps, download Notepad++, it will be alot easier to code in this program.
			 
			
			
			
				
(This post was last modified: 12-12-2011, 09:30 AM by Fanskapi.)
 
				
			 
		 |  
	 
 | 
 
	| 12-12-2011, 09:27 AM  | 
	
		
	 | 
 
 
	
		
		nemesis567 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 874 
	Threads: 65 
	Joined: May 2011
	
 Reputation: 
10
		
	 | 
	
		
			
RE: Help - Unexpected end of file 
			 
			
				You mistyped the boolean operator in  if(i = 18) where it should be  if(i == 18).
 
Also, by doing: 
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1"+17, 18, ""); 
 
  you are repeatdly adding a pathnode to the  pathnodearea_117. I suppose you want what's bellow: 
Correct code:
 void OnStart() {     SetEntityPlayerInteractCallback("button", "func1", true);     wakeUp();     AddEntityCollideCallback("Player", "MonsterArea", "MonsterFunction", true, 1);     AddEntityCollideCallback("servant_grunt_1", "PNScriptArea", "MonsterFunction2", false, 1);     AddEntityCollideCallback("Crowbar_1", "AreaPutCrowbar", "CrowbarAppear", true, 1); }
  void CrowbarAppear(string &in asParent, string &in asChild, int alState) {     SetEntityActive("Crowbar_joint", true);     RemoveItem("Crowbar_1"); }
  void BreakDoor(string &in asParent, string &in asChild, int alState) {     SetSwingDoorLocked("door", false, false);     CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);     PlaySoundAtEntity("", "break_wood", "BreakEffect", 0.0, false);     SetEntityActive("Crowbar_joint", false);     SetEntityActive("crowbar_broken_1", true); //THIS SHOULD BE A CROWBAR ENTITY ONLY (NOT ITEM, NOT JOINT (name it crowbar) }
      void MonsterFunction(string &in asParent, string &in asChild, int alState)     {     SetEntityActive("servant_grunt_1", true);     SetEntityActive("block_box_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", 5, "");     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", 0, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 5, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");     AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");     for (int i = 1; i <11; i++)     {         int x = i;         if (i == 1)         {             x = 2;         }         if (i == 18)         {             x = 4;         }         if (i != 1 || i != 18)         {             x = 0;         }         //AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+17, 18, "");     }     SetMoveObjectState("shelf",0.0f); }
          void MonsterFunction2()     {         for (int i = 1; i <6; i++)         {             AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+i, 0, "");         }             }
      void wakeUp()     {         PlayMusic("02_amb_strange.ogg", true, 5, 1, 1, true);         FadeOut(0); // Instantly fades the screen out. (Good for starting the game)         FadeIn(20); // Amount of seconds the fade in takes         FadeImageTrailTo(2, 2);         FadeSepiaColorTo(100, 4);         SetPlayerActive(false);         FadePlayerRollTo(50, 220, 220); // "Tilts" the players head         FadeRadialBlurTo(0.15, 2);         SetPlayerCrouching(true); // Simulates being on the ground         AddTimer("trig1", 11.0f, "beginStory"); // Change ' 11.0f' to however long you want the 'unconciousness' to last         GiveSanityDamage(20, true); }
      void beginStory(string &in asTimer)     {     ChangePlayerStateToNormal();     SetPlayerActive(true);     FadePlayerRollTo(0, 33, 33); // Change all settings to defaults     FadeRadialBlurTo(0.0, 1);     FadeSepiaColorTo(0, 4);     SetPlayerCrouching(false);     FadeImageTrailTo(0,1); }
      void func1(string &in asEntity)     {     SetMoveObjectState("shelf",1.0f);     PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);     GiveSanityBoost(); }
      void OnEnter()     { }
      void OnLeave()     {
  } 
 
 
 
Your script, though is is bad organized and has useless stuff inside.
			  
			
			
 
 Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it. 
 
			
				
(This post was last modified: 12-12-2011, 11:29 PM by nemesis567.)
 
				
			 
		 |  
	 
 | 
 
	| 12-12-2011, 11:23 PM  | 
	
		
	 | 
 
 
	 
 |