Frictional Games Forum (read-only)
Fatal Error [SOLVED] - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Fatal Error [SOLVED] (/thread-7728.html)



Fatal Error [SOLVED] - Karai16 - 05-01-2011

There's something wrong with my code, for I get this error message:
[Image: Error.png]
This is my code, can somebody see what's wrong with it?
Code:
void OnStart()
{
    AddUseItemCallback("", "RoomKey", "RoomDoor", "UsedKeyOnDoor", true);
    SetPlayerInteractCallback("RoomKey", "Activatebob", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("RoomDoor", false, true);
    PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
    RemoveItem("RoomKey");
}

void Activatebob(string &in asEntity)
{
setEntityActive("Bob", true);
}
and yes, I'm sure I named my servant Bob.


RE: Fatal Error - Linus Ă…gren - 05-01-2011

The first error is your callback. The callback syntax looks like this:

SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

The second one is that you got a small "s" on SetEntityActive.
:>


RE: Fatal Error - Dalroc - 05-01-2011

Change
SetPlayerInteractCallback
to
SetEntityPlayerInteractCallback


RE: Fatal Error - Karai16 - 05-01-2011

Quote:The first error is your callback. The callback syntax looks like this:

SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

The second one is that you got a small "s" on SetEntityActive.
:>
&
Quote:Change
SetPlayerInteractCallback
to
SetEntityPlayerInteractCallback

Thanks a bunch, "Bob" now spawns when I pick up the key, just like I intended Smile