Frictional Games Forum (read-only)
Scripting Problem Help Please - 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: Scripting Problem Help Please (/thread-16392.html)



Scripting Problem Help Please - HoyChampoy - 06-22-2012

Hey Guys. I have a complicating problem. I am making a custom story and right now there are two map files. I have a level door that sends you from room 1 to room 2. I was able to allow the player to go back from room 2 to room 1 just in case they forgot something. But, in room 1, there are script areas that the player encounters that sets off a scare. The problem is that when a player leaves room 1 but decides to go back from room 2, they happen to run into a script area that they previously ran into earlier, causing the same scare to happen again. Also a door (not the level door) they had to unlock in room 1 becomes locked again. Is there a way to disable the script areas after you enter them, even if you leave the map, come back into the map, and enter the script area? Help would be very appreciated!


RE: Scripting Problem Help Please - MaZiCUT - 06-22-2012

(06-22-2012, 09:44 AM)HoyChampoy Wrote: Hey Guys. I have a complicating problem. I am making a custom story and right now there are two map files. I have a level door that sends you from room 1 to room 2. I was able to allow the player to go back from room 2 to room 1 just in case they forgot something. But, in room 1, there are script areas that the player encounters that sets off a scare. The problem is that when a player leaves room 1 but decides to go back from room 2, they happen to run into a script area that they previously ran into earlier, causing the same scare to happen again. Also a door (not the level door) they had to unlock in room 1 becomes locked again. Is there a way to disable the script areas after you enter them, even if you leave the map, come back into the map, and enter the script area? Help would be very appreciated!
Make the script area only true 1

meaning you cannot repeat the script.


RE: Scripting Problem Help Please - HoyChampoy - 06-22-2012

(06-22-2012, 09:53 AM)CrazyArts Wrote:
(06-22-2012, 09:44 AM)HoyChampoy Wrote: Hey Guys. I have a complicating problem. I am making a custom story and right now there are two map files. I have a level door that sends you from room 1 to room 2. I was able to allow the player to go back from room 2 to room 1 just in case they forgot something. But, in room 1, there are script areas that the player encounters that sets off a scare. The problem is that when a player leaves room 1 but decides to go back from room 2, they happen to run into a script area that they previously ran into earlier, causing the same scare to happen again. Also a door (not the level door) they had to unlock in room 1 becomes locked again. Is there a way to disable the script areas after you enter them, even if you leave the map, come back into the map, and enter the script area? Help would be very appreciated!
Make the script area only true 1

meaning you cannot repeat the script.
they are all on true 1 already Sad


RE: Scripting Problem Help Please - Traggey - 06-22-2012

Wrong forum, moved.


RE: Scripting Problem Help Please - Cruzore - 06-22-2012

One solution would be to use a global variable to check with a script area collide callback if the player got into map 2(making the variable 1), then only set off the scare in map 1 if that global variable is 0


RE: Scripting Problem Help Please - Mooserider - 06-23-2012

I thought if you set up a callback - in this case probably using AddEntityCollideCallback - in the OnStart section it could only happen once due to the callback only being made the first time you enter the map. If you've set it up in OnEnter then every time you enter the map it will re-make that callback, therefore enabling it to repeat itself. If that's not the problem though FastHunter's solution would work.