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
Unexpected end of file problem, Need help NOW!
JohnS0N Offline
Junior Member

Posts: 3
Threads: 3
Joined: Sep 2015
Reputation: 0
#1
Exclamation  Unexpected end of file problem, Need help NOW!

Without further ado, Here's the .hps file:

void OnStart()
{
AddUseItemCallback("", "Doorkey1", "Roomdoor1", "UsedKeyOnDoor" true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Roomdoor1", false, true);
PlaySoundAtEntity("", ""unlock_door", "Roomdoor1", 0, false);
RemoveItem("Doorkey1");
}

void OnEnter()
{
PlayMusic("Level1Theme.ogg", true, 0.8, 2, 1, true);
}

void OnExit()
{

}
09-18-2015, 12:08 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Unexpected end of file problem, Need help NOW!

(09-18-2015, 12:08 PM)JohnS0N Wrote: AddUseItemCallback("", "Doorkey1", "Roomdoor1", "UsedKeyOnDoor" true);
You forgot a comma between "UsedKeyOnDoor" and true

(09-18-2015, 12:08 PM)JohnS0N Wrote: PlaySoundAtEntity("", ""unlock_door", "Roomdoor1", 0, false);
You have too many quotation signs. Remember that the number of quotation signs should always be even. In this line you have 7.

(09-18-2015, 12:08 PM)JohnS0N Wrote: PlayMusic("Level1Theme.ogg", true, 0.8, 2, 1, true);
Remember to put an f after decimals. You have to, because Amnesia uses floats.


Unexpected end of file usually means you have an uneven number of "quotation marks", (parenthesizes) or {brackets}.

Trying is the first step to success.
(This post was last modified: 09-18-2015, 01:16 PM by FlawlessHappiness.)
09-18-2015, 12:46 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: Unexpected end of file problem, Need help NOW!

You don't actually have to put 'f' after a float (decimal) value. The only thing that happens is that Amnesia does an unnecessary conversion, as it assumes the value to be a double instead of a float. The conversion doesn't really affect anything, but if you want a clean log, you might wanna use the 'f' as it triggers a warning without.

09-18-2015, 08:09 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Unexpected end of file problem, Need help NOW!

(09-18-2015, 08:09 PM)Mugbill Wrote: You don't actually have to put 'f' after a float (decimal) value. The only thing that happens is that Amnesia does an unnecessary conversion, as it assumes the value to be a double instead of a float. The conversion doesn't really affect anything, but if you want a clean log, you might wanna use the 'f' as it triggers a warning without.

It's good practice Tongue

Trying is the first step to success.
09-18-2015, 09:07 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: Unexpected end of file problem, Need help NOW!

True that.

09-18-2015, 10:44 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Unexpected end of file problem, Need help NOW!

Quote:AddUseItemCallback("", "Doorkey1", "Roomdoor1", "UsedKeyOnDoor", true);

You missed a comma after the function UsedKeyOnDoor.

Quote:PlaySoundAtEntity("", ""unlock_door", "Roomdoor1", 0, false);

You have an extra quotation mark.

"Veni, vidi, vici."
"I came, I saw, I conquered."
09-19-2015, 01:17 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#7
RE: Unexpected end of file problem, Need help NOW!

Both of those were already pointed out, ya know. No need to bloat the thread.

09-19-2015, 07:01 PM
Find
JohnS0N Offline
Junior Member

Posts: 3
Threads: 3
Joined: Sep 2015
Reputation: 0
#8
RE: Unexpected end of file problem, Need help NOW!

Hey guys, I got this fixed now. Thanks! but I need your help once more!

https://www.frictionalgames.com/forum/thread-44418.html
04-17-2016, 06:17 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#9
RE: Unexpected end of file problem, Need help NOW!

(04-17-2016, 06:17 PM)JohnS0N Wrote: Hey guys, I got this fixed now. Thanks! but I need your help once more!

https://www.frictionalgames.com/forum/thread-44418.html

Hello - you don't need to bump an old thread to inform others about your issue. Your other post is at the top of the subforum, and will be noticed by other users.

Locking~

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-17-2016, 06:26 PM
Find




Users browsing this thread: 1 Guest(s)