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
Script Help Key script
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#1
Key script

// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("masterbedroomdoor", false, true);
PlaySoundAtEntity("", "unlock_door", masterbedroomdoor, 0, false);
RemoveItem(Masterbedroomkey);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Can anyone tell me what's wrong here?

Oh right, you might need to know the problem xD
When I pick up the key it just says Picked Up... no name..
(This post was last modified: 02-03-2012, 09:42 AM by Saren.)
02-03-2012, 09:22 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Key script

(02-03-2012, 09:22 AM)Saren Wrote: Oh right, you might need to know the problem xD
When I pick up the key it just says Picked Up... no name..

You sure it's not Masterbedroomkey and masterbedroomdoor have not been declared? Regardless, the issue you mention has nothing to do with the script, it concerns the .lang file and what you specified for CustomSubItemTypeName in the level editor.

Tutorials: From Noob to Pro
02-03-2012, 10:03 AM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#3
RE: Key script

(02-03-2012, 10:03 AM)Your Computer Wrote:
(02-03-2012, 09:22 AM)Saren Wrote:

You sure it's not Masterbedroomkey and masterbedroomdoor have not been declared? Regardless, the issue you mention has nothing to do with the script, it concerns the .lang file and what you specified for CustomSubItemTypeName in the level editor.
Yea I thought about that.... you wonna check and see? Cause I see no problems there either.. lol, but I might be wrong


02-03-2012, 10:06 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Key script

We need your .lang text

02-03-2012, 10:06 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#5
RE: Key script

Alrighty then, here you go
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are Dr. Alexandrov. A very famous rich Russian doctor who is trying to make war easier for the Russian army.</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_note1_Name">Experiment Report</Entry>
<Entry Name="Note_note1_Text">The experiments are going well dr. We've almost completed the first attempt of a mindless soldier but we still have to find a way to make it follow your orders.
<Entry Name="Note_note2_Name">Failure!</Entry>
<Entry Name="Note_note2_Text">Dr! The experiment has gone wrong! It's lose, don't have much time... I can hear it's footsteps outside the door, don't think it knows I'm here... Yet. I've putted the key to the cellar in the drawers. Hurry dr.
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_Masterbedroomkey">Master bedroom key</Entry>
<Entry Name="ItemDesc_Masterbedroomkey">The key to my bedroom door.</Entry>
<Entry Name="ItemName_Cellarkey">Cellar key</Entry>
<Entry Name="ItemDesc_Cellarkey">This key will open the door to my cellar</Entry>
<Entry Name="ItemName_Prisonkey">Prison key</Entry>
<Entry Name="ItemDesc_Prisonkey">The key to the prison section in my mansion</Entry>
</CATEGORY>
<CATEGORY Name="Map1">
<Entry Name="Masterbedroomdoor">Locked. I need to find the key.</Entry>
<Entry Name="InteractDoorHaveKey">Use the key on the door to unlock it.</Entry>
</CATEGORY>
</LANGUAGE>
02-03-2012, 10:09 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Key script

I get the feeling CustomSubItemTypeName was not specified for the item.

Tutorials: From Noob to Pro
02-03-2012, 10:13 AM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#7
RE: Key script

I have made a customsubname if that's what your saying..
Or do you have to do something else to make it accept it or something.... wauw.. that'd be weird
02-03-2012, 10:15 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Key script

Masterbedroomkey should be the value of the item's CustomSubItemTypeName. If you specified it after testing out the map after placing the item in the map, then it could be a .map_cache conflict.

Tutorials: From Noob to Pro
02-03-2012, 10:18 AM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#9
RE: Key script

I don't have that anymore, it... hmm.. let's say it made complications I could not accept, so it had to die
So that can't be it..
(This post was last modified: 02-03-2012, 10:21 AM by Saren.)
02-03-2012, 10:21 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Key script

Re-examining the .lang file, you forgot to close the Note_note2_Text entry.

Tutorials: From Noob to Pro
02-03-2012, 10:30 AM
Website Find




Users browsing this thread: 1 Guest(s)