Frictional Games Forum (read-only)
Unexpected EOF Error - 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 EOF Error (/thread-16702.html)



Unexpected EOF Error - helloworld2817 - 07-03-2012

Hi all,
I think this thing has finally beaten me. I'm at a loss for solutions. My script:
Quote: // Run first time starting map
void OnStart()
{
PreloadSound("male_terrified_5.snt");
SetEntityPlayerInteractCallback("scaryhall", "HallScare", true);
}

void HallScare(string &in asEntity)
{
StartScreenShake("0.3f, "5.5f", "1.0f", "1.0f");
PlaySoundAtEntity("", "male_terrified_5.snt", "ScaryHall", 0.0f, false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);

}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Throws me an unexpected EOF error at the last line (29,2 - which I'm confused at because there's only one character). I've taken out functions and added them in in an attempt to figure out where the issue was, but it keeps saying the same thing.
Any ideas?

P.S. On a somewhat related note, is a screen shake sufficient enough to make a dynamic painting fall off a wall? Or is that a separate piece of code?


RE: Unexpected EOF Error - Adny - 07-03-2012

I have found your problem:

You're not supposed to put float (decimal number) values inside of quotation ("") marks. Float and Integer values are only numbers; only string need to be inside quotation marks. Here is the revised script:


// Run first time starting map
void OnStart()
{
PreloadSound("male_terrified_5.snt");
SetEntityPlayerInteractCallback("scaryhall", "HallScare", true);
}

void HallScare(string &in asEntity)
{
StartScreenShake(0.3f, 5.5f, 1.0f, 1.0f);
PlaySoundAtEntity("", "male_terrified_5.snt", "ScaryHall", 0.0f, false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);

}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}

To answer your second question, screen shake has no effect on objects in games, it's simply another camera effect (like blur, fov, sepia, etc). The function you're looking for to knock the painting off the wall is addpropforce:

AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);


Hope that helped!


RE: Unexpected EOF Error - helloworld2817 - 07-03-2012

Ahhh thank you very much! +rep
(07-03-2012, 03:51 AM)andyrockin123 Wrote: I have found your problem:

You're not supposed to put float (decimal number) values inside of quotation ("") marks. Float and Integer values are only numbers; only string need to be inside quotation marks. Here is the revised script:


// Run first time starting map
void OnStart()
{
PreloadSound("male_terrified_5.snt");
SetEntityPlayerInteractCallback("scaryhall", "HallScare", true);
}

void HallScare(string &in asEntity)
{
StartScreenShake(0.3f, 5.5f, 1.0f, 1.0f);
PlaySoundAtEntity("", "male_terrified_5.snt", "ScaryHall", 0.0f, false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);

}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}

To answer your second question, screen shake has no effect on objects in games, it's simply another camera effect (like blur, fov, sepia, etc). The function you're looking for to knock the painting off the wall is addpropforce:

AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);


Hope that helped!