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
Script Problems
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#61
RE: Script Problems

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

PHP Code: (Select All)
void OnStart()

   
AddUseItemCallback("""StrangeDoorKey""StrangeDoor""UnlockStrangeDoor"false);
   
SetEntityCallbackFunc("GuestRoomKey""ActiveEntity");
   
AddUseItemCallback("""GuestRoomKey""door01""UnlockDoor"false);
}
     

void UnlockDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door01"falsetrue);
PlaySoundAtEntity("""Unlock_door""door01"0false);
RemoveItem("GuestRoomKey");
}


void ActiveEntity(string &in asEntitystring &in type)
{
SetEntityActive("corpse01"true);
PlaySoundAtEntity("""12_girl_scream.snt""corpse01"0false);
StartScreenShake(0.5f200.25);
}


void UnlockStrangeDoor(string &in asItemstring &in asEntity)

{
SetSwingDoorLocked("StrangeDoor"falsetrue);
PlaySoundAtEntity("""unlock_door""StrangeDoor"0false);
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

03-12-2013, 01:03 PM
Find


Messages In This Thread
Script Problems - by Coolfromdah00d - 03-04-2013, 04:10 PM
RE: Script Problems - by darksky - 03-04-2013, 04:52 PM
RE: Script Problems - by Coolfromdah00d - 03-04-2013, 05:09 PM
RE: Script Problems - by ExpectedIdentifier - 03-04-2013, 05:16 PM
RE: Script Problems - by Coolfromdah00d - 03-04-2013, 05:49 PM
RE: Script Problems - by ExpectedIdentifier - 03-04-2013, 06:03 PM
RE: Script Problems - by Coolfromdah00d - 03-04-2013, 06:58 PM
RE: Script Problems - by Coolfromdah00d - 03-05-2013, 08:34 PM
RE: Script Problems - by darksky - 03-05-2013, 10:19 PM
RE: Script Problems - by Coolfromdah00d - 03-06-2013, 03:47 PM
RE: Script Problems - by PutraenusAlivius - 03-06-2013, 03:49 PM
RE: Script Problems - by Tiero - 03-06-2013, 04:14 PM
RE: Script Problems - by Coolfromdah00d - 03-06-2013, 04:55 PM
RE: Script Problems - by Tiero - 03-06-2013, 04:57 PM
RE: Script Problems - by Coolfromdah00d - 03-06-2013, 05:03 PM
RE: Script Problems - by Coolfromdah00d - 03-09-2013, 11:28 PM
RE: Script Problems - by No Author - 03-10-2013, 03:15 AM
RE: Script Problems - by Wapez - 03-06-2013, 05:07 PM
RE: Script Problems - by Coolfromdah00d - 03-06-2013, 05:29 PM
RE: Script Problems - by ExpectedIdentifier - 03-06-2013, 05:51 PM
RE: Script Problems - by Coolfromdah00d - 03-06-2013, 06:07 PM
RE: Script Problems - by darksky - 03-06-2013, 06:24 PM
RE: Script Problems - by Coolfromdah00d - 03-06-2013, 07:40 PM
RE: Script Problems - by darksky - 03-06-2013, 08:41 PM
RE: Script Problems - by Coolfromdah00d - 03-07-2013, 06:00 PM
RE: Script Problems - by 7heDubz - 03-07-2013, 06:37 PM
RE: Script Problems - by Coolfromdah00d - 03-07-2013, 06:44 PM
RE: Script Problems - by 7heDubz - 03-07-2013, 06:53 PM
RE: Script Problems - by Coolfromdah00d - 03-08-2013, 06:11 PM
RE: Script Problems - by ExpectedIdentifier - 03-08-2013, 06:37 PM
RE: Script Problems - by Coolfromdah00d - 03-08-2013, 06:59 PM
RE: Script Problems - by ExpectedIdentifier - 03-08-2013, 07:09 PM
RE: Script Problems - by ExpectedIdentifier - 03-10-2013, 02:21 AM
RE: Script Problems - by PutraenusAlivius - 03-10-2013, 02:34 AM
RE: Script Problems - by ExpectedIdentifier - 03-10-2013, 02:35 AM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 11:37 AM
RE: Script Problems - by No Author - 03-10-2013, 12:00 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 12:32 PM
RE: Script Problems - by No Author - 03-10-2013, 12:33 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 12:39 PM
RE: Script Problems - by No Author - 03-10-2013, 12:48 PM
RE: Script Problems - by PutraenusAlivius - 03-10-2013, 12:52 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 01:06 PM
RE: Script Problems - by PutraenusAlivius - 03-10-2013, 01:22 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 01:26 PM
RE: Script Problems - by PutraenusAlivius - 03-10-2013, 01:27 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 01:48 PM
RE: Script Problems - by No Author - 03-10-2013, 02:55 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 04:04 PM
RE: Script Problems - by PutraenusAlivius - 03-10-2013, 04:20 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 04:25 PM
RE: Script Problems - by Coolfromdah00d - 03-10-2013, 09:32 PM
RE: Script Problems - by Adrianis - 03-12-2013, 01:03 PM
RE: Script Problems - by No Author - 03-11-2013, 03:34 PM
RE: Script Problems - by PutraenusAlivius - 03-11-2013, 03:37 PM
RE: Script Problems - by ExpectedIdentifier - 03-11-2013, 03:40 PM
RE: Script Problems - by PutraenusAlivius - 03-11-2013, 03:46 PM
RE: Script Problems - by Coolfromdah00d - 03-11-2013, 06:18 PM
RE: Script Problems - by PutraenusAlivius - 03-12-2013, 03:24 AM
RE: Script Problems - by Coolfromdah00d - 03-12-2013, 07:38 AM
RE: Script Problems - by PutraenusAlivius - 03-12-2013, 10:37 AM
RE: Script Problems - by No Author - 03-12-2013, 01:13 PM
RE: Script Problems - by Adrianis - 03-12-2013, 01:45 PM
RE: Script Problems - by Coolfromdah00d - 03-13-2013, 07:32 AM
RE: Script Problems - by Adrianis - 03-13-2013, 12:56 PM
RE: Script Problems - by PutraenusAlivius - 03-13-2013, 08:08 AM
RE: Script Problems - by PutraenusAlivius - 03-13-2013, 03:34 PM
RE: Script Problems - by Coolfromdah00d - 03-13-2013, 04:24 PM
RE: Script Problems - by Adrianis - 03-13-2013, 05:14 PM
RE: Script Problems - by Coolfromdah00d - 03-13-2013, 05:26 PM
RE: Script Problems - by Adrianis - 03-13-2013, 05:38 PM
RE: Script Problems - by Coolfromdah00d - 03-13-2013, 05:47 PM
RE: Script Problems - by Adrianis - 03-13-2013, 06:00 PM
RE: Script Problems - by PutraenusAlivius - 03-14-2013, 06:47 AM
RE: Script Problems - by Adrianis - 03-14-2013, 10:34 AM
RE: Script Problems - by Coolfromdah00d - 03-14-2013, 09:39 PM
RE: Script Problems - by No Author - 03-15-2013, 05:40 AM
RE: Script Problems - by Coolfromdah00d - 03-15-2013, 06:10 PM
RE: Script Problems - by Adrianis - 03-15-2013, 12:59 AM
RE: Script Problems - by PutraenusAlivius - 03-15-2013, 05:39 AM
RE: Script Problems - by Adrianis - 03-15-2013, 10:49 PM



Users browsing this thread: 1 Guest(s)