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
Check if something is touching an entity or area.
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#1
Check if something is touching an entity or area.

Hello, i do not know if it is possible. But i need a window to break with EVERY entity. But for as far as i know, is that not possible, besides typing EVERY entity.

Signature to awesome to be displayed.
(This post was last modified: 05-23-2012, 09:42 AM by Stepper321.)
05-22-2012, 04:07 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Check if something is touching an entity or area.

void OnStart()
{
for(int i; i<7; i++)
AddEntityCollideCallback("entity_" + i, "Windowname", "BreakWindow", true, 1);
// Note that i<7 should be changed to accommodate however many entities you have, and make sure you name every entity entity_1, entity_2, and so on, or however you want to name them
}

void BreakWindow(string &in asParent, string &in asChild, int alState)
{
// Insert breaking script here.
}

Also note that that's just something I tossed together off of the top of my head.

//EDIT - Fix'd.

(This post was last modified: 05-22-2012, 06:12 PM by Obliviator27.)
05-22-2012, 04:28 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#3
RE: Check if something is touching an entity or area.

(05-22-2012, 04:28 PM)Obliviator27 Wrote: void OnStart()
{
for(int i; i<7; i++){
AddEntityCollideCallback("entity_" + i, "Windowname", "BreakWindow", true, 1);
// Note that i<7 should be changed to accommodate however many entities you have, and make sure you name every entity entity_1, entity_2, and so on, or however you want to name them
}

void BreakWindow(string &in asParent, string &in asChild, int alState)
{
// Insert breaking script here.
}

Also note that that's just something I tossed together off of the top of my head.


Thats something ive been wondering for a while too steppers.Im gonna go test ^ that now.
EDIT:Yup that worked perfectly.I just removed the { from for(int i; i<7; i++){ and now it works well.

(This post was last modified: 05-22-2012, 05:27 PM by Datguy5.)
05-22-2012, 05:10 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Check if something is touching an entity or area.

Whoop. I forgot to enclose it properly. Thanks for catching that.

05-22-2012, 06:12 PM
Find




Users browsing this thread: 1 Guest(s)