Frictional Games Forum (read-only)

Full Version: Unexpected end of file problem, Need help NOW!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)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}.
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)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
True that.
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.
Both of those were already pointed out, ya know. No need to bloat the thread.
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)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~