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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected end of file
Xallikk Offline
Junior Member

Posts: 35
Threads: 7
Joined: Jun 2016
Reputation: 0
#1
Unexpected end of file

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);
}

The ones at the front always die first...
06-07-2016, 02:02 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#2
RE: Unexpected end of file

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

06-07-2016, 06:34 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#3
RE: Unexpected end of file

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.

06-07-2016, 06:47 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#4
RE: Unexpected end of file

(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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
06-07-2016, 08:08 AM
Find
Xallikk Offline
Junior Member

Posts: 35
Threads: 7
Joined: Jun 2016
Reputation: 0
#5
RE: Unexpected end of file

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

The ones at the front always die first...
06-07-2016, 09:23 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Unexpected end of file

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

06-07-2016, 10:48 PM
Find
Xallikk Offline
Junior Member

Posts: 35
Threads: 7
Joined: Jun 2016
Reputation: 0
#7
RE: Unexpected end of file

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);
}

The ones at the front always die first...
(This post was last modified: 06-08-2016, 01:50 AM by Xallikk.)
06-08-2016, 01:50 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#8
RE: Unexpected end of file

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: (Select All)
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: (Select All)
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 );


(This post was last modified: 06-08-2016, 02:18 AM by Daemian.)
06-08-2016, 02:08 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#9
RE: Unexpected end of file

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.

06-08-2016, 02:44 AM
Find
Xallikk Offline
Junior Member

Posts: 35
Threads: 7
Joined: Jun 2016
Reputation: 0
#10
RE: Unexpected end of file

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!

The ones at the front always die first...
06-08-2016, 03:48 AM
Find




Users browsing this thread: 1 Guest(s)