Frictional Games Forum (read-only)
Unexpected end of file - 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: Unexpected end of file (/thread-49057.html)



Unexpected end of file - Xallikk - 06-07-2016

UUUUgghgghgghghg... Anyway, whenever I load the custom story it says (29,2) unexpected end of file, here is the code. I can't see the problem but maybe the heat's getting to me...

void OnStart()
{
AddTimer("scare", 3, "TimerPlayerReact");
AddTimer("breath", 4.5, "TimerPlayerReact");
AddTimer("breath", 6.5, "TimerPlayerReact");
AddTimer("saw3", 12, "TimerTorture");
AddTimer("saw_voice3", 11, "TimerTorture");
AddEntityCollideCallback("Player", "kista1", "kista1", true, 1);
}

void kista1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("maidenopen", true);
SetEntityActive("maidenclosed", false);
CreateParticleSystemEntity("", "ps_iron_maiden_event_smoke.ps", "ScriptArea_1, false);
PlaySoundAtEntity("maidenopen", "24_iron_maiden", "maidenopen", 0, false);
StartScreenShake(0.3, 0.3, 0, 0.3);
AddPlayerSanity(-10);
}

void TimerPlayerReact(string &in asTimer)
{
PlayGuiSound("react_" + asTimer, 0.6);
}

void TimerTorture(string &in asTimer)
{
PlayGuiSound("23_" + asTimer, 0.6);
}


RE: Unexpected end of file - Daemian - 06-07-2016

I found one: (in red)
CreateParticleSystemEntity("", "ps_iron_maiden_event_smoke.ps", "ScriptArea_1", false);


RE: Unexpected end of file - 7heDubz - 06-07-2016

in the error code the first number corresponds the the incorrect line of code.
(29, 2)
^ - First Number

The Second refers to how many characters over the error is.


RE: Unexpected end of file - Romulator - 06-07-2016

(06-07-2016, 06:34 AM)Daemian Wrote: I found one: (in red)
CreateParticleSystemEntity("", "ps_iron_maiden_event_smoke.ps", "ScriptArea_1", false);

And just to add onto this, it is:

CreateParticleSystemAtEntity
Not
CreateParticleSystemEntity


RE: Unexpected end of file - Xallikk - 06-07-2016

I did that, now I'm getting the same error at 36,2.


RE: Unexpected end of file - Mudbill - 06-07-2016

Are you sure this is your whole script? Because there aren't even 36 lines in it, so I don't think it is.


RE: Unexpected end of file - Xallikk - 06-08-2016

K here is the update script, now it's (14,1) Unexpected token {, and (47,2) Unexpected end of file

void OnStart()
{
AddTimer("scare", 3, "TimerPlayerReact");
AddTimer("breath", 4.5, "TimerPlayerReact");
AddTimer("breath", 6.5, "TimerPlayerReact");
AddTimer("saw3", 12, "TimerTorture");
AddTimer("saw_voice3", 11, "TimerTorture");
AddEntityCollideCallback("Player", "kista1", "kista1", true, 1);
SetEntityCollideCallback("Player", "scr_rockfall", "rockfall_1", true, 1);
}

void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS)
{
CreateParticleSystemAtEntity("rocksmoke1", "ps_impact_dust_high.ps", "rocksmoke_1", false);
CreateParticleSystemAtEntity("rocksmoke2", "ps_impact_dust_high.ps", "rocksmoke_2", false);
CreateParticleSystemAtEntity("rocksmoke3", "ps_impact_dust_high.ps", "rocksmoke_3", false);
CreateParticleSystemAtEntity("rocksmoke4", "ps_impact_dust_high.ps", "rocksmoke_4", false);
CreateParticleSystemAtEntity("rocksmoke5", "ps_impact_dust_high.ps", "rocksmoke_5", false);
CreateParticleSystemAtEntity("rocksmoke6", "ps_impact_dust_high.ps", "rocksmoke_6", false);
CreateParticleSystemAtEntity("rocksmoke7", "ps_impact_dust_high.ps", "rocksmoke_7", false);
}

