Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Error with .hps file
MaksoPL Offline
Member

Posts: 51
Threads: 26
Joined: Mar 2014
Reputation: 0
#1
Error with .hps file

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);
}
01-02-2015, 01:44 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#2
RE: Error with .hps file

Quotation marks.
PHP Code: (Select All)
PlaySoundAtEntity("",unlock_door",door1",0,false); 

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

01-02-2015, 01:52 PM
Find
MaksoPL Offline
Member

Posts: 51
Threads: 26
Joined: Mar 2014
Reputation: 0
#3
RE: Error with .hps file

(01-02-2015, 01:52 PM)Daemian Wrote: Quotation marks.
PHP Code: (Select All)
PlaySoundAtEntity("",unlock_door",door1",0,false); 

It should be like this:
PHP Code: (Select All)
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");
}
(This post was last modified: 01-02-2015, 02:27 PM by MaksoPL.)
01-02-2015, 01:54 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Error with .hps file

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 01-03-2015, 05:16 AM by PutraenusAlivius.)
01-03-2015, 05:14 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#5
RE: Error with .hps file

Your Message1, Message2 and Measage3 routines have the asParent and asChild flipped.

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

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

The same applies to Message2 and Message3 as well.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
01-03-2015, 05:33 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#6
RE: Error with .hps file

But Romu those are just names. It shouldn't matter.

Maybe he's just looking at the wrong hps.

(This post was last modified: 01-03-2015, 07:41 AM by Daemian.)
01-03-2015, 07:40 AM
Find




Users browsing this thread: 1 Guest(s)