Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Start-up error
schwem00 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Sep 2013
Reputation: 0
#1
Start-up error

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.

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!
(This post was last modified: 09-26-2013, 12:07 AM by schwem00.)
09-25-2013, 01:04 AM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#2
RE: Start-up error

I can't remember if the compiler is picky about space after commas, but this?
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/amn...evenvguide

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.
09-25-2013, 02:14 AM
Find
schwem00 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Sep 2013
Reputation: 0
#3
RE: Start-up error

(09-25-2013, 02:14 AM)Rapture Wrote: I can't remember if the compiler is picky about space after commas, but this?
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/amn...evenvguide

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?
09-25-2013, 08:25 PM
Find




Users browsing this thread: 1 Guest(s)