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)
warlord1f Offline
Junior Member

Posts: 3
Threads: 2
Joined: Dec 2016
Reputation: 0
#1
Entity Containing Item (key)

When in level editor, under Entity, Container can be found. These entities can hold items like oil, sanity and keys. Now the key is defined as study_key or key_study.

My question is. Where can i change the discription and name of the key and also see what name it has, because i want to script it for a door and i searched but cant find what the name of the key will be.

So if anyone can help me, i would be gradefull!!
12-05-2016, 12:48 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Entity Containing Item (key)

If you can't add a CustomSubItemTypeName to the contained item, you may have to create a custom entity for that item. That will let you bake the lang entries into the file and not have to specify them in the level editor.

To do that, open the item you want in the model editor. Start with Save As and name it something else. Go to Edit > User Defined Variables and find the SubTypeName entries. Edit them. Save. Use that entity in your level instead.

Remember to include your custom entity within your custom story folder.

12-05-2016, 01:23 AM
Find
warlord1f Offline
Junior Member

Posts: 3
Threads: 2
Joined: Dec 2016
Reputation: 0
#3
RE: Entity Containing Item (key)

(12-05-2016, 01:23 AM)Mudbill Wrote: If you can't add a CustomSubItemTypeName to the contained item, you may have to create a custom entity for that item. That will let you bake the lang entries into the file and not have to specify them in the level editor.

To do that, open the item you want in the model editor. Start with Save As and name it something else. Go to Edit > User Defined Variables and find the SubTypeName entries. Edit them. Save. Use that entity in your level instead.

Remember to include your custom entity within your custom story folder.

thank you for the hint. i tried but i did not succeed Sad
12-05-2016, 09:35 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Entity Containing Item (key)

What went wrong?

12-06-2016, 01:08 AM
Find
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
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Entity Containing Item (key)

(12-07-2016, 05:49 AM)CarnivorousJelly Wrote:
void Unlock_Door(string &in asItem, string &in asEntity)

Just fixing up your parameters so they match the callback syntax.

(12-07-2016, 05:49 AM)CarnivorousJelly Wrote:
void OnEnter()

Oh, and this ^

@OP: Are you able to acquire the item at all?

12-07-2016, 08:19 AM
Find
CarnivorousJelly Offline
Posting Freak

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

Omg I should've proof-read before posting. Thanks Mudbill

[Image: quote_by_rueppells_fox-d9ciupp.png]
12-07-2016, 05:44 PM
Find




Users browsing this thread: 2 Guest(s)