| 
		
	
		| Lemorz56   Junior Member
 
 Posts: 10
 Threads: 3
 Joined: Oct 2011
 Reputation: 
0
 | 
			|  Unexpected End Of File? HELP ME 
 
				Unexpected end of file, Whaat? heres my .hps file void OnStart(){ AddUseItemCallback("", "monsterdoorkey", "monsterdoor", "UsedKeyOnDoor", true);  // START OF EVERYTHING AddEntityCollideCallback("Player", "ScriptArea_1", "PianoScare", false, 0); AddEntityCollideCallback("Player", "ScriptArea_2", "PianoStop", false, 0);}
 
 void PianoScare(string &in asParent, string &in asChild, int alState){        if(alState == 1)        {                    PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);        }    if(alState == -1)        {          StopSound("general_piano03.ogg", 5);        }}    void pianotimer(string &in asTimer){PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false); AddTimer("pianotimer", 18, "pianotimer");}
 void PianoStop(string &in asParent, string &in asChild, int alState){ StopSound("PianoScareMusic", 0); RemoveTimer("pianotimer"); SetLeverStuckState("piano_01, 0, true); AddPropImpulse("piano_01", 0, 0, 100, "World"); PlaySoundAtEntity("PianoScareBoom", "break_wood", "piano_1", 0, false); CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);}
 
 void UsedKeyOnDoor(string &in asItem, string &in asEntity){ SetSwingDoorLocked("monsterdoor", false, true); PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, false); RemoveItem("monsterdoorkey");}
 |  |  
	| 10-23-2011, 02:27 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				It's really hard to read but ill give it a shot... 
nupp cant read it, can you give it in a easier format? Like spaced and all that.    
Also, give us the line and character line on where the unexpected end of file is  
 |  |  
	| 10-23-2011, 02:34 PM |  |  
	
		| Lemorz56   Junior Member
 
 Posts: 10
 Threads: 3
 Joined: Oct 2011
 Reputation: 
0
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				 (10-23-2011, 02:34 PM)flamez3 Wrote:  It's really hard to read but ill give it a shot...
 nupp cant read it, can you give it in a easier format? Like spaced and all that.
  
 Also, give us the line and character line on where the unexpected end of file is
  Ill try to make it spaced, But The forum messes it up,  The error says this. Somwhere about the end its about.  
"main (47, 2) ; Unexpected end of file" 
 
 
HERE IS A BETTER VERSION 
-----------------------------------------------------------------------------------------
 
void OnStart() 
{ 
 AddUseItemCallback("", "monsterdoorkey", "monsterdoor", "UsedKeyOnDoor", true); 
 AddEntityCollideCallback("Player", "ScriptArea_1", "PianoScare", false, 0); 
 AddEntityCollideCallback("Player", "ScriptArea_2", "PianoStop", false, 0); 
}
 
void PianoScare(string &in asParent, string &in asChild, int alState) 
{
  
	if(alState == 1) 
 {
  
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false); 
 } 
 if(alState == -1) 
 { 
 StopSound("general_piano03.ogg", 5); 
 } 
} 
  
void pianotimer(string &in asTimer) 
{ 
PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);  
AddTimer("pianotimer", 18, "pianotimer"); 
}
 
void PianoStop(string &in asParent, string &in asChild, int alState) 
{ 
 StopSound("PianoScareMusic", 0); 
 RemoveTimer("pianotimer"); 
 SetLeverStuckState("piano_01, 0, true); 
 AddPropImpulse("piano_01", 0, 0, 100, "World"); 
 PlaySoundAtEntity("PianoScareBoom", "break_wood", "piano_1", 0, false); 
 CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false); 
}
 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
 SetSwingDoorLocked("monsterdoor", false, true); 
 PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, false); 
 RemoveItem("monsterdoorkey"); 
}
			 
				
(This post was last modified: 10-23-2011, 02:47 PM by Lemorz56.)
 |  |  
	| 10-23-2011, 02:38 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				 (10-23-2011, 02:38 PM)Lemorz56 Wrote:  HERE IS A BETTER VERSION-----------------------------------------------------------------------------------------
 
 
 void OnStart()
 {
 AddUseItemCallback("", "monsterdoorkey", "monsterdoor", "UsedKeyOnDoor", true);
 AddEntityCollideCallback("Player", "ScriptArea_1", "PianoScare", false, 0);
 AddEntityCollideCallback("Player", "ScriptArea_2", "PianoStop", false, 0);
 }
 
 
 
 void PianoScare(string &in asParent, string &in asChild, int alState)
 {
 
 if(alState == 1)
 {
 
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 }
 if(alState == -1)
 {
 StopSound("general_piano03.ogg", 5);
 }
 }
 
 void pianotimer(string &in asTimer)
 {
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 AddTimer("pianotimer", 18, "pianotimer");
 }
 
 void PianoStop(string &in asParent, string &in asChild, int alState)
 {
 StopSound("PianoScareMusic", 0);
 RemoveTimer("pianotimer");
 SetLeverStuckState("piano_01, 0, true);
 AddPropImpulse("piano_01", 0, 0, 100, "World");
 PlaySoundAtEntity("PianoScareBoom", "break_wood", "piano_1", 0, false);
 CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);
 }
 
 
 
 void UsedKeyOnDoor(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("monsterdoor", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, false);
 RemoveItem("monsterdoorkey");
 }
 The bold  text means that you haven't closed your functions properly.
 
