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
Key to door Script help
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#1
Key to door Script help

Im making a little test migjigger.
And I have a door and a key on my lvl editor and i want the key to open that specific door, it works its just the name of the key doesnt pop up, it just says
"Picked Up"

And when i use it on the door the key doesnt go away. here is the script

Quote:////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "castle_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("awesomekey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

o and here is my extra english

Quote:<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">Just a brief description!</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<EntryName="ItemName_awesomekey_1">Awesome Key</Entry>
<Entry Name="ItemDesc_awesomekey_1">Key to your moms bedroom</Entry>
</CATEGORY>
</LANGUAGE>

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

(This post was last modified: 03-23-2011, 08:02 PM by ZxBrad.)
03-23-2011, 08:01 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Key to door Script help

Select the item in the editor suite, and go to the next tab. At the bottom there is an Item Category box and an Item Name box, make sure you input "awesomekey_1" in both fields. Make sure the key's name in the editor is also awesomekey_1.
03-23-2011, 08:23 PM
Find
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#3
RE: Key to door Script help

(03-23-2011, 08:23 PM)palistov Wrote: Select the item in the editor suite, and go to the next tab. At the bottom there is an Item Category box and an Item Name box, make sure you input "awesomekey_1" in both fields. Make sure the key's name in the editor is also awesomekey_1.

Thx but that didnt work. It still gives me
"Picked Up"

But it did make the key go away when i use it

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

03-23-2011, 08:29 PM
Find
Viperdream Offline
Member

Posts: 124
Threads: 16
Joined: Jan 2011
Reputation: 0
#4
RE: Key to door Script help

You have to start the custom story from the main menu, not load it in the debug menu. Because if you do that, you won't see those names from the .lang file

03-23-2011, 08:58 PM
Find
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#5
RE: Key to door Script help

(03-23-2011, 08:58 PM)Viperdream Wrote: You have to start the custom story from the main menu, not load it in the debug menu. Because if you do that, you won't see those names from the .lang file

I dont play on debug mode. It justs doesnt work. I suck at this lol

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

03-23-2011, 09:12 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#6
RE: Key to door Script help

Nah, I'm having the same problem right now, trying to fix it.
03-23-2011, 09:51 PM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#7
RE: Key to door Script help

I have a similar script for my mod, I'll post it here, maybe it'll help you out.
void OnStart()
{
AddUseItemCallback("hallwaydoorunlocked", "HallwayKey", "sewer_arched_4", "hallwaydoorunlocked", true);
}

void hallwaydoorunlocked(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("sewer_arched_4", false, false);
RemoveItem("HallwayKey");
PlaySoundAtEntity("unlocking", "unlock_door.snt", "Player", 0, false);
}

And the .lang file for this category:
<CATEGORY Name="Inventory">

<Entry Name="ItemName_HallwayKey">Hallway Key</Entry>
<Entry Name="ItemDesc_HallwayKey">A key for the main hall.</Entry>

</CATEGORY>

As for the key you pick up, the name of the entity is "HallwayKey"
and the CustomSubItemTypeName is also "HallwayKey"

All this considered, my custom story is working properly.

edit: Also, I believe having underscores in the item name may not let it read properly, try changing the item name and desc to:

<EntryName="ItemName_awesomekey1">Awesome Key</Entry>
<Entry Name="ItemDesc_awesomekey1">Key to your moms bedroom</Entry>
(This post was last modified: 03-24-2011, 01:09 AM by Russ Money.)
03-24-2011, 01:02 AM
Find
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#8
RE: Key to door Script help

(03-24-2011, 01:02 AM)Russ Money Wrote: I have a similar script for my mod, I'll post it here, maybe it'll help you out.
void OnStart()
{
AddUseItemCallback("hallwaydoorunlocked", "HallwayKey", "sewer_arched_4", "hallwaydoorunlocked", true);
}

void hallwaydoorunlocked(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("sewer_arched_4", false, false);
RemoveItem("HallwayKey");
PlaySoundAtEntity("unlocking", "unlock_door.snt", "Player", 0, false);
}

And the .lang file for this category:
<CATEGORY Name="Inventory">

<Entry Name="ItemName_HallwayKey">Hallway Key</Entry>
<Entry Name="ItemDesc_HallwayKey">A key for the main hall.</Entry>

</CATEGORY>

As for the key you pick up, the name of the entity is "HallwayKey"
and the CustomSubItemTypeName is also "HallwayKey"

All this considered, my custom story is working properly.

edit: Also, I believe having underscores in the item name may not let it read properly, try changing the item name and desc to:

<EntryName="ItemName_awesomekey1">Awesome Key</Entry>
<Entry Name="ItemDesc_awesomekey1">Key to your moms bedroom</Entry>

I just tried your script and none of the things in my extra_english file are showing up now >_>

EDIT: Nevermind, the CustomSubItemTypeName was blank, testing now
Still not working. Here's my script for the key.

<CATEGORY Name="Inventory">

<Entry Name="ItemName_keystudy1">Living Quarters Key</Entry>
<Entry Name="ItemDesc_keystudy1">A key to the living quarters.</Entry>

</CATEGORY>

All the info on my key:

Name: keystudy1
Active: True
CustomSubItemTypeName: keystudy1
(This post was last modified: 03-24-2011, 01:17 AM by Austums.)
03-24-2011, 01:10 AM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#9
RE: Key to door Script help

Then, quite honestly, I am stumped. Sad
03-24-2011, 01:22 AM
Find
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#10
RE: Key to door Script help

I just think it is so odd that both me and OP are both having this problem. O_o
03-24-2011, 01:23 AM
Find




Users browsing this thread: 1 Guest(s)