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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Key doesn't work
Author Message
DoctorNinja88888 Offline
Junior Member

Posts: 3
Joined: Mar 2014
Reputation: 0
Post: #1
Key doesn't work

Ok so I've been working on a custom story and looked at many tutorials.....on how to make a key that works. I got teh key but it doesn't unlock the door.


I will just post the extra_english.lang file and the script file and other info to easily find help.


The name of my key: Key_1
The name of my door: Door_1

Here is my script file: (Located in maps under my custom story file (The map itself called "Hotel"))

/////////////////////////////////////////
/////////// Run when entering map

void onEnter()

{
AddUseItemCallback("", "Key_1", "Door_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, true);
RemoveItem("Key_1");
}


Theextra_english.lang file is located in my custom story file (Hotel) itself and no subfolders after that.

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name= "CustomStoryMain">
<Entry Name= "Description">Custom thing</Entry>
</CATEGORY>
<Category Name= "Inventory">
<Entry Name= "ItemDesc_Key_1">This is a key</Entry>
<Entry Name= "ItemName_Key_1">Door Key</Entry>

</CATEGORY>

</LANGUAGE>



Yes my script title is "Hotel.hps"

It is titled correctly, along with CustomSubItem under key.
(This post was last modified: 03-20-2014 07:22 AM by DoctorNinja88888.)
03-20-2014 07:18 AM
Find all posts by this user Quote this message in a reply
Straxedix Offline
Senior Member

Posts: 427
Joined: Mar 2014
Reputation: 5
Post: #2
RE: Key doesn't work

Key_1 for name and sub name ??? Make maybe different sub name then tell me did it work

03-20-2014 07:46 AM
Find all posts by this user Quote this message in a reply
Wapez Offline
Senior Member

Posts: 360
Joined: Mar 2012
Reputation: 19
Post: #3
RE: Key doesn't work

It does look correct. I suggest you make sure ALL names are correct, and that the .map file has the same name as the .hps one. If it still won't work, send me a PM and I'll let you send your custom story to me so I can find the problem.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-20-2014 07:56 AM
Find all posts by this user Quote this message in a reply
DoctorNinja88888 Offline
Junior Member

Posts: 3
Joined: Mar 2014
Reputation: 0
Post: #4
RE: Key doesn't work

yeah, I made the subname different and it still doesn't work. I have the .lang name the same as the . I copied everything from a tutorial (Even another) and doesn't work. I might PM someone later. I'm probably going to start building my map a little more. Unless someone can help me now.
03-20-2014 08:22 PM
Find all posts by this user Quote this message in a reply
Mudbill Offline
Posting Freak

Posts: 3,527
Joined: Apr 2013
Reputation: 166
Post: #5
RE: Key doesn't work

OnEnter needs to be capital. You have a lower case O in the beginning, therefore it's not recognized or executed.

You probably want to make it into OnStart instead though.

(This post was last modified: 03-20-2014 08:28 PM by Mudbill.)
03-20-2014 08:27 PM
Find all posts by this user Quote this message in a reply
DoctorNinja88888 Offline
Junior Member

Posts: 3
Joined: Mar 2014
Reputation: 0
Post: #6
RE: Key doesn't work

After many many tweek after tweek I finally got it to work. Thanks for the help guys.
03-20-2014 11:17 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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