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
HPL2 Help?
raptorhunter6 Offline
Junior Member

Posts: 33
Threads: 4
Joined: Jun 2012
Reputation: 0
#1
HPL2 Help?

I get a "Fatal Error: Could Not Load Script File 'maps/castlehall.hps'! main (13,1) ERR:Unexpected '}' "

My Hps file is:


////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomOneArea", "CollideRoomOne", true, 1);
}

void CollideRoomOne(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_1", true, true);
}

{
SetEntityPlayerInteractCallback("Main_Key", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "idle");
}

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "Main_Key", "MainDoorOne", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("MainDoorOne", false, true);
PlaySoundAtEntity("", "unlock_door", "MainDoorOne", 0, false);
RemoveItem("Main_Key");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


-------------------------> Its simple but its what I need for this map so far, it worked fine until I added:

" {
SetEntityPlayerInteractCallback("Main_Key", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "idle");
} "


I'm sorry if its something simple or something, I'm just beginning to use the Editor + Scripting, thank you in advance!
(This post was last modified: 07-26-2012, 08:35 AM by Your Computer.)
07-26-2012, 08:32 AM
Find Reply
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: HPL2 Help?

Code blocks need to be either part of a function definition or within a function body.

Tutorials: From Noob to Pro
07-26-2012, 08:36 AM
Website Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: HPL2 Help?

The:

"SetEntityPlayerInteractCallback("Main_Key", "ActivateMonster", true);"

Needs to be under: "void OnStart()", not in its own function.

I rate it 3 memes.
07-26-2012, 08:36 AM
Find Reply
raptorhunter6 Offline
Junior Member

Posts: 33
Threads: 4
Joined: Jun 2012
Reputation: 0
#4
RE: HPL2 Help?

Thank you! Worked perfectly, I just wasn't sure how to add that part but thanks to your speedy replies I got it to work. Thank you Smile
07-26-2012, 08:49 AM
Find Reply




Users browsing this thread: 1 Guest(s)