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


Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"If in an area..." Script Problem
SLi78 Offline
Junior Member

Posts: 23
Threads: 6
Joined: Sep 2010
Reputation: 0
#2
RE: "If in an area..." Script Problem

(10-28-2010, 04:41 PM)Dr4konite Wrote: Hey Guys.

I successfully scripted my way through the first events of my map, but now I got to a problem, which I don't know how to solve. Even the search engine gave me no results on this, so maybe you can help me out.

First of all my idea:
I scripted an event, that makes a key disappear on pickup, starting a timer which will initialise another event a little bit later. In this event, a door will crack open but before this happens, the player still got time (and is advised) to hide himself (as for this expample it's in a cabinet).

Now there are two ways the player can act:
1. He stays in the room, not hiding himselft. In this case, I want to let him faint when the door cracks open.
2. He hides in the cabinet (my "Safe-Area"), where he will not faint or loose much sanity.

So I'm thinkin about "disabling" a command, when the player is in this area (cabinet) so he won't faint, but I don't know if this is the right way and if the command "AddEntityCollideCallback" is the right choice, because the player should not collide, but be "in" the area.

Hope you can help me.
Greetings
Dr4konite



I would use a flag variable for example an int value.

In the Function that is called when the player collides wit the area you set the value on 1 for safe.

If the player is leaving the safe area you set 0 for not safe.

In your timerfunction you just lok for the flag with an if-statement.
10-28-2010, 04:52 PM
Find


Messages In This Thread
"If in an area..." Script Problem - by Dr4konite - 10-28-2010, 04:41 PM
RE: "If in an area..." Script Problem - by SLi78 - 10-28-2010, 04:52 PM



Users browsing this thread: 1 Guest(s)