Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with keys
Author Message
D3AD UPR1S1NG Offline
Member

Posts: 50
Joined: Apr 2011
Reputation: 0
Post: #1
Need help with keys
At the moment I am trying to make a new custom story and I have just got into trying to script but at the moment I suck, I need help trying to unlock a door with this key I have because everytime I click recompile script and lang it throws the following errors at me

main (7,6) : INFO : Compiling void OnStart ()
main(9,38) : ERR : prison_door_1 is not declared
main (11,6) : INFO : Compiling void UseKeyOnDoor(string&in, string&in,)
main (14,17) ERR Cellkey is not declared

here is the script that i'm using and I know it's me making a stupid mistake but could somebody point it out to me Smile

//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("","CellKey",Prison_door_1,"UseKeyonDoor",true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_door_1",false,true);
RemoveItem(CellKey);
PlaySoundAtEntity("","unlock_door","prison_door_1", 0, false);
}
04-20-2011 02:08 AM
Find all posts by this user Quote this message in a reply
Russ Money Offline
Senior Member

Posts: 360
Joined: Dec 2010
Reputation: 3
Post: #2
RE: Need help with keys
Looks like you just need to clean it up a bit and add a few " "
//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "CellKey", "Prison_door_1", "UseKeyonDoor",true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_door_1", false, true);
RemoveItem("CellKey");
PlaySoundAtEntity("", "unlock_door", "prison_door_1", 0, false);
}

Added spaces after the commas and quotes around CellKey and Prison_door_1

(This post was last modified: 04-20-2011 02:26 AM by Russ Money.)
04-20-2011 02:25 AM
Find all posts by this user Quote this message in a reply
D3AD UPR1S1NG Offline
Member

Posts: 50
Joined: Apr 2011
Reputation: 0
Post: #3
RE: Need help with keys
(04-20-2011 02:25 AM)Russ Money Wrote:  Looks like you just need to clean it up a bit and add a few " "
//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "CellKey", "Prison_door_1", "UseKeyonDoor",true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_door_1", false, true);
RemoveItem("CellKey");
PlaySoundAtEntity("", "unlock_door", "prison_door_1", 0, false);
}

Added spaces after the commas and quotes around CellKey and Prison_door_1

Ok thanks Smile changed it although I'm still getting the same message except this time it's come up with cellkey twice on the ERR section
04-20-2011 02:30 AM
Find all posts by this user Quote this message in a reply
Russ Money Offline
Senior Member

Posts: 360
Joined: Dec 2010
Reputation: 3
Post: #4
RE: Need help with keys
And the entity for the key is definitely named "CellKey"?

04-20-2011 02:58 AM
Find all posts by this user Quote this message in a reply
D3AD UPR1S1NG Offline
Member

Posts: 50
Joined: Apr 2011
Reputation: 0
Post: #5
RE: Need help with keys
(04-20-2011 02:58 AM)Russ Money Wrote:  And the entity for the key is definitely named "CellKey"?

Yeah
04-20-2011 02:59 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)