Frictional Games Forum (read-only)
Script help - 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: Script help (/thread-24106.html)

Pages: 1 2


RE: Script help - daortir - 12-13-2013

Did you try removing script lines one by one to see where your problem is ? That's how I do it usually. If nothing works, you probably did something wrong with your files.


RE: Script help - Romulator - 12-13-2013

PHP Code:
//The code below was entered by me :P You dont need to copy this line, nor the next.
//Any errors I could find have a comment next to them :)

void OnEnter()
{
AddEntityCallback("Player""livingkey""monsterspawn"true1);
PlayMusic("amb_soft_mood.ogg"true10.1f0true);        //missing .ogg extension
AutoSave();
}

void monsterspawn(string &in asParentstring &in asChildint alState)   //missing callback parameters
{
SetEntityActive("tehmonster",true);
AddEnemyPatrolNode("tehmonster","PathnodeArea8",2,"");
AddEnemyPatrolNode("tehmonster","PathnodeArea11",6,"");
AutoSave();                            //missing brackets


Try that :3


RE: Script help - ExpectedIdentifier - 12-15-2013

Not on a pc at the moment but an easier way would be to use the property on the key in the editor that automatically creates a on interact callback. I'm assuming you're trying to make something happen when the player picks up a key. If you wana do it the way you're doing it now it's SetEntityPlayerInteractCallback("livingkey", "monsterspawn", true); Can't just be making up callbacks now :-)

Also, your monsterspawn function has no parameters, it should be void monsterspawn(string &in asEntity)


RE: Script help - Neelke - 02-19-2014

Code:
void OnEnter()
{
AddEntityCollideCallback("Player", "livingkey", "monsterspawn", true, 1);
PlayMusic("amb_soft_mood.ogg", true, 1, 0.1f, 0, true);
AutoSave();
}

void monsterspawn(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("tehmonster",true);
AddEnemyPatrolNode("tehmonster","PathnodeArea8",2,"");
AddEnemyPatrolNode("tehmonster","PathnodeArea11",6,"");
AutoSave();                  
}

Exactly everyone forgot that there are no scripts as AddEntityCallback or AddEntityInteract. Well, that happens Tongue


RE: Script help - davide32 - 02-23-2014

AddEntityCallback doesn't exist in amnesia Scripting it might be
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide);


RE: Script help - davide32 - 03-20-2014

AddEntityCollideCallback it's correct


RE: Script help - PutraenusAlivius - 03-20-2014

Why did you bump again? On top of that you're double posting.