Xallikk
Junior Member
Posts: 35
Threads: 7
Joined: Jun 2016
Reputation:
0
|
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 |
|
Daemian
Posting Freak
Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation:
49
|
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 |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
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 |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
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
|
|
06-07-2016, 08:08 AM |
|
Xallikk
Junior Member
Posts: 35
Threads: 7
Joined: Jun 2016
Reputation:
0
|
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 |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
Xallikk
Junior Member
Posts: 35
Threads: 7
Joined: Jun 2016
Reputation:
0
|
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 |
|
Daemian
Posting Freak
Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation:
49
|
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.
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); }
Why not like this? :
void rockfall_1(string &in asParent, string &in asChild, int 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", asChild, 0, false ); }
(This post was last modified: 06-08-2016, 02:18 AM by Daemian.)
|
|
06-08-2016, 02:08 AM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
Xallikk
Junior Member
Posts: 35
Threads: 7
Joined: Jun 2016
Reputation:
0
|
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 |
|
|