Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HPL2 Help?
Author Message
raptorhunter6 Offline
Junior Member

Posts: 21
Joined: Jun 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,236
Joined: Jul 2011
Reputation: 216
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Adny Offline
Posting Freak

Posts: 1,752
Joined: Mar 2012
Reputation: 169
Post: #3
RE: HPL2 Help?
The:

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

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

Timorem and Friends are Hungryâ„¢
07-26-2012 08:36 AM
Find all posts by this user Quote this message in a reply
raptorhunter6 Offline
Junior Member

Posts: 21
Joined: Jun 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)