Frictional Games Forum (read-only)

Full Version: ERR: Expected data type
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Every time I try to open my custom map, it says ...main (20,15) : ERR : Expected data type. I tried to solve it myself, but couldn't.
here's the script:

// This runs when the map first starts
void OnStart()
{
AddEntityCollideCallback("Player", "end", "ending", true, 1);
GiveItemFromFile("lantern_" + I, "lantern");
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}

void ending("Player", "end", 1)
{
StartCredits("themonsterswithin.ogg", false, "Ending", "MainCredits", 0);
FadeOut(float 1);
}

Any help?
(01-19-2013, 07:15 PM)vabalas Wrote: [ -> ]Every time I try to open my custom map, it says ...main (20,15) : ERR : Expected data type. I tried to solve it myself, but couldn't.
here's the script:

// This runs when the map first starts
void OnStart()
{
AddEntityCollideCallback("Player", "end", "ending", true, 1);
GiveItemFromFile("lantern_" + I, "lantern");
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}

void ending("Player", "end", 1)
{
StartCredits("themonsterswithin.ogg", false, "Ending", "MainCredits", 0);
FadeOut(float 1);
}

Any help?

Heh, well. You have some things wrong. Let me fix 'em! Big Grin
Good code:

Code:
// This runs when the map first starts
     void OnStart()
     {
     AddEntityCollideCallback("Player", "end", "ending", true, 1);
    GiveItemFromFile("lantern", "lantern.ent");
     }
    
     //===========================================
     // This runs when the player enters the map
     void OnEnter()
     {
     }

     //===========================================
     // This runs when the player leaves the map
     void OnLeave()
     {
     }
    
     void ending(string &in asParent, string &in asChild, int alState)
     {
     StartCredits("themonsterswithin.ogg", false, "Ending", "MainCredits", 0);
     FadeOut(1);
     }
Thanks a lot!