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 [FIRST SCRIPT] unexpected end of file
Peldan Offline
Junior Member

Posts: 16
Threads: 3
Joined: Mar 2012
Reputation: 0
#1
[FIRST SCRIPT] unexpected end of file

Hey guys!

This is my first script ever, I am just playing around a little bit. Also took some help from tutorials.
However, when I added the Entity collision for the third room area, I started to get this error:

"Unexpected end of file". Any idea what's wrong? Confused

http://pastebin.com/fzi7bta2 Here's the code <-

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""RoomTwoArea""CollideRoomTwo"true1);
    
AddEntityCollideCallBack("Player""RoomThreeArea""CollideRoomThree"true1");
    AddUseItemCallback("", "
key_study_1", "mansion_2", "UnlockDD", true);
    AddUseItemCallback("", "
ceremony_knife_1", "work_desk_door_1", "UnlockDD", true);
    GiveItemFromFile("
lantern", "lantern.ent");
    SetPlayerLampOil(100.0f);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("
mansion_2", true, true);
    StartPlayerLookAt("
mansion_2", 10, 10, "");
    PlaySoundAtEntity("", "
00_laugh.snt", "mansion_2", 0, false);
    AddTimer("
close", 1, "stoplook");
}

void CollideRoomThree(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("
agrippa_head_1", true);
    StartPlayerLookAt("
agrippa_head_1", 10, 10, "");
    PlaySoundAtEntity("", "
00_laugh.snt", "graveyard_corpse_1", 0, false);
    AddTimer("
lolol", 1, "stoplook");
    SetPropHealth("
pot_explode", 0);
}

void UnlockDD(string &in item, string &in door)
{
    SetSwingDoorLocked(door, false, true);
    PlaySoundAtEntity("", "
scare_slam_door.snt", door, 0, false);
    RemoveItem(item);
}

void stoplook(string &in asTimer)
{
    StopPlayerLookAt();
}

void OnEnter()
{

}

void OnLeave()
{



EDIT: Finally found that little bastard Wink It was this:
PHP Code: (Select All)
AddEntityCollideCallBack("Player""RoomThreeArea""CollideRoomThree"true1"); 
(This post was last modified: 03-04-2012, 04:46 PM by Peldan.)
03-04-2012, 04:10 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#2
RE: [FIRST SCRIPT] unexpected end of file

Looks like you have an extra " at the end of one of your AddEntityCollideCallbacks. Try this.
void OnStart()
{
    AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
    AddEntityCollideCallBack("Player", "RoomThreeArea", "CollideRoomThree", true, 1);
    AddUseItemCallback("", "key_study_1", "mansion_2", "UnlockDD", true);
    AddUseItemCallback("", "ceremony_knife_1", "work_desk_door_1", "UnlockDD", true);
    GiveItemFromFile("lantern", "lantern.ent");
    SetPlayerLampOil(100.0f);
}

(This post was last modified: 03-04-2012, 04:44 PM by Apjjm.)
03-04-2012, 04:43 PM
Find
Peldan Offline
Junior Member

Posts: 16
Threads: 3
Joined: Mar 2012
Reputation: 0
#3
RE: [FIRST SCRIPT] unexpected end of file

(03-04-2012, 04:43 PM)Apjjm Wrote: Looks like you have an extra " at the end of one of your AddEntityCollideCallbacks. Try this.
-snip-
Yeah, I noticed that :p

Got another error now, lol. I remember solving this before on my own, but I don't remember how!

Error:
Quote: main(5,2) : ERR : No matching signatures to blablablabla AddEntityCollideCallBack


Any idea what's wrong? Nothing has changed in my previous code except the little ".
The areanames are correct..
03-04-2012, 04:51 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#4
RE: [FIRST SCRIPT] unexpected end of file

Method names are case-sensitive. Try using "AddEntityCollideCallback" for the second one.
03-04-2012, 04:55 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: [FIRST SCRIPT] unexpected end of file

The "b" in AddEntityCollideCallback is not supposed to be capitalized

Edit: I dun got ninja'd >_>

(This post was last modified: 03-04-2012, 04:57 PM by flamez3.)
03-04-2012, 04:56 PM
Find
Peldan Offline
Junior Member

Posts: 16
Threads: 3
Joined: Mar 2012
Reputation: 0
#6
RE: [FIRST SCRIPT] unexpected end of file

Stupid of me.. Thank you!
03-04-2012, 04:58 PM
Find




Users browsing this thread: 2 Guest(s)