void OnStart() 
{ 
AddUseItemCallback("", "monsterdoorkey", "monsterdoor", "UsedKeyOnDoor", true); 
AddEntityCollideCallback("Player", "ScriptArea_1", "PianoScare", false, 0); 
AddEntityCollideCallback("Player", "ScriptArea_2", "PianoStop", false, 0); 
}
 
void PianoScare(string &in asParent, string &in asChild, int alState) 
{ 
if(alState == 1)
} 
 
PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false); 
{ 
if(alState == -1) 
StopSound("general_piano03.ogg", 5); 
}
 
 
void pianotimer(string &in asTimer) 
{ 
PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);  
AddTimer("pianotimer", 18, "pianotimer"); 
}
 
void PianoStop(string &in asParent, string &in asChild, int alState) 
{ 
StopSound("PianoScareMusic", 0); 
RemoveTimer("pianotimer"); 
SetLeverStuckState("piano_01, 0, true); 
AddPropImpulse("piano_01", 0, 0, 100, "World"); 
PlaySoundAtEntity("PianoScareBoom", "break_wood", "piano_1", 0, false); 
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false); 
}
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
SetSwingDoorLocked("monsterdoor", false, true); 
PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, false); 
RemoveItem("monsterdoorkey"); 
}
			 
 |  |  
	| 10-23-2011, 02:48 PM |  |  
	
		| Lemorz56   Junior Member
 
 Posts: 10
 Threads: 3
 Joined: Oct 2011
 Reputation: 
0
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				 (10-23-2011, 02:48 PM)flamez3 Wrote:   (10-23-2011, 02:38 PM)Lemorz56 Wrote:  HERE IS A BETTER VERSIONThe bold text means that you haven't closed your functions properly.-----------------------------------------------------------------------------------------
 
 
 void OnStart()
 {
 AddUseItemCallback("", "monsterdoorkey", "monsterdoor", "UsedKeyOnDoor", true);
 AddEntityCollideCallback("Player", "ScriptArea_1", "PianoScare", false, 0);
 AddEntityCollideCallback("Player", "ScriptArea_2", "PianoStop", false, 0);
 }
 
 
 
 void PianoScare(string &in asParent, string &in asChild, int alState)
 {
 
 if(alState == 1)
 {
 
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 }
 if(alState == -1)
 {
 StopSound("general_piano03.ogg", 5);
 }
 }
 
 void pianotimer(string &in asTimer)
 {
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 AddTimer("pianotimer", 18, "pianotimer");
 }
 
 void PianoStop(string &in asParent, string &in asChild, int alState)
 {
 StopSound("PianoScareMusic", 0);
 RemoveTimer("pianotimer");
 SetLeverStuckState("piano_01, 0, true);
 AddPropImpulse("piano_01", 0, 0, 100, "World");
 PlaySoundAtEntity("PianoScareBoom", "break_wood", "piano_1", 0, false);
 CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);
 }
 
 
 
 void UsedKeyOnDoor(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("monsterdoor", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, false);
 RemoveItem("monsterdoorkey");
 }
 
 
 void OnStart()
 {
 AddUseItemCallback("", "monsterdoorkey", "monsterdoor", "UsedKeyOnDoor", true);
 AddEntityCollideCallback("Player", "ScriptArea_1", "PianoScare", false, 0);
 AddEntityCollideCallback("Player", "ScriptArea_2", "PianoStop", false, 0);
 }
 
 
 
 void PianoScare(string &in asParent, string &in asChild, int alState)
 {
 if(alState == 1)
 }
 
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 {
 if(alState == -1)
 StopSound("general_piano03.ogg", 5);
 }
 
 
 void pianotimer(string &in asTimer)
 {
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 AddTimer("pianotimer", 18, "pianotimer");
 }
 
 void PianoStop(string &in asParent, string &in asChild, int alState)
 {
 StopSound("PianoScareMusic", 0);
 RemoveTimer("pianotimer");
 SetLeverStuckState("piano_01, 0, true);
 AddPropImpulse("piano_01", 0, 0, 100, "World");
 PlaySoundAtEntity("PianoScareBoom", "break_wood", "piano_1", 0, false);
 CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);
 }
 
 
 
 void UsedKeyOnDoor(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("monsterdoor", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, false);
 RemoveItem("monsterdoorkey");
 }
 This is how the part looks, Still same error
 
