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
Coding problem
Ac33 Offline
Junior Member

Posts: 3
Threads: 1
Joined: May 2012
Reputation: 0
#1
Coding problem

I have an error on my .hps file. It says its on line 18 (I had to clean it up, it's the last line), but I can't see what's wrong there.

void OnStart ()
{
    AddUseItemCallback("", "key1", "mansion_1", "KeyOnDoor", true);
    
    SetEntityPlayerInteractCallback("key1", "ActivateMonster", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity) {
    SetSwingDoorLocked("mansion_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
    RemoveItem("key1);
}

void ActivateMonster(string &in asItem) {
    SetEntityActive("morso1", true);
    AddEnemyPatrolNode("morso1", "PathNodeArea_1", 0, "Idle");
    AddEnemyPatrolNode("morso1", "PathNodeArea_2", 0, "Idle");
}
05-22-2012, 06:08 PM
Find Reply
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Coding problem

In the line
RemoveItem("key1);
is your issue.
You didn't fully enclose key1 in quotation marks,
RemoveItem("key1"); is what you'll want.

05-22-2012, 06:19 PM
Find Reply
Ac33 Offline
Junior Member

Posts: 3
Threads: 1
Joined: May 2012
Reputation: 0
#3
RE: Coding problem

Oh how stupid I am. That must have come when I cleaned the script. Thank you.
05-22-2012, 06:26 PM
Find Reply
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#4
RE: Coding problem

In the future when asking for debugging, best if you tell us everything the game tells us (This was Unexpected end of file?), that we way know that it's not the last line but rather something else.

05-22-2012, 06:59 PM
Find Reply
Ac33 Offline
Junior Member

Posts: 3
Threads: 1
Joined: May 2012
Reputation: 0
#5
RE: Coding problem

Yes it was Unexpected end of file. I'll tell that if I'll have problems in the future,
05-22-2012, 07:18 PM
Find Reply




Users browsing this thread: 1 Guest(s)