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 EOF Error
helloworld2817 Offline
Junior Member

Posts: 3
Threads: 1
Joined: May 2012
Reputation: 0
#1
Unexpected EOF Error

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?
07-03-2012, 03:40 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Unexpected EOF Error

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!

I rate it 3 memes.
07-03-2012, 03:51 AM
Find
helloworld2817 Offline
Junior Member

Posts: 3
Threads: 1
Joined: May 2012
Reputation: 0
#3
RE: Unexpected EOF Error

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!
07-03-2012, 04:12 AM
Find




Users browsing this thread: 1 Guest(s)