| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Wed Oct 08, 2008 5:06 pm Post subject: Flash Actionscript's HitTest Function |
|
|
| How does hit test work? I tried hooking IntersectRect (The only collision function I know) but apparently Flash's HitTest doesn't use Intersect so... How does that function worK and is there a way to hook it?
|
|
| Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Wed Oct 08, 2008 6:44 pm Post subject: |
|
|
Which ActionScript? I use HitTest all the time in AS3.
_________________
Blog
| Quote: | Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that |
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Wed Oct 08, 2008 6:56 pm Post subject: |
|
|
IDIOT >.>
Im trying to hook hittest not call it...
|
|
| Back to top |
|
 |
LolSalad Grandmaster Cheater
Reputation: 1
Joined: 26 Aug 2007 Posts: 988 Location: Australia
|
Posted: Wed Oct 08, 2008 7:28 pm Post subject: |
|
|
| dnsi0 wrote: | IDIOT >.>
Im trying to hook hittest not call it... |
You're the idiot. Nobody can help you hook it unless you tell us which version of ActionScript.
I know how you can hook it with ActionScript itself if it's ActionScript 2, by the way.
_________________
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Wed Oct 08, 2008 7:35 pm Post subject: |
|
|
| as2
|
|
| Back to top |
|
 |
LolSalad Grandmaster Cheater
Reputation: 1
Joined: 26 Aug 2007 Posts: 988 Location: Australia
|
Posted: Wed Oct 08, 2008 8:20 pm Post subject: |
|
|
| Code: | _root.htBackup = MovieClip.prototype.hitTest;
MovieClip.prototype.hitTest = function(xORtarget, y, shapeFlag) {
if (shapeFlag != null) {
trace('hitTest (3 parameters form): ' + this + ', ' + xORtarget + ', ' + y + ', ' + shapeFlag);
return _root.htBackup(xORtarget, y, shapeFlag);
} else {
trace('hitTest (single parameter form): ' + this + ', ' + xORtarget);
return _root.htBackup(xORtarget);
}
}
trace(hax1.hitTest(hax2));
trace(hax1.hitTest(25, 25, hax2)); |
hax1 and hax2 are MovieClips on the stage. This hooks both forms of hitTest; the one that requires a single parameter (target) and the other which requires 3 parameters (x, y, shapeFlag).
Outputs: | Code: | hitTest (single parameter form): _level0.hax1, _level0.hax2
true/false
hitTest (3 parameters form): _level0.hax1, 25, 25, _level0.hax2
true/false
|
_________________
|
|
| Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Wed Oct 08, 2008 9:41 pm Post subject: |
|
|
| dnsi0 wrote: | IDIOT >.>
Im trying to hook hittest not call it... |
Don't be so quick to judge.
_________________
Blog
| Quote: | Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that |
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Thu Oct 09, 2008 5:20 pm Post subject: |
|
|
No your not getting me...
What I want is to edit the memory NOT as.
So basically flash processes hitTest as a function and uses commands to execute. So I want to edit a compiled flashj movie and hook HitTest so that I can create a godmode in certain areas.
|
|
| Back to top |
|
 |
LolSalad Grandmaster Cheater
Reputation: 1
Joined: 26 Aug 2007 Posts: 988 Location: Australia
|
Posted: Fri Oct 10, 2008 12:22 am Post subject: |
|
|
| dnsi0 wrote: | No your not getting me...
What I want is to edit the memory NOT as.
So basically flash processes hitTest as a function and uses commands to execute. So I want to edit a compiled flashj movie and hook HitTest so that I can create a godmode in certain areas. |
By using AS2 you can create that godmode effect; that code I posted is capable of hooking hitTest in a compiled Flash movie by using LoadMovie with the hooking SWF, and can use commands like fscommand to send the data to the program or it can do all the godmode work itself.
_________________
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Fri Oct 10, 2008 12:27 am Post subject: |
|
|
| IntersectRect is windows API, Flash is cross platform. It will use a custom function.
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Fri Oct 10, 2008 8:32 am Post subject: |
|
|
| Thanks.
|
|
| Back to top |
|
 |
|