Frictional Games Forum (read-only)
Script fatal 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: Script fatal error? (/thread-18762.html)

Pages: 1 2


RE: Script fatal error? - Rapsis - 10-13-2012

(10-13-2012, 08:58 PM)The chaser Wrote: No, it's you Wink the engine does whatever it has to do. All the fails (or almost all) are human. So, let's see:

You have this:

Code:
void OnStart()

{

AddEntityCollideCallback("Player", "Studydooropen", "CollideRoomTwo", true, 0);

AddUseItemCallback("", "bedroomkey_1", "mansion_1", "UsedKeyOnDoor", true);

}



void CollideRoomTwo(string &in asParent, string &in asChild, int alState)

{

SetSwingDoorClosed("mansion_2", true, true);

}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);

RemoveItem("bedroomkey_1");

}



void OnLeave()

{



}


The error is here:

Code:
void OnStart()

{

AddEntityCollideCallback("Player", "Studydooropen", "CollideRoomTwo", true, 1);

AddUseItemCallback("", "bedroomkey_1", "mansion_1", "UsedKeyOnDoor", true);

}



void CollideRoomTwo(string &in asParent, string &in asChild, int alState)

{

SetSwingDoorClosed("mansion_2", true, true);

}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);

RemoveItem("bedroomkey_1");

}



void OnLeave()

{



}

The AddEntityCollideCallback always end with a 1 or a -1. When you put 0, the engine turns mad. That was the issue.
Nope, same error. As I said, I didn't change the map1.hps file at all.

(10-13-2012, 09:02 PM)Rapsis Wrote:
(10-13-2012, 08:58 PM)The chaser Wrote: No, it's you Wink the engine does whatever it has to do. All the fails (or almost all) are human. So, let's see:

You have this:

Code:
void OnStart()

{

AddEntityCollideCallback("Player", "Studydooropen", "CollideRoomTwo", true, 0);

AddUseItemCallback("", "bedroomkey_1", "mansion_1", "UsedKeyOnDoor", true);

}



void CollideRoomTwo(string &in asParent, string &in asChild, int alState)

{

SetSwingDoorClosed("mansion_2", true, true);

}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);

RemoveItem("bedroomkey_1");

}



void OnLeave()

{



}


The error is here:

Code:
void OnStart()

{

AddEntityCollideCallback("Player", "Studydooropen", "CollideRoomTwo", true, 1);

AddUseItemCallback("", "bedroomkey_1", "mansion_1", "UsedKeyOnDoor", true);

}



void CollideRoomTwo(string &in asParent, string &in asChild, int alState)

{

SetSwingDoorClosed("mansion_2", true, true);

}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);

RemoveItem("bedroomkey_1");

}



void OnLeave()

{



}

The AddEntityCollideCallback always end with a 1 or a -1. When you put 0, the engine turns mad. That was the issue.
Nope, same error. As I said, I didn't change the map1.hps file at all.
Figured out myself. Again, it was my stupidity.


RE: Script fatal error? - The chaser - 10-13-2012

Well, the time and experience solves that kind of things. Next time post at Development support Wink