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


Thread Closed 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected end of file problem, Need help NOW!
Author Message
JohnS0N Offline
Junior Member

Posts: 3
Joined: Sep 2015
Reputation: 0
Post: #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 all posts by this user
FlawlessHappiness Offline
Posting Freak

Posts: 3,982
Joined: Mar 2012
Reputation: 171
Post: #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}.

Being happy 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 all posts by this user
Mudbill Offline
Posting Freak

Posts: 3,527
Joined: Apr 2013
Reputation: 166
Post: #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 all posts by this user
FlawlessHappiness Offline
Posting Freak

Posts: 3,982
Joined: Mar 2012
Reputation: 171
Post: #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

Being happy is the first step to success.
09-18-2015 09:07 PM
Find all posts by this user
Mudbill Offline
Posting Freak

Posts: 3,527
Joined: Apr 2013
Reputation: 166
Post: #5
RE: Unexpected end of file problem, Need help NOW!

True that.

09-18-2015 10:44 PM
Find all posts by this user
PutraenusAlivius Offline
Posting Freak

Posts: 4,712
Joined: Dec 2012
Reputation: 119
Post: #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 all posts by this user
Mudbill Offline
Posting Freak

Posts: 3,527
Joined: Apr 2013
Reputation: 166
Post: #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 all posts by this user
JohnS0N Offline
Junior Member

Posts: 3
Joined: Sep 2015
Reputation: 0
Post: #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 all posts by this user
Romulator Offline
G'day mate! :3

Posts: 3,454
Joined: Jan 2013
Reputation: 190
Post: #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#4942
04-17-2016 06:26 PM
Find all posts by this user
Thread Closed 




User(s) browsing this thread: 1 Guest(s)