Need help with some "how to do" things
I wonder if anyone is good at this program and can give me a tips on how to do a couple of things.
Firsly i am making a game where the enemies goes from the left edge of the screen toward the right (where the player stands), There will be some barriers that the player can place out to stop the enemies, but the enemie will spawn at random locations at the left side of the playfield. How do i make it so the enemies only stop when they are in the right position and that when they are above the object they will walk "behind" it, and when in front "in front" of the object? I will post a picture so you can see what i mean: http://varagtp.files.wordpress.com/2011/02/ex.jpg
Re: Need help with some "how to do" things
Change the order by testing their Y position. If the zombie's Y position is GREATER (that is, if the zombie is lower than the barrier), then in the event editor go to Order>Move in front of object and then select the barrier.
Vice verse, if the zombie's Y position is LOWER than the barrier (that is, if the zombie is above the barrier) then move the zombie behind the barrier.
If you want I can show you an example.
Re: Need help with some "how to do" things
Quote:
Originally Posted by Jeod
Change the order by testing their Y position. If the zombie's Y position is GREATER (that is, if the zombie is lower than the barrier), then in the event editor go to Order>Move in front of object and then select the barrier.
Vice verse, if the zombie's Y position is LOWER than the barrier (that is, if the zombie is above the barrier) then move the zombie behind the barrier.
If you want I can show you an example.
Cool! I just did it now and it worked! Thanks!! :)
By the way is there any way i can do the same thing with objects that are not actives? Like backdrops?
One other thing i wonder, is there any way you can insert an animation "into" another animation? Lets say for example you have a animation of a caracter running. In the middle of the run he gets hit by a bullet and looks hurt for a second, is there any way to have that animation in the middle of a running animation for example without it looking wierd?
Also if your caracter should be able to carry different guns, do you have to have a whole animation sequence for the whole body for every gun or is it possible to just animate the different gunmodel "on" the animation. A bit hard to explain..
Thanks again!
Re: Need help with some "how to do" things
For the animation part where he gets hit, you will want to have a collision detection happen with the bullet and then at that point switch it to a different animation in that active oblect.
For example he will have a running animation, a jumping animation, a getting hit animation, a death animation, etc.
Those would all be called within that active object by collision detection or flags/variables.
Then once the hit animation is done playing, it will move back to the running animation or stopped animation.
Hope that makes sense.
Re: Need help with some "how to do" things
Quote:
Originally Posted by Thrawn
For the animation part where he gets hit, you will want to have a collision detection happen with the bullet and then at that point switch it to a different animation in that active oblect.
For example he will have a running animation, a jumping animation, a getting hit animation, a death animation, etc.
Those would all be called within that active object by collision detection or flags/variables.
Then once the hit animation is done playing, it will move back to the running animation or stopped animation.
Hope that makes sense.
The problem is that all the animation that was playing before is stoped when he starts the "hit" animation? What if he is in the middle of a sprint or a jump? Will it not be that he will "freeze" in the hit animation but i will still controll him at full sprint even though his legs wount be moving in the "hit" animation, that could look a bit wierd?
Re: Need help with some "how to do" things
And this is why a lot of older games flashed things red when they were shot instead of animating them. It's easier :)
Modern games (i.e with 3d/vector graphics) handle it by using masked bone animations so they can apply an animation to only part of a character (you can have the legs strafing, the body being hit, and the arm aiming/shooting all at once). MMF can't do this, unfortunately.
I'm not sure what your best option is for MMF for this.
For the guns, the best bet is to animate the character for each completely different kind of gun (like rifle vs pistol vs rocket launcher) and pin the guns to the character. Similar kinds of gun (e.g. different pistols, or even uzi and pistol) can share the same character animation.