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
Entity Containing Item (key)
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#5
RE: Entity Containing Item (key)

This looks like several questions in one!
Script for Unlocking a Door with a Key
void Unlock_Door(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("castle_01", false, true);
}

void OnEnter()
{
    AddUseItemCallback("", "key_study_01", "castle_01", "Unlock_Door", true);
    // "" you can leave this blank, it's okay
    //"key_study_01" name of key in level editor
    // "castle_01" of the thing you're using the item on (key on castle door, for example), replace with your door's name
    // "Unlock_Door" name of function to call when key is used on door
    // true - destroys key once used, change to false if you want to keep it
}

To change the name of the key when it's picked up
You need a .lang file for this connected to your CS, in it, you should have the following:
<CATEGORY Name="Inventory">
    <Entry Name="ItemName_hatchkey">A Key</Entry>
    //"ItemName_hatchkey" should be ItemName_ + name of the key model
    // A Key is whatever you want the key to show up as in the "picked up ____" message
    <Entry Name="ItemDesc_hatchkey">My key's description</Entry>
    //ItemDesc_hatchkey should be ItemDesc_ + name of the key model
    // My key's description is whatever you want the key's description to say
</CATEGORY>

[Image: quote_by_rueppells_fox-d9ciupp.png]
(This post was last modified: 12-07-2016, 05:45 PM by CarnivorousJelly.)
12-07-2016, 05:49 AM
Find


Messages In This Thread
Entity Containing Item (key) - by warlord1f - 12-05-2016, 12:48 AM
RE: Entity Containing Item (key) - by Mudbill - 12-05-2016, 01:23 AM
RE: Entity Containing Item (key) - by warlord1f - 12-05-2016, 09:35 PM
RE: Entity Containing Item (key) - by Mudbill - 12-06-2016, 01:08 AM
RE: Entity Containing Item (key) - by CarnivorousJelly - 12-07-2016, 05:49 AM
RE: Entity Containing Item (key) - by Mudbill - 12-07-2016, 08:19 AM



Users browsing this thread: 1 Guest(s)