Frictional Games Forum (read-only)
Start-up 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: Start-up error (/thread-23360.html)



Start-up error - schwem00 - 09-25-2013

I just started working on the scripting portion of my new (and first) CS after looking at some wiki tutorials, and I cant seem to start up my game ever since I started scripting. The screen goes black and no error message pops up, so I have no idea what is wrong. Here is my code.

Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("", "key_1", "lockeddoor_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "unlockeddoor_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);

}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0.001, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0.001, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0.001, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0.001, "");
    SetEntityActive("servant_grunt_1", true);
}

void func_shelf(string &in asEntity, int alState)
{
     if (alState == 1)
     {
     SetMoveObjectState("secret_door",1.0f);
     PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
          return;
     }
}
void OnEnter()
{

}
void OnLeave()
{

}

Does anyone see whats wrong with this? Thanks in advance!


RE: Start-up error - Rapture - 09-25-2013

I can't remember if the compiler is picky about space after commas, but this?
Code:
SetMoveObjectState("secret_door",1.0f);

If no error message pops up, it might be that the .hps might not be the problem.

Rename your .hps file to something else and see if the CS will work. (It doesn't need a .hps to function)

//
Just something for the future, remember the last place(s) you worked on so you know where to concentrate your searching when your trying to find a problem.

And if you can't, comment out sections to help isolate the problem...
//
To make debugging easier, enter Dev Mode. http://wiki.frictionalgames.com/hpl2/amnesia/devenvguide

If your CS is crashing before you can enter it, rename the .hps temporarily and then start it. Rename the .hps back to it's proper name and reload the map, you will get the Error Message and Amnesia will not crash.


RE: Start-up error - schwem00 - 09-25-2013

(09-25-2013, 02:14 AM)Rapture Wrote: I can't remember if the compiler is picky about space after commas, but this?
Code:
SetMoveObjectState("secret_door",1.0f);

If no error message pops up, it might be that the .hps might not be the problem.

Rename your .hps file to something else and see if the CS will work. (It doesn't need a .hps to function)

//
Just something for the future, remember the last place(s) you worked on so you know where to concentrate your searching when your trying to find a problem.

And if you can't, comment out sections to help isolate the problem...
//
To make debugging easier, enter Dev Mode. http://wiki.frictionalgames.com/hpl2/amnesia/devenvguide

If your CS is crashing before you can enter it, rename the .hps temporarily and then start it. Rename the .hps back to it's proper name and reload the map, you will get the Error Message and Amnesia will not crash.

I think I just found the error message. Not sure why I didn't see it before.
Its a window called blackbox and it says

Amnesia.exe caused an EXCEPTION_ACCESS_VIOLATION in module Amnesia.exe at 0023:0052FE10

I did recently change a few of the mainsettings.cfg back to default after dev_mode was having trouble accessing files, could I have done something wrong?