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
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#11
RE: Activating a script area

Okay, I used this script, modified it a bit and tested it, and it works this way:
void OnStart()
{
SetEntityCallbackFunc("tocarnellroomkey", "OnPickup");
}
void OnPickup(string &in asEntity, string &in type)
{
if(asEntity == "tocarnellroomkey")
{
AddEntityCollideCallback("Player", "pusharea", "Push", true, 1);
}
}

void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
AddPlayerBodyForce(0, 0, -100000, false);
}

You need a really big amount at addplayerbodyforce, or it's barely visible. Also, playsoundatentity should be player, not some door, as a door can't make such terrified noises. Also, I changed the area to be collided with only once, since you would be pushed all the time if you went through it.

Edit: I tried this several times with a other function name than OnPickup, and since it didn't work, i assume that the function must be named OnPickup. If someone can falsify this, I would be happy to know a different way.
(This post was last modified: 06-21-2012, 06:14 PM by Cruzore.)
06-21-2012, 06:05 PM
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)