Frictional Games Forum (read-only)

Full Version: Error with .hps file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. When I try to test custom story level, i've get that error:
main (25,2) Unexpected end of the file

This is my .hps file:
void OnStart()
{
AddEntityCollideCallback("Player", "antonydead", "Message1", true, 1);
AddEntityCollideCallback("Player", "rozdzial1", "Message2", true, 1);
AddEntityCollideCallback("Player", "trup1", "Message3", true, 1);
AddUseItemCallback("","key1","door1","Door,true);
}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "AntonyDead", 10);
}
void Message2(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Rozdzial1", 10);
}
void Message3(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Trup1", 10);
}
void Door(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("",unlock_door",door1",0,false);
}
Quotation marks.
PHP Code:
PlaySoundAtEntity("",unlock_door",door1",0,false); 

It should be like this:
PHP Code:
PlaySoundAtEntity("","unlock_door","door1",0,false); 
(01-02-2015, 01:52 PM)Daemian Wrote: [ -> ]Quotation marks.
PHP Code:
PlaySoundAtEntity("",unlock_door",door1",0,false); 

It should be like this:
PHP Code:
PlaySoundAtEntity("","unlock_door","door1",0,false); 

Nope. That same error.

I've try everythink, what i can. Nothing happens. That same error.
That happen when i've add that lines:
void Door(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",0,false);
RemoveItem("key1");
}
void Door(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",0,false);
RemoveItem("key1");
}

Hmm. Why wouldn't this work? This should work! I think that there's another error, but not here. Can you please give us your entire FULL hps file?

EDIT: Emphasizing the FULL
Your Message1, Message2 and Measage3 routines have the asParent and asChild flipped.

Instead of:
PHP Code:
void Message1(string &in asChildstring &in asParentint alState

It should be:
PHP Code:
void Message1(string &in asParentstring &in asChildint alState

The same applies to Message2 and Message3 as well.
But Romu those are just names. It shouldn't matter.

Maybe he's just looking at the wrong hps.