I'm working on a little test for a fighting type platformer like DMC/Smash, and I am wondering how do you make hit boxes. I have animations already, but I don't know how to set them up right. SO far I have drawn out the way I want to do it, but the coding(MMF2) is confusing me. How do I make the hit boxes move fluidly when I have to have them always in a certain position? (Thats just one of my problems with this) And I don't know how to float them or move them properly.
Anyone up to the task of explaining how basic hit/defense boxes are done? Even a basic way of doing it is good, I just need to know some way of making it happen.
Here is a illustrative example of how I assume it should be done(please help me)
Hm...I'm not sure if this helps, but I did something like this for a game.
I had a character with a pick-axe, and when he struck the ground it cracked open. What I did was, I made a "pick-axe object", and used this:
+Upon pressing "Shift"
-Set position of "pick-axe object" to [location of the pickaxe point in relation to main character].
-Set position of "pick-axe object" to 0,0
...so that, when Shift was pressed, the pick-axe point appeared (and if anything was under it, stuff would happen), and then disappeared back to a place off-map. It worked just fine.
SOOOOO...here's an idea (and maybe there's a better way to do it): Instead of trying to "move" your hit boxes, set them to their intended position on the animated character individually as it moves. For example:
+Troll animation is "Standing"
-Set position of "fist" to [wherever the fist is]
+Troll animation is "Punching"
+"Punching" in frame 1
-Set position fo "fist" to [wherever the fist is in Punching frame 1]
+Troll animation is "Punching"
+"Punching" in frame 2
[etc.]
You can do it for every frame, or just your key frames, and I THINK it should work. And if your "fist" overlaps with their "body", then you do the damage animations and set the damage, or whatever. I think this is how Mugen does it too.
Defense works the same way.
+Troll is "Defending"
-Set position of "Blocking fist" to [wherever the arms or whatever is]
Mind you, I haven't tested this (except as mentioned above), so I can't give you details about speed or whatever. Maybe you or someone else can use this as a jumping off point, though.
I've actually thought of something like this before, but never really followed through on it. In the animation editor set the action point on the fists/feet or wherever you want your attack to land, then make a condition
Always > Set position of hitbox to (0,0) of player
and make it relative to the action point. That way it will always be on the fists or feet when it needs to be. Then when your character plays an attacking animation and the hitbox is overlapping an enemies hit detection zone or w/e you're doing it as, it will do the damage and whatnot. Hope this helps!
"Actually sir, we found a tiny unicorn in your exhaust. It was jumping around poking holes in your gas tank." "Oh thank you I did not know that. A tiny unicorn? Wow."
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
2nd October, 2007 at 23:59:44 -
Wicked Studio's method is the best way to do it, in my opinion. Do what he says and your game should work fine.
It was so that you could make a separate overlay for each frame of the areas that could deal and take damage for each player and enemy. It sort of worked, but there were some complications when the player would have his attack zone overlapping an enemy's attack zone at the same time their damage zones overlapped (both would end up taking damage).
Thus, I don't know if it'd be much help to you (as I never worked out that issue), and it may be a bit too meticulous for your needs, but if you can understand the theory behind it, perhaps you can do something with it.
http://www.geocities.com/f4fth/collision-map-example.zip
(Just make sure you understand the collision box tutorial first).