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
!!!SCRIPTING HELP!!!
DJ1447 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jan 2012
Reputation: 0
#1
!!!SCRIPTING HELP!!!

I have been trying to get a key to unlock a door but its not working here is my extra lang:

<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_key1">Item Description</Entry>
<Entry Name="ItemName_key1">Item Name</Entry>
</CATEGORY>

that is all i have in it and here is my map:

void OnStart()
{

AddUseItemCallback("", "key1", "Door1", "UsedKeyOnDoor", true);

}

void UsedKeyOnDoor(string &in item, string &in door)

{
SetSwingDoorLocked(door1, false, true);
PlaySoundAtEntity("", "unlock_door", door1, 0, false);
RemoveItem(key1);

}
}

and that is all thats in that map... PLZ HELP!
01-19-2012, 02:08 AM
Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#2
RE: !!!SCRIPTING HELP!!!

PHP Code: (Select All)
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("door1"falsetrue);
    
PlaySoundAtEntity("""unlock_door""door1"0false);
    
RemoveItem("key1");


you forgot the " " at the door + you wrote Door1 instead of door1 (capital D) at void onstart. check in your map how it is named
(This post was last modified: 01-19-2012, 02:12 AM by Quotentote.)
01-19-2012, 02:10 AM
Find
DJ1447 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jan 2012
Reputation: 0
#3
RE: !!!SCRIPTING HELP!!!

(01-19-2012, 02:10 AM)Quotentote Wrote:
PHP Code: (Select All)
void UsedKeyOnDoor(string &in asItemstring &in asEntity

SetSwingDoorLocked("door1"falsetrue); 
PlaySoundAtEntity("""unlock_door""door1"0false); 
RemoveItem("key1"); 



you forgot the " " at the door + you wrote Door1 instead of door1 (capital D) at void onstart. check in your map how it is named

Thnx for trying but still doesnt work
01-19-2012, 02:50 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: !!!SCRIPTING HELP!!!

(01-19-2012, 02:08 AM)DJ1447 Wrote: I have been trying to get a key to unlock a door but its not working here is my extra lang:


Item Description
Item Name


that is all i have in it and here is my map:

void OnStart()
{

AddUseItemCallback("", "key1", "Door1", "UsedKeyOnDoor", true);

}

void UsedKeyOnDoor(string &in item, string &in door)

{
SetSwingDoorLocked(door1, false, true);
PlaySoundAtEntity("", "unlock_door", door1, 0, false);
RemoveItem(key1);

}
}

and that is all thats in that map... PLZ HELP!



You have an extra "}" at the bottom of the script. Remove that.
01-19-2012, 03:22 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: !!!SCRIPTING HELP!!!

Got Ninjaed by Statyk :c

And what is not working? Are you getting an error?

(This post was last modified: 01-19-2012, 03:42 AM by flamez3.)
01-19-2012, 03:41 AM
Find
DJ1447 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jan 2012
Reputation: 0
#6
RE: !!!SCRIPTING HELP!!!

(01-19-2012, 03:41 AM)flamez3 Wrote: Got Ninjaed by Statyk :c

And what is not working? Are you getting an error?

no just when i pick up the key it wont unlock the door
01-19-2012, 11:44 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#7
RE: !!!SCRIPTING HELP!!!

1) Make sure the key names in the level and script match PERFECTLY, AS WELL AS the door.
2) Make sure to put quotations around strings. for example:
SetSwingDoorLocked(door1, false, true);


should be:

SetSwingDoorLocked("door1", false, true);
01-20-2012, 12:16 AM
Find




Users browsing this thread: 3 Guest(s)