Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected end of file + another error
Author Message
erikhoj Offline
Junior Member

Posts: 1
Joined: Jun 2012
Reputation: 0
Post: #1
Unexpected end of file + another error
Hello forum.
I really need help with an issue, it's about my custom story script. Whenever i load up the custom story i get an unexpected end of file error at 52:3.
I have tried rewriting the script, looking for errors, but alas, i never found one. So i hope that some of you guys could help me out.
Here's the script:


///////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Potion_Oil_Scare1", "Monster_Grunt_Spawn", true);
AddEntityCollideCallback("Player", "CabinetJumpScare", "CabinetJumpScare_Func", true, 1);
}

///////////////////
// Place all your functions in here!

void CabinetJumpScare_Func(string &in asParent, string &in asChild, int alState)
{
AddTimer("T1", 11, "CabinetDoorsOpen2");
}

void CabinetDoorsOpen(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
SetSwingDoorClosed("Cabinet_Simple_1", false, false);
SetMoveObjectState("Cabinet_Simple_1", 1);
PlaySoundAtEntity("", "21_scream10.ogg", "Player", 0, false);
}

void Monster_Grunt_Spawn(string &inItem)
{
SetEntityActive("Monster_Grunt1", true);
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_6", 2, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_4", 5, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_8", 0, "");
}

///////////////////
// Run when entering map
void OnEnter()
{
}

// Run when leaving map
void OnLeave()
{
} -- This is where it says the error is!

Also, i have another error.
This script, and the map the script is attached to, is supposed to be a second map. So that the player would enter a level door, and progress to this map. But whenever i enter the door, my game crashes. I don't even get a script error, is this caused by the error in the script? Or is it something else, i remember reading something about map caches. Thanks!
(This post was last modified: 06-07-2012 02:29 PM by erikhoj.)
06-07-2012 02:28 PM
Find all posts by this user Quote this message in a reply
Traggey Offline
The Doctor

Posts: 1,941
Joined: Feb 2012
Reputation: 109
Post: #2
RE: Unexpected end of file + another error
Posted in the wrong section, moving this.

(This post was last modified: 06-07-2012 02:58 PM by Traggey.)
06-07-2012 02:58 PM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #3
RE: Unexpected end of file + another error
Read my comments.

//////////////////
// Run first time starting map
void OnStart()
{
    SetEntityPlayerInteractCallback("Potion_Oil_Scare1", "Monster_Grunt_Spawn", true);
    AddEntityCollideCallback("Player", "CabinetJumpScare", "CabinetJumpScare_Func", true, 1);
}

///////////////////
// Place all your functions in here!

void CabinetJumpScare_Func(string &in asParent, string &in asChild, int alState)
{
    AddTimer("T1", 11, "CabinetDoorsOpen2");
}

void CabinetDoorsOpen(string &in asTimer)
{
    //why was there a string x = asTimer here? That's just a waste of resources, just make asTimer the conditional check, it's the same thing
    if(asTimer == "T1")
    {
        SetSwingDoorClosed("Cabinet_Simple_1", false, false);
        SetMoveObjectState("Cabinet_Simple_1", 1);
        PlaySoundAtEntity("", "21_scream10.ogg", "Player", 0, false);
    }
} //you forgot to close this function, leading to the end of file error

//when you're doing interact callbacks, asEntity is the parameter, not &inItem which is what you were doing before
void Monster_Grunt_Spawn(string &in asEntity)
{
    SetEntityActive("Monster_Grunt1", true);
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_1", 0, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_6", 2, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_4", 5, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_7", 0, "");
    AddEnemyPatrolNode("Monster_Grunt1", "PathNodeArea_8", 0, "");
}

///////////////////
// Run when entering map
void OnEnter()
{
}

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

Check me out at my youtube channel: http://www.youtube.com/user/Putmalk?feature=mhee

I post videos of my Amnesia creations.
06-07-2012 04:12 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,242
Joined: Jul 2011
Reputation: 216
Post: #4
RE: Unexpected end of file + another error
You forgot to close the CabinetDoorsOpen function body.

Edit: the user created two of the same topics. Merging.

Tutorials: From Noob to Pro
(This post was last modified: 06-07-2012 06:01 PM by Your Computer.)
06-07-2012 05:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)