Using pickLine for collision detection
by Christopher Asche · in Game Design and Creative Issues · 01/25/2012 (4:34 am) · 2 replies
I wasn't sure which part of the forum to post it in, as it applies mostly to just torque script. So sorry if I'm in the wrong spot.
My question is basically what to do with the pickLine command, specifically in relation to detecting collisions. Let me lay out my scenario....
The player character is up against a group of thugs (class enemy). He can punch or kick. (but for simplicity's sake right now let's just say punch) The player presses the punch button and...
this is where I should be bringing up the pickLine to detect the enemies within the range of his strike, yes? I only even need the first enemy it hits.Problem is that I can't find solid information about how to implement this. I haven't seen anything in tutorials (unless I missed it somehow) and I've been searching the documentation and forums and seen some people mention needing to use masks, which use the bit() commands, etc. It wasn't super clear to me, a newbie. The Documentation basically says "Draws a line and tells you what it intersects with"....
I get WHAT it does, I want to know how to USE it!
So, not to be needy or anything, but does anyone know of a tutorial for this kind of usage (as my scenario above), or can someone give me a bit of an example? (Including some help setting up masking) ...maybe dumbed down a bit for those of us who come home from work with a melted brain. >_< As much as I look over this stuff it just doesn't "click" for me.
My question is basically what to do with the pickLine command, specifically in relation to detecting collisions. Let me lay out my scenario....
The player character is up against a group of thugs (class enemy). He can punch or kick. (but for simplicity's sake right now let's just say punch) The player presses the punch button and...
this is where I should be bringing up the pickLine to detect the enemies within the range of his strike, yes? I only even need the first enemy it hits.Problem is that I can't find solid information about how to implement this. I haven't seen anything in tutorials (unless I missed it somehow) and I've been searching the documentation and forums and seen some people mention needing to use masks, which use the bit() commands, etc. It wasn't super clear to me, a newbie. The Documentation basically says "Draws a line and tells you what it intersects with"....
I get WHAT it does, I want to know how to USE it!
So, not to be needy or anything, but does anyone know of a tutorial for this kind of usage (as my scenario above), or can someone give me a bit of an example? (Including some help setting up masking) ...maybe dumbed down a bit for those of us who come home from work with a melted brain. >_< As much as I look over this stuff it just doesn't "click" for me.
About the author
#2
I've not used T2D much, so I can't help you myself, but hopefully there'll be someone over there who can! A quick search brought up this, which seems to have some links to documentation. Though apparently Google didn't want to search for 'pickline'... nor would it turn up any results for 'pick line', though it did for 'line pick'! How dodgy.
EDIT: Oh - here's a tip. Since the site search is pretty dodgy, I tend to just use Google. Type in site:garagegames.com and then your query to restrict your search to this site. Tends to work well for me!
01/28/2012 (7:58 am)
You may get a better response in the T2D forums - you didn't mention but from your description it sounds like you're using T2D. This forum is a little slow most of the time.I've not used T2D much, so I can't help you myself, but hopefully there'll be someone over there who can! A quick search brought up this, which seems to have some links to documentation. Though apparently Google didn't want to search for 'pickline'... nor would it turn up any results for 'pick line', though it did for 'line pick'! How dodgy.
EDIT: Oh - here's a tip. Since the site search is pretty dodgy, I tend to just use Google. Type in site:garagegames.com and then your query to restrict your search to this site. Tends to work well for me!
Christopher Asche
Default Studio Name