Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 16 Vote(s) - 4.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripts Recollection
Nye Offline
Senior Member

Posts: 250
Threads: 8
Joined: Jan 2011
Reputation: 2
#60
RE: Scripts Recollection

(02-22-2011, 10:27 AM)kozek Wrote: Make a locked door and a key to unlock it by Frontcannon
[spoiler]
[code]
void OnStart()
{
AddUseItemCallback("", "R01_Key1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
}

I can't get this to work, Iam kind of new to scripting so all help is appriciated.

Iam changing mansion_1 to manison_3 and R01_Key1 to tomb_key1. But then when I start the game and load my story it says FATAL ERROR. What am I doing wrong?
(I have tried removing both false and true, at different times.)

Code seems fine. I suspect your problem is to do with the names of your key/door. For the key, you need a "custom subitem name" in the "Entity Tab", this is the name you use for the AddUseItemCallBack. The name of the entity you use the key on (in your case, "mansion_1", needs to be the name of the actual object (ie. first field on the first tab).

Make sure you have that. If you still can't get it to work, when you get a fatal error, it will tell you the row and column numbers so you can easily identify where the problem is in your script file. Smile

(This post was last modified: 02-25-2011, 01:38 AM by Nye.)
02-25-2011, 01:38 AM
Find


Messages In This Thread
Scripts Recollection - by Arvaga - 10-20-2010, 02:57 AM
RE: Scripts Recollection - by mastersmith98 - 10-20-2010, 05:59 AM
RE: Scripts Recollection - by Kyle - 10-20-2010, 12:01 PM
RE: Scripts Recollection - by Vincent - 10-20-2010, 01:05 PM
RE: Scripts Recollection - by Frontcannon - 10-20-2010, 02:20 PM
RE: Scripts Recollection - by mrscoomich - 03-18-2012, 05:58 PM
RE: Scripts Recollection - by mastersmith98 - 10-20-2010, 10:18 PM
RE: Scripts Recollection - by Arvaga - 10-20-2010, 11:03 PM
RE: Scripts Recollection - by Alex7754 - 10-20-2010, 11:54 PM
RE: Scripts Recollection - by Frontcannon - 10-21-2010, 01:35 AM
RE: Scripts Recollection - by The worst submarine - 10-21-2010, 02:54 AM
RE: Scripts Recollection - by mastersmith98 - 10-21-2010, 03:27 AM
RE: Scripts Recollection - by anzki - 10-21-2010, 09:23 AM
RE: Scripts Recollection - by house - 10-22-2010, 07:31 PM
RE: Scripts Recollection - by anzki - 10-23-2010, 11:07 AM
RE: Scripts Recollection - by anzki - 10-24-2010, 10:13 AM
RE: Scripts Recollection - by Everlone - 10-25-2010, 03:51 PM
RE: Scripts Recollection - by Frontcannon - 10-25-2010, 04:30 PM
RE: Scripts Recollection - by Everlone - 10-25-2010, 04:35 PM
RE: Scripts Recollection - by Frontcannon - 10-25-2010, 05:07 PM
RE: Scripts Recollection - by Everlone - 10-25-2010, 05:11 PM
RE: Scripts Recollection - by Frontcannon - 10-25-2010, 05:37 PM
RE: Scripts Recollection - by Everlone - 10-25-2010, 05:48 PM
RE: Scripts Recollection - by zlandael - 10-27-2010, 01:07 AM
RE: Scripts Recollection - by mastersmith98 - 10-27-2010, 01:55 AM
RE: Scripts Recollection - by anzki - 10-27-2010, 02:32 PM
RE: Scripts Recollection - by Arvaga - 11-11-2010, 05:29 PM
RE: Scripts Recollection - by Frontcannon - 11-11-2010, 06:05 PM
RE: Scripts Recollection - by Equil - 01-03-2011, 03:33 PM
RE: Scripts Recollection - by Frontcannon - 01-03-2011, 04:20 PM
RE: Scripts Recollection - by Equil - 01-03-2011, 04:25 PM
RE: Scripts Recollection - by Frontcannon - 01-03-2011, 04:36 PM
RE: Scripts Recollection - by Equil - 01-03-2011, 04:45 PM
RE: Scripts Recollection - by DIGI Byte - 01-04-2011, 03:28 PM
RE: Scripts Recollection - by Frontcannon - 01-04-2011, 04:35 PM
RE: Scripts Recollection - by DIGI Byte - 01-04-2011, 04:58 PM
RE: Scripts Recollection - by DIGI Byte - 01-05-2011, 02:53 AM
RE: Scripts Recollection - by DIGI Byte - 01-05-2011, 06:02 AM
RE: Scripts Recollection - by Frontcannon - 01-05-2011, 04:29 PM
RE: Scripts Recollection - by DIGI Byte - 01-05-2011, 09:30 PM
RE: Scripts Recollection - by Tony32 - 01-10-2011, 11:04 PM
RE: Scripts Recollection - by house - 01-10-2011, 11:59 PM
RE: Scripts Recollection - by Tony32 - 01-11-2011, 02:37 PM
RE: Scripts Recollection - by Frontcannon - 01-13-2011, 05:09 PM
RE: Scripts Recollection - by Tony32 - 01-13-2011, 04:21 PM
RE: Scripts Recollection - by Seragath - 01-13-2011, 04:32 PM
RE: Scripts Recollection - by Akumasama - 01-15-2011, 06:25 PM
RE: Scripts Recollection - by Frontcannon - 01-15-2011, 08:34 PM
RE: Scripts Recollection - by Akumasama - 01-18-2011, 05:51 PM
RE: Scripts Recollection - by Ianlis - 01-21-2011, 11:45 PM
RE: Scripts Recollection - by Akumasama - 01-22-2011, 01:20 AM
RE: Scripts Recollection - by Vradcly - 01-22-2011, 01:27 AM
RE: Scripts Recollection - by Ianlis - 01-22-2011, 05:42 AM
RE: Scripts Recollection - by Akumasama - 01-23-2011, 05:35 PM
RE: Scripts Recollection - by Tottel - 01-25-2011, 02:48 PM
RE: Scripts Recollection - by Beatlebattle - 01-27-2011, 07:04 PM
RE: Scripts Recollection - by Oscar House - 01-27-2011, 09:05 PM
RE: Scripts Recollection - by Beatlebattle - 01-29-2011, 12:19 AM
RE: Scripts Recollection - by adamhun - 02-07-2011, 04:47 PM
RE: Scripts Recollection - by kozek - 02-22-2011, 10:27 AM
RE: Scripts Recollection - by Nye - 02-25-2011, 01:38 AM
RE: Scripts Recollection - by kozek - 03-01-2011, 07:12 PM
RE: Scripts Recollection - by Zinnkio - 02-26-2011, 04:42 PM
RE: Scripts Recollection - by Ongka - 02-26-2011, 05:28 PM
RE: Scripts Recollection - by Zinnkio - 02-26-2011, 05:49 PM
RE: Scripts Recollection - by nkmol - 02-26-2011, 07:18 PM
RE: Scripts Recollection - by Zinnkio - 02-26-2011, 09:55 PM
RE: Scripts Recollection - by nkmol - 03-01-2011, 11:31 PM
RE: Scripts Recollection - by kozek - 03-04-2011, 05:45 PM
RE: Scripts Recollection - by Pandemoneus - 03-04-2011, 05:47 PM
RE: Scripts Recollection - by TheGreatCthulhu - 03-04-2011, 11:01 PM
RE: Scripts Recollection - by Pandemoneus - 03-05-2011, 12:16 AM
RE: Scripts Recollection - by Raymond - 03-05-2011, 08:14 AM
RE: Scripts Recollection - by Pandemoneus - 03-05-2011, 05:38 PM
RE: Scripts Recollection - by Raymond - 03-06-2011, 02:49 AM
RE: Scripts Recollection - by CrushedRaiD - 03-07-2011, 10:07 AM
RE: Scripts Recollection - by wisecow - 04-17-2011, 08:05 PM
RE: Scripts Recollection - by wisecow - 04-18-2011, 04:31 PM
RE: Scripts Recollection - by nkmol - 04-18-2011, 05:42 PM
RE: Scripts Recollection - by teddan50 - 12-12-2011, 10:40 PM
RE: Scripts Recollection - by Jahffax - 04-23-2011, 07:05 AM
RE: Scripts Recollection - by Kyle - 04-23-2011, 10:48 PM
RE: Scripts Recollection - by Jahffax - 04-24-2011, 11:36 AM
RE: Scripts Recollection - by Exostalker - 04-29-2011, 02:38 PM
RE: Scripts Recollection - by ufando - 04-24-2011, 09:56 AM
RE: Scripts Recollection - by wisecow - 06-08-2011, 02:38 PM
RE: Scripts Recollection - by laser50 - 06-17-2011, 10:25 PM
RE: Scripts Recollection - by Tanshaydar - 06-17-2011, 10:28 PM
RE: Scripts Recollection - by laser50 - 06-17-2011, 10:34 PM
RE: Scripts Recollection - by Fireintex - 11-09-2011, 12:09 AM
RE: Scripts Recollection - by Kyle - 11-09-2011, 12:52 AM
RE: Scripts Recollection - by Fireintex - 11-09-2011, 12:55 AM
RE: Scripts Recollection - by Kyle - 11-09-2011, 02:00 AM
RE: Scripts Recollection - by jessehmusic - 12-23-2011, 03:04 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-12-2012, 05:26 PM
RE: Scripts Recollection - by Elven - 01-13-2012, 10:19 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-15-2012, 01:09 PM
RE: Scripts Recollection - by Loveridge - 01-19-2012, 08:21 PM
RE: Scripts Recollection - by flamez3 - 01-20-2012, 02:32 AM
RE: Scripts Recollection - by Khyrpa - 01-19-2012, 08:35 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-20-2012, 05:15 PM
RE: Scripts Recollection - by SilentStriker - 01-21-2012, 10:03 AM
RE: Scripts Recollection - by CorinthianMerchant - 01-21-2012, 02:29 PM
RE: Scripts Recollection - by SilentStriker - 01-21-2012, 03:20 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-21-2012, 03:23 PM
RE: Scripts Recollection - by SilentStriker - 01-21-2012, 03:43 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-21-2012, 04:21 PM
RE: Scripts Recollection - by jillis - 01-23-2012, 08:36 AM
RE: Scripts Recollection - by flamez3 - 01-23-2012, 10:14 AM
RE: Scripts Recollection - by jillis - 01-23-2012, 04:28 PM
RE: Scripts Recollection - by flamez3 - 01-24-2012, 03:27 AM
RE: Scripts Recollection - by jillis - 01-24-2012, 07:41 AM
RE: Scripts Recollection - by Stepper321 - 03-19-2012, 05:22 PM
RE: Scripts Recollection - by mrscoomich - 03-21-2012, 12:04 AM
RE: Scripts Recollection - by flamez3 - 03-21-2012, 12:47 PM
RE: Scripts Recollection - by mrscoomich - 03-25-2012, 01:41 AM



Users browsing this thread: 4 Guest(s)