Frictional Games Forum (read-only)
error message - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: error message (/thread-8312.html)

Pages: 1 2 3 4


RE: error message - mr.bonent - 05-30-2011

Ok now..

Thats my script:

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("kasten", true);
}
void OnEnter()
{
}
void OnLeave()
{
}


But it doesn't work. when I enter the area, nothing happen.
Have I to write some function in the leveleditor in the specific area-menu or entity-menu?




RE: error message - Roenlond - 05-30-2011

(05-30-2011, 08:20 PM)mr.bonent Wrote: Ok now..

Thats my script:

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("kasten", true);
}
void OnEnter()
{
}
void OnLeave()
{
}


But it doesn't work. when I enter the area, nothing happen.
Have I to write some function in the leveleditor in the specific area-menu or entity-menu?

The script area needs to be called exactly "ScriptArea_1" and the entity needs to be called exactly "kasten". You shouldn't need to edit anything else.



RE: error message - mr.bonent - 05-30-2011

very strange.. Everything fits how it should, but this cabinet ist still inactive.
Any other ideas?


RE: error message - Roenlond - 05-30-2011

(05-30-2011, 08:33 PM)mr.bonent Wrote: very strange.. Everything fits how it should, but this cabinet ist still inactive.
Any other ideas?

Some objects can't be activated, switch the entity to a book or something and try it that works. Also, use SetDebugMessage("anything", false); in the same function as your SetEntityActive. If you have debug messages turned on (press f1 if you have a dev environment set up), you will see the message "anything" display. If it does, that means the function works just fine and the entity itself is the problem.


RE: error message - mr.bonent - 05-30-2011

Ok, thanks for fast answer!

Now thats my script:

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("buch", true);
SetDebugMessage("buch", false);
}
void OnEnter()
{
}
void OnLeave()
{
}


No Debug message appears, and also the book. Whats my wrong turn?


RE: error message - Roenlond - 05-30-2011

The script can't be the fault then. Are you completely sure that your script area is called "ScriptArea_1"? It is case sensitive.


RE: error message - mr.bonent - 05-30-2011

case sensitive is ok.

Thats it hows it looks like.
It's right that the book is "inactive" in the Leveleditor yeah?



RE: error message - Roenlond - 05-30-2011

Honestly, I have no idea what's wrong. Are you sure your script file is called testmap.hps? Is the script loading at all? (add a debug message at the onstart)

the book should be set to inactive if you then want to activate it, yeah, but that is unimportant. If the debug message doesn't show up, the function isn't working at all.


RE: error message - mr.bonent - 05-30-2011

Want do you mean with
"Is the script loading at all? (add a debug message at the onstart)" ?

Should I send yo the files and want you to test it on your computer?


RE: error message - Roenlond - 05-30-2011

In the void OnStart() function, add SetDebugMessage("scriptworking", false); to see if the script works at all. Sure, send me the file. I'll have a look at them first thing tomorrow unless you figured it out before then Smile