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
Activating a script area
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#2
RE: Activating a script area

(06-21-2012, 04:58 PM)ApeCake Wrote: Hello again. So I thought about something very simple, a script area that activates upon a key pickup. When I walk into the script area nothing happens, but after I picked up the key and walk in it it does something (in this case push the player back) (I had in mind delete the script area after one use). However, after I picked up the key and walked in the area nothing happened. Here's my script. The script area is called "pusharea" and the key "tocarnellroomkey". The area is not active in the beginning obviously.



void OnStart()

{
AddEntityCollideCallback("Player", "pusharea", "Push", false, 1);
SetEntityCallbackFunc("tocarnellroomkey", "OnPickupKey");
}


//The push script
void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(0, 0, -2000, false);
}

//The setting-the-area-active script
void OnPickupKey(string &in asEntity, string &in type)
{
SetEntityActive("pusharea", true);
PlaySoundAtEntity("", "scare_male_terrified5.snt", "randomatticdoor", 2, false);
}

So my guess is that SetEntityActive doesn't work on script areas? Can anyone improve this or knows what I did wrong? Thanks in advance.

EDIT: If I do the code in a code window, it gets messed up.
SetEntityActive works on script areas, i don't really understand what you are trying to achieve but i guess you want a script area to be set to true/false when you collide with another script area?

Hi.
06-21-2012, 05:04 PM
Website Find


Messages In This Thread
Activating a script area - by ApeCake - 06-21-2012, 04:58 PM
RE: Activating a script area - by MaZiCUT - 06-21-2012, 05:04 PM
RE: Activating a script area - by ApeCake - 06-21-2012, 05:05 PM
RE: Activating a script area - by Cruzore - 06-21-2012, 05:04 PM
RE: Activating a script area - by Adny - 06-21-2012, 05:09 PM
RE: Activating a script area - by ApeCake - 06-21-2012, 05:17 PM
RE: Activating a script area - by Cruzore - 06-21-2012, 05:17 PM
RE: Activating a script area - by Cruzore - 06-21-2012, 05:20 PM
RE: Activating a script area - by Adny - 06-21-2012, 05:23 PM
RE: Activating a script area - by ApeCake - 06-21-2012, 05:33 PM
RE: Activating a script area - by Cruzore - 06-21-2012, 06:05 PM
RE: Activating a script area - by ApeCake - 06-21-2012, 06:19 PM
RE: Activating a script area - by Cruzore - 06-21-2012, 06:21 PM



Users browsing this thread: 1 Guest(s)