Need help with custom story - 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: Need help with custom story (/thread-56195.html) |
Need help with custom story - japanesewhisky - 01-12-2019 Im making a custom story and on the 3rd map I made, it will not let me transition to the 4th map. this is my code: void OnStart() { AddUseItemCallback("Opendoor", "hehexd", "door69", "UnlockLevelDoor", true); } void UnlockLevelDoor(string &in asItem, string &in asEntity) { SetLevelDoorLocked ("door69", false); ChangeMap("Level4","PlayerStartArea_1","",""); } anyone halp? RE: Need help with custom story - Mudbill - 01-13-2019 What do you mean? Why are you calling ChangeMap? It looks like the function is supposed to unlock a door, but it also immediately changes the map. If you can explain in more detail what you're trying to do, what you expect to happen, and what is actually happening, that would help us. RE: Need help with custom story - japanesewhisky - 01-13-2019 (01-13-2019, 03:36 AM)Mudbill Wrote: What do you mean? This is what I wanted. Initially I wanted to create a short map that just had 1 door that led to my 4th map. But it didn't lead to anything and the error message was that it couldn't load the world and then the file location, but it didn't say my lvl name, it just said could not load world file ..../.map. I am calling ChangeMap but i thought that a lvl door somehow needs a key to work so I wrote this too. But I want an unlocked door that leads to my 4th map. Though when I open it it displays the generic message (as previously mentioned) when a lvl door isn't linked to a particular level. Better? RE: Need help with custom story - japanesewhisky - 01-13-2019 (01-13-2019, 03:36 AM)Mudbill Wrote: What do you mean? void UnlockLevelDoor(string &in asItem, string &in asEntity) { SetLevelDoorLocked ("door69", false); ChangeMap("Level4","PlayerStartArea_1","",""); } basically this is the only part that I want. The one part that tells the one door to lead me to another level. Do I need to add more, or is it a syntax error? RE: Need help with custom story - Mudbill - 01-13-2019 But why do you use script for this? Is it not enough to add the next level in the "Level" box for the door in the editor? You might need to add the .map extension to your ChangeMap function if you want that to work. RE: Need help with custom story - japanesewhisky - 01-13-2019 (01-13-2019, 04:20 PM)Mudbill Wrote: But why do you use script for this? Is it not enough to add the next level in the "Level" box for the door in the editor? Dude please don't ask me. The only type of coding I do is front end web dev. I'm a complete rookie when it comes to this. Thanks for the advice I will let you know whether it works. RE: Need help with custom story - japanesewhisky - 01-13-2019 (01-13-2019, 04:20 PM)Mudbill Wrote: But why do you use script for this? Is it not enough to add the next level in the "Level" box for the door in the editor? Well I just realized the mistake and fixed it. Thanks! RE: Need help with custom story - Mudbill - 01-14-2019 Apologies if I sounded condecending. Would you like to share the solution? RE: Need help with custom story - japanesewhisky - 01-15-2019 (01-14-2019, 06:01 PM)Mudbill Wrote: Apologies if I sounded condecending. Would you like to share the solution?There were 2 in fact. 1. Hence I didn't know that when you press ''save game'' and then go to update the level in lvl editor, it doesn't change when you load your saved game so thats why it wast working the script was correct im just retarded. I didnt want to replay the whole thing again, even though its super short its just a really bad screw around custom ''story''. 2. I realized that you can make doors go to other levels in the level editor itself, I thought you had to script for it. Which I did for the 1st 3 lvls, but because I didnt know that you could just do it in the level editor. Overall, I'm releasing the map next week on the forums just as a joke. I started like several years ago but never bothered to continue. Now I started getting into coding and do this just as an experiment. And I'm also a loyal fan of the game and Frictional Games :3. |