Frictional Games Forum (read-only)

Full Version: FATAL ERROR
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Can someone please help??

I keep getting this error:[attachment=1622]
Please show uss your script file (Dormitry.hps). The problem is inside of it.
/////////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("12_amb.ogg", true, 100.0, 0.0, 1, true);
}

{
AddEntityCollideCallback("Player", "Key_Quest_Area", "GetKeyQuest", true, 1);
void GetKeyQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("keyquest", "KeyQuest");
}
AddEntityCollideCallback("Player", "Key_Complete_Area", "FinishKeyQuest", true, 1);
void FinishKeyQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("keyquest", "KeyQuest");
}

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "eastwingkey_1", "eastwingdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("eastwingdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "eastwingdoor", 0, false);
RemoveItem("eastwingkey_1");
}





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

}








I kinda edited it to see if I could fix the problem on my own. That's why it looks like so.

Now the Error is: main (8,1): ERR: Unexpected token '{'
{ is being used to open code blocks and } is used to close those blocks. Every block need to have a name, which means you cannot do something like this

{
something
}

You have to do like this

void SomeFunction( SomeInput)
{
something
}

Also, your collide and use call backs need to be in OnStart block.
And remember, it is easier for you if you edit the script while the map is open

Like it says here http://wiki.frictionalgames.com/hpl2/tut...t_beginner in :

"Open the Map in Amnesia BEFORE you Edit Script!"

Thanks guys, I got it to work again.. But I just ran into another error >:/

FATAL ERROR

main: (24,1): ERR: No matching signatures to:
'SetPlayerLookAt(string@&, const float, const float, string@&);

/////////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("07_amb.ogg", true, 100.0, 0.0, 1, true);
AddEntityCollideCallback("Player", "Key_Quest_Area", "GetKeyQuest", true, 1);
AddEntityCollideCallback("Player", "Key_Complete_Area", "FinishKeyQuest", true, 1);
AddEntityCollideCallback("Player", "Grunt_Area", "CollideGruntDoor", true, 1);
}

void GetKeyQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("keyquest", "KeyQuest");
}

void FinishKeyQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("keyquest", "KeyQuest");
}

void CollideGruntDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("eastwingdoor", true, true);
SetPlayerLookAt("eastwingdoor", 10.0f, 10.0f, "");
AddTimer("", 1.0f, "stoplook");
}
void stoplook(string &in asTimer)
{
StopPlayerLookAt();
}
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "eastwingkey_1", "eastwingdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("eastwingdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "eastwingdoor", 0, false);
RemoveItem("eastwingkey_1");
}




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

}



I'm sorry if this is getting annoying in any way, I'm 'kinda' new to this, I took scripting classes (somewhat) over the summer a few years ago and completely forgot everything :P so yeah. Thanks for the help!
SetPlayerLookAt("eastwingdoor", 10.0f, 10.0f, ""); should be
StartPlayerLookAt("eastwingdoor", 10.0f, 10.0f, "");
PHP Code:
/////////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("07_amb.ogg"true100.00.01true);
 
AddEntityCollideCallback("Player""Key_Quest_Area""GetKeyQuest"true1);
 
AddEntityCollideCallback("Player""Key_Complete_Area""FinishKeyQuest"true1);
 
AddEntityCollideCallback("Player""Grunt_Area""CollideGruntDoor"true1);
}

void GetKeyQuest(string &in asParentstring &in asChildint alState)
{
AddQuest("keyquest""KeyQuest");
}

void FinishKeyQuest(string &in asParentstring &in asChildint alState)
{
CompleteQuest("keyquest""KeyQuest");
}

void CollideGruntDoor(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("eastwingdoor"truetrue);
StartPlayerLookAt("eastwingdoor"10.0f10.0f"");
AddTimer(""2.0f"stoplook");
CreateEntityAtArea("grunt_1""servant_grunt.ent""Grunt_Area_2"truefalse);
ShowEnemyPlayerPosition("grunt_1");
GiveSanityDamage(0.0f50.0ftruefalse);
}

void stoplook(string &in asTimer)
{
StopPlayerLookAt();
}
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("""eastwingkey_1""eastwingdoor""UsedKeyOnDoor"true);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("eastwingdoor"falsetrue);
    
PlaySoundAtEntity("""unlock_door""eastwingdoor"0false);
    
RemoveItem("eastwingkey_1");
}



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


'No matching signatures'
signatures don't match?




I honestly believe this .hps file hates my guts .-.
No matching signatures means that you either spelled or typed something wrong. For example: Playmusic instead of PlayMusic or that you are missing a boolean value/integer/string/float somewhere. in a command.

AddEntityCollideCallback("Player", "Key_Quest_Area", "GetKeyQuest"); would give an error as it should have two more columns, for example.
(07-02-2011, 11:06 PM)Roenlond Wrote: [ -> ]No matching signatures means that you either spelled or typed something wrong. For example: Playmusic instead of PlayMusic or that you are missing a boolean value/integer/string/float somewhere. in a command.

AddEntityCollideCallback("Player", "Key_Quest_Area", "GetKeyQuest"); would give an error as it should have two more columns, for example.

I understand that now, but as I looked over the script, I couldn't find anything wrong, if anything, it would most likely be the floats in row 26 and 28 since that's where the error ocurred. Huh
Pages: 1 2