Can anyone help me? :) - 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: Can anyone help me? :) (/thread-19668.html) |
Can anyone help me? :) - Projektamensia - 12-24-2012 Hello there guys! We are almost finished with out school project - Setting up our own amnesia custom story. Now I need some help, I want to know how to reset a map. With other words: 1. I got and scriptarea inside the map 2. When the players collides with the scriptarena box I want the map to reset to the state when I entered it for the first time. Change to OnEnter() did not work. I tried this but it did not work: void OnStart/(OnEnter) { AddEntityCollideCallback("Wall2", "Dead", "Deadd", true, 0); } void Deadd(string &in asParent, string &in asChild, int alState) { FadeOut(2); AddTimer("", 3.0f, "ChaMap2"); } void ChaMap2(string &in asTimer) { ChangeMap("10_Crushwall.map", "start", "", ""); } I would be glad if someone could help me as fast as possible since we need to be done with the Beta soon. The Beta will include an Full conversion mod! Thank you for all the answers, Alexander. http://www.moddb.com/mods/the-horrors-of-castle-greenborogh RE: Can anyone help me? :) - Statyk - 12-24-2012 (12-24-2012, 09:48 PM)Projektamensia Wrote: Hello there guys! I'm not sure exactly how the whole hps is written, or what the exact error is (what's wrong), but from looking at what you gave, try this: void OnStart() { AddEntityCollideCallback("Player", "Dead", "Deadd", false, 1); } void Deadd(string &in asParent, string &in asChild, int alState) { FadeOut(2); AddTimer("", 3.0f, "ChaMap2"); } void ChaMap2(string &in asTimer) { ChangeMap("10_Crushwall.map", "start", "", ""); } RE: Can anyone help me? :) - Projektamensia - 12-24-2012 (12-24-2012, 09:52 PM)Statyk Wrote:(12-24-2012, 09:48 PM)Projektamensia Wrote: Hello there guys! It did not work Any other ideas? RE: Can anyone help me? :) - Statyk - 12-24-2012 What exactly is going wrong? RE: Can anyone help me? :) - Projektamensia - 12-24-2012 (12-24-2012, 10:02 PM)Statyk Wrote: What exactly is going wrong? Okay so the thing is that on the map it is some puzzles that i want to reset. If you do something wrong i want the player to be forced so teleport back to the starting point and be forced to do everything again on the map. So how do I reset the map so all the puzzles are back to its normal state? RE: Can anyone help me? :) - Statyk - 12-24-2012 Your best bet is to use local variables to set objects in places for this puzzle. Then when they enter this script area, it checks the local variable amount. If it does not match a specific amount, have the player go back to the spawn and set the local variable back to it's original amount. This will place all objects back in their original place. RE: Can anyone help me? :) - Projektamensia - 12-24-2012 (12-24-2012, 10:08 PM)Statyk Wrote: Your best bet is to use local variables to set objects in places for this puzzle. Then when they enter this script area, it checks the local variable amount. If it does not match a specific amount, have the player go back to the spawn and set the local variable back to it's original amount. This will place all objects back in their original place. So if i set my moving wall to variable, AddLocalVarInt(""Wall", 1); and my door, AddLocalVarInt(""Wall", 1);. Then in my, void OnLeave(); { if(GetLocalVarInt("Wall") == 2) { //Nothing happens... } else { ChangeMap("10_Crushwall.map", "start", "", ""); } } Is this what you mean? RE: Can anyone help me? :) - Projektamensia - 12-25-2012 Thank you for all of your advises but I came up with an solution. |