void rockfall_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("CaveIn", true);
PlayEntityAtEntity("cavein", "explosion_rock_large.snt", "Player", 0.01f, false);
}
void kista1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("maidenopen", true);
SetEntityActive("maidenclosed", false);
CreateParticleSystemEntity("", "ps_iron_maiden_event_smoke.ps", "ScriptArea_1, false);
PlaySoundAtEntity("maidenopen", "24_iron_maiden", "maidenopen", 0, false);
StartScreenShake(0.3, 0.3, 0, 0.3);
AddPlayerSanity(-10);
}

void TimerPlayerReact(string &in asTimer)
{
PlayGuiSound("react_" + asTimer, 0.6);
}

void TimerTorture(string &in asTimer)
{
PlayGuiSound("23_" + asTimer, 0.6);
}


RE: Unexpected end of file - Daemian - 06-08-2016

You should use this how to set up notepad++ for Amnesia hps to code in hps to detect this kind of errors.
And if you don't have this, bookmark it too. HPL2 script functions. You'll need it very often.

You can't declare two functions with the same name, CreateParticleSystemAtEntity already exists.

PHP Code:
void CreateParticleSystemAtEntity(stringasPSNamestringasPSFilestringasEntitybool abSavePS)
{
CreateParticleSystemAtEntity("rocksmoke1""ps_impact_dust_high.ps""rocksmoke_1"false); 
CreateParticleSystemAtEntity("rocksmoke2""ps_impact_dust_high.ps""rocksmoke_2"false); 
CreateParticleSystemAtEntity("rocksmoke3""ps_impact_dust_high.ps""rocksmoke_3"false); 
CreateParticleSystemAtEntity("rocksmoke4""ps_impact_dust_high.ps""rocksmoke_4"false); 
CreateParticleSystemAtEntity("rocksmoke5""ps_impact_dust_high.ps""rocksmoke_5"false); 
CreateParticleSystemAtEntity("rocksmoke6""ps_impact_dust_high.ps""rocksmoke_6"false); 
CreateParticleSystemAtEntity("rocksmoke7""ps_impact_dust_high.ps""rocksmoke_7"false); 


Why not like this? :
PHP Code:
void rockfall_1(string &in asParentstring &in asChildint alState)
{
SetEntityActive("CaveIn"true);
CreateParticleSystemAtEntity("rocksmoke1""ps_impact_dust_high.ps""rocksmoke_1"false); 
CreateParticleSystemAtEntity("rocksmoke2""ps_impact_dust_high.ps""rocksmoke_2"false); 
CreateParticleSystemAtEntity("rocksmoke3""ps_impact_dust_high.ps""rocksmoke_3"false); 
CreateParticleSystemAtEntity("rocksmoke4""ps_impact_dust_high.ps""rocksmoke_4"false); 
CreateParticleSystemAtEntity("rocksmoke5""ps_impact_dust_high.ps""rocksmoke_5"false); 
CreateParticleSystemAtEntity("rocksmoke6""ps_impact_dust_high.ps""rocksmoke_6"false); 
CreateParticleSystemAtEntity("rocksmoke7""ps_impact_dust_high.ps""rocksmoke_7"false); 
PlaySoundAtEntity"""explosion_rock_large.snt"asChild0false );




RE: Unexpected end of file - Mudbill - 06-08-2016

CreateParticleSystemEntity("", "ps_iron_maiden_event_smoke.ps", "ScriptArea_1, false);

Also this line is still not fixed. Missing "At" from the function name, and the quote by ScriptArea_1.


RE: Unexpected end of file - Xallikk - 06-08-2016

Alright it all works now, and it doesn't look half bad. Thanks so much for the help, would probably still be stuck on this if you guys weren't here!