Frictional Games Forum (read-only)
Can you re-enable areas once used? - 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 you re-enable areas once used? (/thread-13867.html)

Pages: 1 2


RE: Can you re-enable areas once used? - Your Computer - 03-09-2012

I'm having trouble picturing that. It sounds like Area_6 and Area_7 are in the same spot.



RE: Can you re-enable areas once used? - Nevicar - 03-10-2012

I took a screenshot of the map to sort of demonstrate it better.

http://i.imgur.com/U4tAW.jpg


Now that you can see it:

Player walks into door, activates the first area (area_4). The key in the desk activates Area_3, when its picked up the door swings open slowly, but once the player comes in contact with Area_3 it slams shut.

So basically, if the player walks into the room and then doesn't open the desk to find the key, they may run back in later and the door won't close, causing the propforce to close the door instead of opening it, making the door slam worthless when they run into area_3.

What area7 does is check the player for the key, if they have it, it does nothing and carries on, but if they DONT have the key then it activates area_6 which then repeats the door close when they re-enter the room.

My brain is telling me I may be over thinking this one.


RE: Can you re-enable areas once used? - Your Computer - 03-10-2012

Okay, the best way i'm going to understand this is if i ignore the existence of the current areas.

So let me get this straight. If the player walks into the room, the door closes behind them. If he exits having picked up nothing, then nothing happens. If, however, he picks up the key, the door opens slightly if not already open (or possibly open even more than what it already is). Having the key in his inventory, if they attempt to walk out of the room, the door closes on them.

You only want this to repeat if the player hasn't obtained the key in the room.

Is this correct? If so, this all may require no more than 2 areas.



RE: Can you re-enable areas once used? - Nevicar - 03-10-2012

Quote:Okay, the best way i'm going to understand this is if i ignore the existence of the current areas.

So let me get this straight. If the player walks into the room, the door closes behind them. If he exits having picked up nothing, then nothing happens.

Yes

Quote:If, however, he picks up the key, the door opens slightly if not already open (or possibly open even more than what it already is). Having the key in his inventory, if they attempt to walk out of the room, the door closes on them.


You only want this to repeat if the player hasn't obtained the key in the room.

Is this correct? If so, this all may require no more than 2 areas.

Yes, I want this starting at when the first door closes when he first enters the room to repeat if he does not have the key




RE: Can you re-enable areas once used? - Nevicar - 03-10-2012

Honestly I feel like my question has grown out of control, so I am going to restate the question.

I want to have a zone that checks the player for an item, if he has it a completely different area stays disabled but if he doesn't have it, it becomes enabled.

This is the code:

AddEntityCollideCallback("Player", "Area_7", "fdoorclose_func1", true, 1);

void fdoorclose_func1(string &in asParent, string &in asChild, int alState)
{
if (HasItem("key1")) SetEntityActive("Area_6", false);
else SetEntityActive("Area_6", true);
}



This code doesn't work, so it's obviously wrong, I just can't figure out why.

EDIT: I think I've figured it out, do I need to set the area delete option to FALSE after what function it calls? Therefore; the area is not deleted just set to disabled, or is that not how the "abDeleteOnCollide - determines whether the callback after it was called" works.


RE: Can you re-enable areas once used? - Nevicar - 03-10-2012

Solved. Smile