[SCRIPT] Adding mementos to locked 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: [SCRIPT] Adding mementos to locked doors? (/thread-19089.html) |
Adding mementos to locked doors? - Tiger - 11-04-2012 I want to add a memento to a locked door and I looked for it on the wiki and found this: http://wiki.frictionalgames.com/hpl2/tutorials/script/adding_messages_to_locked_doors I tried to do the same thing but instead of a message I tried to make a memento "pop-up" and it does not work (surprisingly!). How should I do to make it work? RE: Adding mementos to locked doors? - ZodiaC - 11-04-2012 (11-04-2012, 07:36 PM)Tigerwaw Wrote: I want to add a memento to a locked door and I looked for it on the wiki and found this:did you create a lang file? RE: Adding mementos to locked doors? - The chaser - 11-04-2012 So, the whole script would look like this: void DoorLockedPlayer(string &in entity) { if(GetSwingDoorLocked("EXAMPLE_DOOR") == true) { AddQuest(string& asName, string& asNameAndTextEntry); } } RE: Adding mementos to locked doors? - Tiger - 11-04-2012 (11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?Yes, of course (11-04-2012, 07:44 PM)The chaser Wrote: So, the whole script would look like this:What am I supposed to write into the .lang file and where should I write the name for the memento that is in the .lang file? RE: Adding mementos to locked doors? - ZeroPie - 11-04-2012 (11-04-2012, 07:54 PM)Tigerwaw Wrote:<Entry Name="Quest_MyQuest_Text">TEXT HERE</Entry>(11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?Yes, of course Must be in .lang category Journal And the script would like this: AddQuest("myquest", "MyQuest"); To complete a Momento(aka. quest) you just script this: CompleteQuest("myquest", "MyQuest"); So basicly the same but instead of 'Add' just type in 'Complete'. Hope it helps. RE: Adding mementos to locked doors? - Tiger - 11-04-2012 (11-04-2012, 11:18 PM)ZeroPie Wrote:(11-04-2012, 07:54 PM)Tigerwaw Wrote:TEXT HERE(11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?Yes, of course Ok thanks. Does it have to have a 'completeQuest'-thing or is it only if you want the player to regain sanity(the blue screen and calm music playing)? AddQuest("myquest", "MyQuest"); What should I put instead of the 'MyQuest' and 'myquest'? Is this right? .hps: If(GetSwingDoorLocked("BlockedDoor") == true) { AddQuest("myquest", "BlockedDoorQuest"); } .lang: <CATEGORY Name="Journal"> <Entry Name="Quest_BlockedDoorQuest_Text">Text that you're not allowed to see</Entry> </LANGUAGE> RE: Adding mementos to locked doors? - ZeroPie - 11-05-2012 (11-04-2012, 11:19 PM)Tigerwaw Wrote:(11-04-2012, 11:18 PM)ZeroPie Wrote:(11-04-2012, 07:54 PM)Tigerwaw Wrote:TEXT HERE(11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?Yes, of course The CompleteQuest script is just to remove the momento from the player's journal, but it can be combined with sanity scripts too. But the CompleteQuest script is not required, but if it's not used the momento will be there the whole Custom Story. And the one with the lowercase letters 'myquest' can be anything but I recommend using the same as the one with uppercase letters. (And just so you know it doesn't need to be uppercase/lowercase, but I do like so.) So you can change the AddQuest to: AddQuest("blockeddoorquest", "BlockedDoorQuest"); Try that out and tell us if it works. RE: Adding mementos to locked doors? - Tiger - 11-05-2012 I've tried with this script: .hps: if(GetSwingDoorLocked("BlockedDoor") == true) { AddQuest("BlockedDoorQuest", "BlockedDoorQuest"); } Void OnLeave() { CompleteQuest("BlockedDoorQuest", "BlockedDoorQuest"); } .lang: <CATEGORY Name="Journal"> <Entry Name="Quest_BlockedDoorQuest_Text">The door seems to be blocked from the inside. You need to find another way in.</Entry> </CATEGORY> It still gives me an error that says that there's something wrong with the .hps :c RE: Adding mementos to locked doors? - FlawlessHappiness - 11-05-2012 Maybe it's not in that script, but rather somewhere where you mistakely deleted something, or added something. Check where the game says the problem is. It is described with line-numbers fx: (Linenumber, Letternumber) (95, 35) Also tell us. What does the error say? Unexpected end of file? Unexpected ...? RE: Adding mementos to locked doors? - Tiger - 11-05-2012 (11-05-2012, 12:58 PM)beecake Wrote: Maybe it's not in that script, but rather somewhere where you mistakely deleted something, or added something. Check where the game says the problem is. It is described with line-numbersIt says: Spoiler below!
|