[LANG] Need help displaying door is locked on non-exit doors. - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [LANG] Need help displaying door is locked on non-exit doors. (/thread-13272.html) Pages:
1
2
|
RE: Need help displaying door is locked on non-exit doors. - Your Computer - 02-13-2012 The issue, aside from the fact that the callback setter is in a random code block, is that Door != locked_door. RE: Need help displaying door is locked on non-exit doors. - julianprokop - 02-13-2012 <LANGUAGE> <CATEGORY Name="CustomStoryMain"> <Entry Name="Description"> Just a brief description! </Entry> </CATEGORY> <CATEGORY Name="Inventory"> <Entry Name="ItemDesc_roomkey">"Room Key"</Entry> <Entry Name="ItemName_roomkey">"Room Key"</Entry> </CATEGORY> <CATAGORY Name="Doors"> <Entry Name = "door"> The door seems to be locked and needs a key.</Entry> </CATAGORY> </LANGUAGE> I also, went back and changed "Door" to "locked_door" in the if statement. Still nothing. RE: Need help displaying door is locked on non-exit doors. - flamez3 - 02-13-2012 I can't find anything wrong with the language file. Add a debug message using: AddDebugMessage("it works", true); Into the function. Turn on debug messages on developer mode and test doing the same thing. This will eliminate if the callback doesn't work; or if the .lang file has something wrong with it. Sorry, I don't know what else to do about this :/
RE: Need help displaying door is locked on non-exit doors. - Your Computer - 02-13-2012 You spelled category wrong for the Doors category. RE: Need help displaying door is locked on non-exit doors. - Linus Ågren - 02-13-2012 I noticed an error in your LANG file. PHP Code: <Entry Name="ItemDesc_roomkey">"Room Key"</Entry> You have written Room Key as "Room Key". Remove the "s and it should probably work.
Also, you named it CATAGORY and not CATEGORY at the bottom. If you want to do SilentStriker's method with local vars, here's one example. Example: On your UseItemCallback, add: PHP Code: SetLocalVarInt("doorUnlocked", 1); And on your InteractCallback, do something like: PHP Code: void CALLBACK(string &in asEntity) RE: Need help displaying door is locked on non-exit doors. - julianprokop - 02-13-2012 This is what I've got, and it doesn't work still I fixed the .lang file though a while ago. /////////CALLBACK { AddUseItemCallback("", "key_study_1", "door_locked", "UsedKeyOnDoor", true); SetLocalVarInt("doorUnlocked", 1); } ////////LOCKED DOOR MESSAGE void door_message(string &in asEntity) { if(GetLocalVarInt("doorUnlocked") == 0) { SetMessage("Doors", "door", 3.0f); } } RE: Need help displaying door is locked on non-exit doors. - Linus Ågren - 02-13-2012 Put the LocalVarInt code inside your UsedKeyOnDoor function. RE: Need help displaying door is locked on non-exit doors. - julianprokop - 02-13-2012 Like this? /////////CALLBACK { AddUseItemCallback("", "key_study_1", "door_locked", "UsedKeyOnDoor", true); } ////////LOCKED DOOR MESSAGE void door_message(string &in asEntity) { if(GetLocalVarInt("doorUnlocked") == 0) { SetMessage("Doors", "door", 3.0f); } } ////////USED KEY ON DOOR void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door_locked", false, true); PlaySoundAtEntity("", "unlock_door", "door_locked", 0, false); RemoveItem("study_key_1"); AddDebugMessage("KeyOnDoor", false); SetLocalVarInt("doorUnlocked", 1); } RE: Need help displaying door is locked on non-exit doors. - onv - 02-14-2012 Is your door a Level Door ? or just a normal door ? For the level doors , you can use this void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry); Displays a message when interacting with a locked level door. asName - internal name asTextCat - the category in the .lang file asTextEntry - the entry in the .lang file : RE: Need help displaying door is locked on non-exit doors. - Ninami - 02-15-2012 Sorry but you're not even using the functions they told you to use? They told you to use: "SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);" And I can't find that function in your script... I'm currently on a Mac so I can't help you but your script is totally wrong. If you still have problems when I'm on my PC then I'll help you. |