Frictional Games Forum (read-only)
[SCRIPT] ERR: Expected data type - 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: [SCRIPT] ERR: Expected data type (/thread-19986.html)



ERR: Expected data type - vabalas - 01-19-2013

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?


RE: ERR: Expected data type - The chaser - 01-19-2013

(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);
     }



RE: ERR: Expected data type - vabalas - 01-20-2013

Thanks a lot!