Frictional Games Forum (read-only)
Major Scripting 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: Major Scripting Error!!! (/thread-9800.html)



Major Scripting Error!!! - CookieSoup - 08-16-2011

So I've been busy with the HPL Editor since yesterday. I created a little map and I have been working on a script for a couple of hours, but I can't get it to work!! As soon as I launch my map i get a fatal error...
Here's my script:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea1", "CollideScriptArea1", true, 1);
}

void CollideScriptArea1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_1", true, true);
SetPlayerLookAt("castle_arched01_1", 10.0f, 10.0f, "");
PlaySoundAtEntity("", "scare_breath.snt", "Player", 0, false);
AddTimer("", 1.0f, "stoplook");
}

void stoplook(string &in, asTimer)
{
PlayerStopLookAt();
}

-What's wrong with my code?!
-The game points out my faults, but I'm absolutely right i made no mistakes!! I added the error in a thumbnail.


RE: Major Scripting Error!!! - Your Computer - 08-16-2011

You placed a comma between the variable and the data type for stoplook(). You also misspelled a couple of functions, it is really, StopPlayerLookAt() and StartPlayerLookAt().


RE: Major Scripting Error!!! - CookieSoup - 08-16-2011

(08-16-2011, 03:59 PM)Your Computer Wrote: You placed a comma between the variable and the data type for stoplook(). You also misspelled a couple of functions, it is really, StopPlayerLookAt() and StartPlayerLookAt().
Thanks for the reply and pointing out the obvious mistakes I made and should've been able to discover myself. The game still gives me this error that "castle_arched01_1" isn't a matching signature. Why is that? I checked my map editor and the name of the specific door I want the doorslam event to happen on is clearly titled: castle_arched01_1. So I'm quite confused there. /Nevermind I figured it out.
(08-16-2011, 04:14 PM)CookieSoup Wrote:
(08-16-2011, 03:59 PM)Your Computer Wrote: You placed a comma between the variable and the data type for stoplook(). You also misspelled a couple of functions, it is really, StopPlayerLookAt() and StartPlayerLookAt().
Thanks for the reply and pointing out the obvious mistakes I made and should've been able to discover myself. The game still gives me this error that "castle_arched01_1" isn't a matching signature. Why is that? I checked my map editor and the name of the specific door I want the doorslam event to happen on is clearly titled: castle_arched01_1. So I'm quite confused there. /Nevermind I figured it out.

Alright, sorry for bothering whoever is reading this again, but I seem to have a problem again (it'll probably be a very obvious and logical one to solve) but when the script is activated and the door slams shut, the scare_breath sound doesn't play. Is it another spelling mistake, or a wrong order? What is it?