07-02-2011, 07:23 AM
Pages: 1 2
07-02-2011, 08:14 AM
Please show uss your script file (Dormitry.hps). The problem is inside of it.
07-02-2011, 08:38 AM
/////////////////////////////
// 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 '{'
// 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 '{'
07-02-2011, 11:04 AM
{ 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.
{
something
}
You have to do like this
void SomeFunction( SomeInput)
{
something
}
Also, your collide and use call backs need to be in OnStart block.
07-02-2011, 04:40 PM
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!"
Like it says here http://wiki.frictionalgames.com/hpl2/tut...t_beginner in :
"Open the Map in Amnesia BEFORE you Edit Script!"
07-02-2011, 08:06 PM
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!
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!
07-02-2011, 08:15 PM
SetPlayerLookAt("eastwingdoor", 10.0f, 10.0f, ""); should be
StartPlayerLookAt("eastwingdoor", 10.0f, 10.0f, "");
StartPlayerLookAt("eastwingdoor", 10.0f, 10.0f, "");
07-02-2011, 10:00 PM
PHP Code:
/////////////////////////////
// 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);
StartPlayerLookAt("eastwingdoor", 10.0f, 10.0f, "");
AddTimer("", 2.0f, "stoplook");
CreateEntityAtArea("grunt_1", "servant_grunt.ent", "Grunt_Area_2", true, false);
ShowEnemyPlayerPosition("grunt_1");
GiveSanityDamage(0.0f, 50.0f, true, false);
}
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()
{
}
'No matching signatures'
signatures don't match?
I honestly believe this .hps file hates my guts .-.
07-02-2011, 11:06 PM
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.
AddEntityCollideCallback("Player", "Key_Quest_Area", "GetKeyQuest"); would give an error as it should have two more columns, for example.
07-02-2011, 11:31 PM
(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.
Pages: 1 2