Frictional Games Forum (read-only)
Amnesia script crashing - 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: Amnesia script crashing (/thread-25952.html)



Amnesia script crashing - theodorg - 08-24-2014

Hello so this is my script. It worked before but now when i added some backround sound it crashes when triggering an enemy and 2 walls with an areabox: These are just the relevant parts of my script:

// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "monhal", "monhals", true, 1);
AddEntityCollideCallback("Player", "korridor", "bana", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
AddEntityCollideCallback("Player", "servant_grunt_1", "MonsterAway", true, 1);
PlayMusic("creep.ogg", false, 1, 1, 1, true);
}



void bana(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("osynlig", true);
SetEntityActive("synlig", false);
SetEntityActive("servant_grunt_2", true);
}


RE: Amnesia script crashing - Neelke - 08-24-2014

Is this the whole script? If not, post the whole script.


RE: Amnesia script crashing - Radical Batz - 08-24-2014

Pls post us your error and your whole script!

thnx


RE: Amnesia script crashing - theodorg - 08-24-2014

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "monhal", "monhals", true, 1);
AddEntityCollideCallback("Player", "korridor", "bana", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
AddEntityCollideCallback("Player", "servant_grunt_1", "MonsterAway", true, 1);
PlayMusic("creep.ogg", false, 1, 1, 1, true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void SECRET(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "secret_door", false, true);
PlaySoundAtEntity("", "unlock_door", "secret_door", 0, false);
RemoveItem("secret_key");
}

void monhals(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", false);
}

void bana(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("osynlig", true);
SetEntityActive("synlig", false);
SetEntityActive("servant_grunt_2", true);
}

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

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

(08-24-2014, 07:29 PM)Dr.Badcat Wrote: Pls post us your error and your whole script!

thnx

there you have it


RE: Amnesia script crashing - Radical Batz - 08-24-2014

I see nothing wrong with your script, could you pls post the error or crash that's getting when you load the game Smile


RE: Amnesia script crashing - Neelke - 08-24-2014

What exactly happens when you test this script? Does it crash when you start the level or exactly when you activate the monsters?


RE: Amnesia script crashing - Radical Batz - 08-24-2014

Quote:there you have it

I don't see it?


RE: Amnesia script crashing - theodorg - 08-24-2014

(08-24-2014, 07:36 PM)Dr.Badcat Wrote: I see nothing wrong with your script, could you pls post the error or crash that's getting when you load the game Smile

You mean like this, and it crashes when triggering the scriptbox not on level start.

(08-24-2014, 07:39 PM)Dr.Badcat Wrote:
Quote:there you have it

I don't see it?

Actully i jsut fixed it but thanks anyway Smile


RE: Amnesia script crashing - Neelke - 08-24-2014

Which one?

And that error is literally nothing. I don't think you understood what error I wanted you to post.


RE: Amnesia script crashing - Radical Batz - 08-24-2014

(08-24-2014, 07:40 PM)theodorg Wrote:
(08-24-2014, 07:36 PM)Dr.Badcat Wrote: I see nothing wrong with your script, could you pls post the error or crash that's getting when you load the game Smile

You mean like this, and it crashes when triggering the scriptbox not on level start.

(08-24-2014, 07:39 PM)Dr.Badcat Wrote:
Quote:there you have it

I don't see it?

Actully i jsut fixed it but thanks anyway Smile

This is the error that you should tell us, When in game and it crashes press CTRL c for copy, then post us that error.

That's what I used to do

Edit: Oh I see you fixed it, alright!