Frictional Games Forum (read-only)

Full Version: Key script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
// 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..
(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.
(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


We need your .lang text
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>
I get the feeling CustomSubItemTypeName was not specified for the item.
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
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.
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..
Re-examining the .lang file, you forgot to close the Note_note2_Text entry.
Pages: 1 2