JohnS0N
Junior Member
Posts: 3
Threads: 3
Joined: Sep 2015
Reputation:
0
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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.
|
|
09-18-2015, 12:46 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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
Trying is the first step to success.
|
|
09-18-2015, 09:07 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Unexpected end of file problem, Need help NOW!
True that.
|
|
09-18-2015, 10:44 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
JohnS0N
Junior Member
Posts: 3
Threads: 3
Joined: Sep 2015
Reputation:
0
|
|
04-17-2016, 06:17 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
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
|
|
04-17-2016, 06:26 PM |
|
|