Frictional Games Forum (read-only)
[SCRIPT] Unexpected end of file error problem :( - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Unexpected end of file error problem :( (/thread-24466.html)

Pages: 1 2


Unexpected end of file error problem :( - Radical Batz - 01-26-2014

I don't get it! The code looks good for me, or maybe it's not in the hps file but it keeps getting me this error every time I keep loading my customs tory!

This is the error

---------------------------
FATAL ERROR
---------------------------
FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon/maps/Lifeless_The Abandon.hps'!
main (69, 17) : ERR : Unexpected end of file

---------------------------
OK
---------------------------

Here is my script file

Code:
void OnStart()
{
wakeUp();
}

void wakeUp() {
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(10); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(0, 2);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.5, 2);
SetPlayerCrouching(true); // Simulates being on the ground
PlayMusic("18_amb.ogg", true, 1, 4, 1, true);
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer) {
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
SetPlayerLampOil(29);
GiveSanityDamage(80, false);
GivePlayerDamage(30 , "false" , false, false);
SetPlayerMoveSpeedMul(0.56f);
SetPlayerRunSpeedMul(0);
//SetPlayerLookSpeedMul(0.5);
AddUseItemCallback("", "HollowNeedle", "CellDoor", "UseHollowNeedleOnDoor", true);
}

void UseHollowNeedleOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("CellDoor", false, true);
PlaySoundAtEntity("", "unlock_door.ogg", asEntity, 0, false);
GiveSanityBoostSmall();
RemoveItem(asItem);
}

void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("CellGuardGrunt", true);
AddEnemyPatrolNode("CellGuardGrunt", "Node_1",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_4",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_6",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_10",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_15",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_18",0.001f, "");
}


void UnlockDoor(string &in asEntity, int LeverState)
{
        if(GetLeverState("Lever1") == -1
        && GetLeverState("Lever2") == -1)
     GetLeverState("Lever3") == 1)
     GetLeverState("Lever4") == -1)

        {
                SetSwingDoorLocked("Door", false, true);
                PlaySoundAtEntity("", "unlock_door.snt", "Door", 0, false);
        }
}


I there is anyone who knows what's the problem or can guess where the error is, then pls help! thanks Smile


RE: Unexpected end of file error problem :( - The chaser - 01-26-2014

I see your error, change this:

void UnlockDoor(string &in asEntity, int LeverState)
{
if(GetLeverState("Lever1") == -1
&& GetLeverState("Lever2") == -1)
GetLeverState("Lever3") == 1)
GetLeverState("Lever4") == -1)

{
SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Door", 0, false);
}
}

For this:

void UnlockDoor(string &in asEntity, int LeverState)
{
if(GetLeverState("Lever1") == -1)
&& GetLeverState("Lever2") == -1)
GetLeverState("Lever3") == 1)
GetLeverState("Lever4") == -1)

{
SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Door", 0, false);
}
}


RE: Unexpected end of file error problem :( - Radical Batz - 01-26-2014

It gets me this error instead

---------------------------
FATAL ERROR
---------------------------
FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon/maps/Lifeless_The Abandon.hps'!
main (60, 1) : ERR : Expected expression value

---------------------------
OK
---------------------------


RE: Unexpected end of file error problem :( - The chaser - 01-26-2014

So, it's fixed? That "OK" confuses me.


RE: Unexpected end of file error problem :( - RaideX - 01-26-2014

(01-26-2014, 09:18 PM)The chaser Wrote: So, it's fixed? That "OK" confuses me.

I believe the "OK" is the Button from the error window Big Grin


RE: Unexpected end of file error problem :( - Romulator - 01-27-2014

PHP Code:
if(GetLeverState("Lever1") == -1
&& GetLeverState("Lever2") == -1
GetLeverState
("Lever3") == 1
GetLeverState
("Lever4") == -1

Try that. It corrects the way the brackets are handled.


RE: Unexpected end of file error problem :( - Radical Batz - 01-27-2014

(01-27-2014, 12:21 AM)Romulator Wrote:
PHP Code:
if(GetLeverState("Lever1") == -1
&& GetLeverState("Lever2") == -1
GetLeverState
("Lever3") == 1
GetLeverState
("Lever4") == -1

Try that. It corrects the way the brackets are handled.

well now the error is telling me

---------------------------
FATAL ERROR
---------------------------
FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon/maps/Lifeless_The Abandon.hps'!
main (61, 1) : ERR : Expected ')'

---------------------------
OK
---------------------------


Expected ')', does that mean I did that symbol on somewhere where I'm not supposed to put it, I don't get it In my code I simply have not mispelled anything, did I?


RE: Unexpected end of file error problem :( - PutraenusAlivius - 01-27-2014

No that means that particular symbol WAS SUPPOSED to be there, but it's not.
In the error, the engine expects a ")", but nothing.


RE: Unexpected end of file error problem :( - Radical Batz - 01-27-2014

(01-27-2014, 03:58 PM)JustAnotherPlayer Wrote: No that means that particular symbol WAS SUPPOSED to be there, but it's not.
In the error, the engine expects a ")", but nothing.

but I don't know where it's supposed to be, pls help


RE: Unexpected end of file error problem :( - The chaser - 01-27-2014

Try this then:

void UnlockDoor(string &in asEntity, int LeverState)
{
if(GetLeverState("Lever1") == -1)
&& (GetLeverState("Lever2") == -1)
(GetLeverState("Lever3") == 1)
(GetLeverState("Lever4") == -1)

{
SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Door", 0, false);
}
}