(03-10-2013, 12:52 PM)JustAnotherPlayer Wrote: When i was seeing the script functions on the Script Functions thread, what does internal name mean?
Off-topic first - unfortunately as far as I can tell, the usage of 'internal name' changes.
Sometimes it's the name for the callback/connection you have made, for example in AddUseItemCallback, internal name refers to the name of the callback you have made, so that you can use RemoveCallback with that name to remove it.
But then there are several examples, such as SetEntityPlayerInteractCallback, where internal name refers to the name of the entity.
It's a little inconsistent.
void OnStart()
{
AddUseItemCallback("", "StrangeDoorKey", "StrangeDoor", "UnlockStrangeDoor", false);
SetEntityCallbackFunc("GuestRoomKey", "ActiveEntity");
AddUseItemCallback("", "GuestRoomKey", "door01", "UnlockDoor", false);
}
void UnlockDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}
void ActiveEntity(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false);
StartScreenShake(0.5f, 2, 0, 0.25);
}
void UnlockStrangeDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("StrangeDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "StrangeDoor", 0, false);
RemoveItem("StrangeDoorKey");
}
Just a note, PlaySoundAtEntity function, the sound name requires the .snt extension
PlaySoundAtEntity("", "Unlock_door
.snt", "door01", 0, false);
Also, UnlockDoor func uses uppercase Unlock_door for the sound name, wheras UnlockStrangeDoor uses lowercase unlock_door, one of those is wrong.
On the actual problem of the 'cannot use item this way' message, try giving the AddUseItemCallback an internal name (the first parameter), something like "callback1" & "callback2" just to test if that's the issue, and double check the names of the keys in the inventory & the doors