Unexpected End Of File? HELP ME - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Unexpected End Of File? HELP ME (/thread-10941.html) Pages:
1
2
|
Unexpected End Of File? HELP ME - Lemorz56 - 10-23-2011 Unexpected end of file, Whaat? heres my .hps file Code: void OnStart(){ AddUseItemCallback("", "monsterdoorkey", "monsterdoor", "UsedKeyOnDoor", true); // START OF EVERYTHING AddEntityCollideCallback("Player", "ScriptArea_1", "PianoScare", false, 0); AddEntityCollideCallback("Player", "ScriptArea_2", "PianoStop", false, 0);} RE: Unexpected End Of File? HELP ME - flamez3 - 10-23-2011 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 RE: Unexpected End Of File? HELP ME - Lemorz56 - 10-23-2011 (10-23-2011, 02:34 PM)flamez3 Wrote: It's really hard to read but ill give it a shot...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"); } RE: Unexpected End Of File? HELP ME - flamez3 - 10-23-2011 (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"); } RE: Unexpected End Of File? HELP ME - Lemorz56 - 10-23-2011 (10-23-2011, 02:48 PM)flamez3 Wrote:This is how the part looks, Still same error(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 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); } } RE: Unexpected End Of File? HELP ME - flamez3 - 10-23-2011 (10-23-2011, 02:51 PM)Lemorz56 Wrote: This is how the part looks, Still same errorTwo 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 RE: Unexpected End Of File? HELP ME - Lemorz56 - 10-23-2011 (10-23-2011, 02:56 PM)flamez3 Wrote:Now the spaces work xD i used pastebin http://pastebin.com/BsWyGkCy(10-23-2011, 02:51 PM)Lemorz56 Wrote: This is how the part looks, Still same errorTwo things, Heres a picture since all spaces get messed up http://imageshack.us/photo/my-images/707/fegis.jpg/ RE: Unexpected End Of File? HELP ME - flamez3 - 10-23-2011 The sound file is supposed to be: general_piano03.snt .ogg is just the music, .snt is how the music is played... try this: Code: 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. RE: Unexpected End Of File? HELP ME - Elven - 10-23-2011 if(alState == 1) { You need to end this with }as well ^^ RE: Unexpected End Of File? HELP ME - Lemorz56 - 10-23-2011 (10-23-2011, 03:07 PM)flamez3 Wrote: The sound file is supposed to be: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/skrmklippo.jpg/ |