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
Problem with Door Code
Doughnut Boy Offline
Junior Member

Posts: 1
Threads: 1
Joined: Sep 2012
Reputation: 0
#1
Rainbow  Problem with Door Code

Hello everybody. I am currently making my first map and I for the life of me CAN NOT GET THE KEY TO WORK!!! Angry when I pick it up it says "Picked up" and the key has no description. and will not work on the door. I have named the key in the right place and everything. Here is my Coding and lang files.


void OnStart()
{
AddUseItemCallback("", "key_1", "castle_silent.ent", "unlockdoor", true);
}


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

void OnLeave()
{

}


and my extra_English.lang



</LANGUAGE>


<CATEGORY Name ="Inventory">
<Entry Name="ItemName_Key_1">Key</Entry>
<Entry Name="ItemDesc_Key_1">"lawls"</Entry>
</CATEGORY>

</LANGUAGE>



If anyone could help me I would be forever in debt XD Big Grin
09-15-2012, 01:26 AM
Find
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#2
RE: Problem with Door Code

I think you have the wrong Syntax.
here, use this


void OnStart()
{
AddUseItemCallback
("", "key_1", "your_door", "unlockdoor", "true for autodestroy");
}


asName - internal name
asItem - internal name of the item
asEntity - entity to be able to use the item on
asFunction - function to call
abAutoDestroy - determines whether the item is destroyed when used

[Image: 25F7U37.png]
(This post was last modified: 09-15-2012, 01:54 AM by Melvin.)
09-15-2012, 01:50 AM
Website Find
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#3
RE: Problem with Door Code

Did it work?

[Image: 25F7U37.png]
09-15-2012, 11:59 AM
Website Find




Users browsing this thread: 1 Guest(s)