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
Fatal Error [SOLVED]
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#1
Fatal Error [SOLVED]

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?
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.

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-01-2011, 12:59 PM by Karai16.)
05-01-2011, 12:24 PM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#2
RE: Fatal Error

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.
:>

Creator of The Dark Treasure.
05-01-2011, 12:34 PM
Website Find
Dalroc Offline
Member

Posts: 57
Threads: 2
Joined: Mar 2011
Reputation: 0
#3
RE: Fatal Error

Change
SetPlayerInteractCallback
to
SetEntityPlayerInteractCallback
05-01-2011, 12:49 PM
Find
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#4
RE: Fatal Error

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

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
05-01-2011, 12:57 PM
Find




Users browsing this thread: 1 Guest(s)