void PianoScare(string &in asParent, string &in asChild, int alState) 
{
  
	if(alState == 1) 
 {  
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false); 
 } 
 if(alState == -1) 
 { 
 StopSound("general_piano03.ogg", 5); 
 } 
} 
			 |  |  
	| 10-23-2011, 02:51 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				 (10-23-2011, 02:51 PM)Lemorz56 Wrote:  This is how the part looks, Still same error
 
 
 void PianoScare(string &in asParent, string &in asChild, int alState)
 {
 
 if(alState == 1)
 {
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 }
 if(alState == -1)
 { <-----------1
 StopSound("general_piano03.ogg", 5);
 }
 } <-----------2
 Two things,
 
1: What is this doing here? your opening something when it's uneeded 
2: I'm assuming that closing is for the number 1.
 
void PianoScare(string &in asParent, string &in asChild, int alState) 
{ 
if(alState == 1) 
{ 
PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false); 
if(alState == -1) 
StopSound("general_piano03.ogg", 5);  
}
 
Im not sure what your doing with the if statement.... explain that aswell if this doesn't work
			 
 |  |  
	| 10-23-2011, 02:56 PM |  |  
	
		| Lemorz56   Junior Member
 
 Posts: 10
 Threads: 3
 Joined: Oct 2011
 Reputation: 
0
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				 (10-23-2011, 02:56 PM)flamez3 Wrote:   (10-23-2011, 02:51 PM)Lemorz56 Wrote:  This is how the part looks, Still same errorTwo things,
 
 
 void PianoScare(string &in asParent, string &in asChild, int alState)
 {
 
 if(alState == 1)
 {
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 }
 if(alState == -1)
 { <-----------1
 StopSound("general_piano03.ogg", 5);
 }
 } <-----------2
 
 1: What is this doing here? your opening something when it's uneeded
 2: I'm assuming that closing is for the number 1.
 
 
 void PianoScare(string &in asParent, string &in asChild, int alState)
 {
 if(alState == 1)
 {
 PlaySoundAtEntity("PianoScareMusic", "general_piano03.ogg", "piano_1", 0, false);
 if(alState == -1)
 StopSound("general_piano03.ogg", 5);
 }
 
 
 Im not sure what your doing with the if statement.... explain that aswell if this doesn't work
 Now the spaces work xD i used pastebin http://pastebin.com/BsWyGkCy 
 
Heres a picture since all spaces get messed up
http://imageshack.us/photo/my-images/707/fegis.jpg/ 
				
(This post was last modified: 10-23-2011, 03:05 PM by Lemorz56.)
 |  |  
	| 10-23-2011, 03:00 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				The sound file is supposed to be: 
general_piano03.snt
 
.ogg is just the music, .snt is how the music is played...
 
try this:
 void PianoScare(string &in asParent, string &in asChild, int alState){    if (alState == 1)        {              PlaySoundAtEntity("PianoScareMusic", "general_piano03.snt", "piano_1", 0, false);        }    if (alState == -1)        {            StopSound("general_piano03.snt", 5);        }}
if that doesn't work, take a screeny of the error when you try to load the map, and upload it somewhere so i can see exactly what it says.
			
 |  |  
	| 10-23-2011, 03:07 PM |  |  
	
		| Elven   Posting Freak
 
 Posts: 862
 Threads: 37
 Joined: Aug 2011
 Reputation: 
26
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				if(alState == 1)
 {
 
 You need to end this with }as well ^^
 
 
 |  |  
	| 10-23-2011, 03:10 PM |  |  
	
		| Lemorz56   Junior Member
 
 Posts: 10
 Threads: 3
 Joined: Oct 2011
 Reputation: 
0
 | 
			| RE: Unexpected End Of File? HELP ME 
 
				 (10-23-2011, 03:07 PM)flamez3 Wrote:  The sound file is supposed to be:
 general_piano03.snt
 
 
 .ogg is just the music, .snt is how the music is played...
 
 try this:
 
 
 
 void PianoScare(string &in asParent, string &in asChild, int alState){    if (alState == 1)        {              PlaySoundAtEntity("PianoScareMusic", "general_piano03.snt", "piano_1", 0, false);        }    if (alState == -1)        {            StopSound("general_piano03.snt", 5);        }}
 if that doesn't work, take a screeny of the error when you try to load the map, and upload it somewhere so i can see exactly what it says.
 it didnt make a difference, Its something about the end i say, Ive marked it in the pic, the error says line 45
http://imageshack.us/photo/my-images/849...lippo.jpg/ |  |  
	| 10-23-2011, 03:13 PM |  |  |