[SCRIPT] My locked door doesn't display a message? - 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: [SCRIPT] My locked door doesn't display a message? (/thread-16821.html) Pages:
1
2
|
My locked door doesn't display a message? - KingCrimson - 07-08-2012 I was using one of the tutorials at the wiki because i want a locked door to say "The lock's broken". But when i try to open the door, it doesn't display anything... Here you've a copy of my script: Quote:void lockedoor(string &in entity)Some info that might be useful: PlayerInteractCallback Door's name Category at extra_english.lang where the messages are Name of the message Thanks in advance... RE: My locked door doesn't display a message? - Adny - 07-08-2012 Would you mind showing the full script? The problem most likely lies somewhere in the callback used; what you currently have shown is fine. RE: My locked door doesn't display a message? - KingCrimson - 07-08-2012 You mean the map's script? If so, here it is: Quote://////////////////////////// RE: My locked door doesn't display a message? - Adny - 07-08-2012 You do not have a callback in the script for the function "lockedoor"; would I be correct to assume that your have one in the level editor as "PlayerInteractCallback" for the door under the entity tab? If not, here is a callback you can use: void OnStart() { SetEntityPlayerInteractCallback("locked1", "lockedoor", true); } Alternatively, you can set up an interact callback via the level editor (I prefer this method so I don't use up extra space in my hps file). Simply select any entity (a door in this case), go to the "entity" tab on the right, and in the box under "PlayerInteractCallback" type in anything (this will be the name of the function). You can write the rest of it in the hps file as: void FUNC(string &in asEntity) { ///do stuff } Hope that helped. RE: My locked door doesn't display a message? - KingCrimson - 07-08-2012 (07-08-2012, 04:43 AM)andyrockin123 Wrote: You do not have a callback in the script for the function "lockedoor"; would I be correct to assume that your have one in the level editor as "PlayerInteractCallback" for the door under the entity tab?I have one in the level editor. Under the entity tab. It's there where i put lockedoor RE: My locked door doesn't display a message? - Adny - 07-08-2012 Okay I tested the script using your method and it worked fine (although I replaced the set message function with a sound). Make sure "lockedoor" is written under PlayerInteractCallback and not CallbackFunc. If your problem hasn't been solved yet it is most likely due to your lang file. If nothing has worked so far, please post your extra_english.lang RE: My locked door doesn't display a message? - KingCrimson - 07-08-2012 I put it on PlayerInteractCallback. I'll paste here the .lang file so you check if everything's alright on it: Quote: PS: Most of it is empty, since i've not worked too much on scripts and the .lang file... RE: My locked door doesn't display a message? - FlawlessHappiness - 07-08-2012 If this is your Lang. file then i understand You will have to read up on it! The lang. should go like this: <LANGUAGE> <CATEGORY Name="CustomStoryMain"> <Entry Name="Description"> This is a test of my description </Entry> </CATEGORY> <CATEGORY Name="Journal"> <Entry Name="Note_NAMEOFNOTE_Name">HEADLINE OF THE NOTE</Entry> <Entry Name="Note_NAMEOFNOTE_Text"> THIS IS A TEST OF MY NOTE </Entry> <Entry Name="Note_NAMEOFNOTE_2_Name">HEADLINE</Entry> <Entry Name="Note_NAMEOFNOTE_2_Text"> blablablablablabla </Entry> </CATEGORY> <CATEGORY Name="Inventory"> <Entry Name="ItemName_NAMEOFKEY">KEY NAME</Entry> <Entry Name="ItemDesc_NAMEOFKEY">This is my key description</Entry> </CATEGORY> </LANGUAGE> Do you understand? It works like a script too.. <LANGUAGE> starts the whole file, and </LANGUAGE> ends it. <CATEGORY Name="something"> Starts a new category. </CATEGORY> ends a category. I would say read a little bit more about it RE: My locked door doesn't display a message? - SilentHideButFine - 07-08-2012 (07-08-2012, 04:29 AM)ExenderVes Wrote: I was using one of the tutorials at the wiki because i want a locked door to say "The lock's broken". But when i try to open the door, it doesn't display anything... Here you've a copy of my script: SetMessage("Messages", "Broken", 3); try with that! RE: My locked door doesn't display a message? - KingCrimson - 07-09-2012 (07-08-2012, 11:03 AM)beecake Wrote: If this is your Lang. file then i understand I don't think the .lang is related to this. I would ask you to tell me where I can download one of those in blank. Since the one i have is one i took from a CS (I eliminated all the content from the CS). Quote:quote='SilentHideButFine'Didn't work |