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
Script Help ERR: Expected data type
vabalas Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jan 2013
Reputation: 0
#1
ERR: Expected data type

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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: ERR: Expected data type

(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:

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 01-19-2013, 07:37 PM by The chaser.)
01-19-2013, 07:36 PM
Find
vabalas Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jan 2013
Reputation: 0
#3
RE: ERR: Expected data type

Thanks a lot!
01-20-2013, 10:25 AM
Find




Users browsing this thread: 1 Guest(s)