Zypherzemus
Member
Posts: 94
Threads: 7
Joined: Jul 2011
Reputation:
0
|
FATAL ERROR
Can someone please help??
I keep getting this error:[attachment=1622]
(This post was last modified: 07-03-2011, 06:28 AM by Zypherzemus.)
|
|
07-02-2011, 07:23 AM |
|
xtron
Senior Member
Posts: 402
Threads: 37
Joined: May 2011
Reputation:
2
|
RE: FATAL ERROR
Please show uss your script file (Dormitry.hps). The problem is inside of it.
Dubstep <3
|
|
07-02-2011, 08:14 AM |
|
Zypherzemus
Member
Posts: 94
Threads: 7
Joined: Jul 2011
Reputation:
0
|
RE: FATAL ERROR
/////////////////////////////
// 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 '{'
(This post was last modified: 07-02-2011, 08:46 AM by Zypherzemus.)
|
|
07-02-2011, 08:38 AM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: FATAL ERROR
{ 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.
(This post was last modified: 07-02-2011, 11:04 AM by Tanshaydar.)
|
|
07-02-2011, 11:04 AM |
|
finosi
Junior Member
Posts: 8
Threads: 1
Joined: Jun 2011
Reputation:
0
|
|
07-02-2011, 04:40 PM |
|
Zypherzemus
Member
Posts: 94
Threads: 7
Joined: Jul 2011
Reputation:
0
|
RE: FATAL ERROR
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!
(This post was last modified: 07-02-2011, 08:07 PM by Zypherzemus.)
|
|
07-02-2011, 08:06 PM |
|
Roenlond
Senior Member
Posts: 331
Threads: 3
Joined: Apr 2011
Reputation:
0
|
RE: FATAL ERROR
SetPlayerLookAt("eastwingdoor", 10.0f, 10.0f, ""); should be
StartPlayerLookAt("eastwingdoor", 10.0f, 10.0f, "");
|
|
07-02-2011, 08:15 PM |
|
Zypherzemus
Member
Posts: 94
Threads: 7
Joined: Jul 2011
Reputation:
0
|
RE: FATAL ERROR
///////////////////////////// // 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, 10:00 PM |
|
Roenlond
Senior Member
Posts: 331
Threads: 3
Joined: Apr 2011
Reputation:
0
|
RE: FATAL ERROR
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 |
|
Zypherzemus
Member
Posts: 94
Threads: 7
Joined: Jul 2011
Reputation:
0
|
RE: FATAL ERROR
(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.
|
|
07-02-2011, 11:31 PM |
|
|