Frictional Games Forum (read-only)

Full Version: Unexpected End Of File? HELP ME
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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);}


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");}
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. Big Grin

Also, give us the line and character line on where the unexpected end of file isSmile
(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. Big Grin

Also, give us the line and character line on where the unexpected end of file isSmile
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");
}
(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)flamez3 Wrote: [ -> ]
(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");
}
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)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)flamez3 Wrote: [ -> ]
(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
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/
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.

if(alState == 1)
{

You need to end this with }as well ^^
(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:


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.
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/
Pages: 1 2