Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can you re-enable areas once used?
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#11
RE: Can you re-enable areas once used?

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

Tutorials: From Noob to Pro
03-09-2012, 11:13 PM
Website Find
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#12
RE: Can you re-enable areas once used?

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.
03-10-2012, 01:30 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#13
RE: Can you re-enable areas once used?

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.

Tutorials: From Noob to Pro
03-10-2012, 02:17 AM
Website Find
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#14
RE: Can you re-enable areas once used?

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

(This post was last modified: 03-10-2012, 04:18 AM by Nevicar.)
03-10-2012, 04:17 AM
Find
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#15
RE: Can you re-enable areas once used?

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.

Beginner scripter, learning the ropes, creating my own story, would love to help someone else script!
(This post was last modified: 03-10-2012, 07:16 PM by Nevicar.)
03-10-2012, 07:01 PM
Find
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#16
RE: Can you re-enable areas once used?

Solved. Smile

Beginner scripter, learning the ropes, creating my own story, would love to help someone else script!
03-10-2012, 09:36 PM
Find




Users browsing this thread: 1 Guest(s)