Frictional Games Forum (read-only)
Strange .hps error - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Strange .hps error (/thread-9466.html)



Strange .hps error - ObsidianLegion - 07-29-2011

Each time I boot up a map it come up with the following

34, 1: EXPECTED (
40, 1: EXPECTED (
59, 1: EXPECTED (

In this .hps

Code:
////////////////////////
//Run when starting map
void OnStart()
{
AddEntityCollideCallBack("Player", "Villagers", "CollideVillagers", true, 1);
AddEntityCollideCallBack("Player", "Thoughts", "CollideThoughts", true, 1);
SetEntityPlayerInteractCallback("NoteIntro1", "ReminderTrigger", true);
AddUseItemCallback("", "BackDoorKey", "BackDoor", "UsedKeyOnDoor", true);
}

////////////////////////
//Run when entering map
void OnEnter()
{
}

//////////////////////
//Run when leaving map
void OnLeave()
{
SetupLoadScreen("LoadingText", "Basement", 1, "");
}

///////////////////////
//CallBacks
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("BackDoor", false, true);
}

////////////////////////
//Triggers
void ReminderTrigger
{
    SetMessage("Intro", "Reminder", 0);
    StartPlayerLookAt("BackDoor", 1.0f, 1.0f, "");
    AddTimer("BackDoor", 2.0f, "Backdoor");
}
void BackDoor
{
StopPlayerLookAt();
}

////////////////////////////
//Collision Areas
void CollideThoughts(string &in asParent, string &in asChild, int alState)
{
    SetMessage("Intro", "Thoughts", 0);
}

void CollideVillagers(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
    GiveSanityDamage(20, true);
    StartPlayerLookAt("Entrance", 1.0f, 1.0f, "");
    AddTimer("Entrance", 2.0f, "Entrance");
}
void Entrance
{
StopPlayerLookAt();
}



RE: Strange .hps error - Kyle - 07-29-2011

void ReminderTrigger(string &in asEntity)

void Backdoor(string &in asTimer)

void Entrance(string &in asTimer)

You need to remember that each function has a pair parentheses with parameters from which have to be called inbetween them.


RE: Strange .hps error - ObsidianLegion - 07-29-2011

(07-29-2011, 12:13 PM)Kyle Wrote: void ReminderTrigger(string &in asEntity)

void Backdoor(string &in asTimer)

void Entrance(string &in asTimer)

You need to remember that each function has a pair parentheses with parameters from which have to be called inbetween them.

Now it's coming up with this error
No matching signatures to:
5, 1: AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)
6, 1:AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)


RE: Strange .hps error - Kyle - 07-29-2011

(07-29-2011, 01:07 PM)Lolnesia09 Wrote:
(07-29-2011, 12:13 PM)Kyle Wrote: void ReminderTrigger(string &in asEntity)

void Backdoor(string &in asTimer)

void Entrance(string &in asTimer)

You need to remember that each function has a pair parentheses with parameters from which have to be called inbetween them.

Now it's coming up with this error
No matching signatures to:
5, 1: AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)
6, 1:AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)

AddEntityCollideCallback("Player", "Villagers", "CollideVillagers", true, 1);


AddEntityCollideCallback("Player", "Thoughts", "CollideThoughts", true, 1);

I thought it didn't matter if you capitalized the "b" in AddEntityCollideCallback, but I guess whoever said it was wrong.

If it doesn't work, then I'm wrong. Tongue


RE: Strange .hps error - MrCookieh - 07-29-2011

The script is very sensitive. One error, be it an A instead of an a, can mess the whole thing up.
That's why you have to go through your code twice Smile


RE: Strange .hps error - xtron - 07-29-2011

use the notepad++ .HPS addon and you won't get errors like this very often.


RE: Strange .hps error - ObsidianLegion - 07-29-2011

(07-29-2011, 04:45 PM)xtron Wrote: use the notepad++ .HPS addon and you won't get errors like this very often.

I did >.< Notepad ++ AND before I editied it, changed it to a .hps


RE: Strange .hps error - Kyle - 07-29-2011

(07-29-2011, 07:37 PM)Lolnesia09 Wrote:
(07-29-2011, 04:45 PM)xtron Wrote: use the notepad++ .HPS addon and you won't get errors like this very often.

I did >.< Notepad ++ AND before I editied it, changed it to a .hps

Then you should have been able to detect which lines were messed up, and what was wrong with them. That's why we have a script funtions page which tells you right there what the callback looks like and how to use functions that are added in your .hps file.