PDA

View Full Version : Sniper Kill Animation


Dameria
04-05-2011, 05:53 PM
This is also a program that I was working on last year but never posted because I never got to finish the animations for each individual shot. Right now, you press the spacebar to zoom in and you can only perform a headshot because I have only coded for the headshot animation. Once the person dies, you have to shoot his body again to make him stand back up and shoot him again. I got the recoil to work well on this and I also already set up for the animations of every other body part.

If you want to work on this and finish it for me, you can make your own custom animations for the different body shots. For example, just go to the guerrilla object in the list and choose the method "bulletCheck" and you can see the animation I did for the headshot, and make your own for other shots like the left arm, right arm, etc. I have already calculated the correct dimensions of each shot so it should be on target for each one, all you need to do is add the death animation.

I made this program primarily to show how to zoom in for a sniper rifle if anyone wanted to adapt it for any first person shooting games that they might have been working on. If that is the case, then look at the world method called "zoom" and you can see how I made the camera zoom in with all the animations of the rifle. The "xZoom" world variable is the magnification number that you want the rifle to zoom in. You can set it to any number, but right now it is set at 10x zoom. If you change the variable to 5, it will be 5x zoom, if you change it to 40, it will be 40x zoom (thats looking really far!).

nickster654
04-05-2011, 06:58 PM
This is also a program that I was working on last year but never posted because I never got to finish the animations for each individual shot. Right now, you press the spacebar to zoom in and you can only perform a headshot because I have only coded for the headshot animation. Once the person dies, you have to shoot his body again to make him stand back up and shoot him again. I got the recoil to work well on this and I also already set up for the animations of every other body part.

If you want to work on this and finish it for me, you can make your own custom animations for the different body shots. For example, just go to the guerrilla object in the list and choose the method "bulletCheck" and you can see the animation I did for the headshot, and make your own for other shots like the left arm, right arm, etc. I have already calculated the correct dimensions of each shot so it should be on target for each one, all you need to do is add the death animation.

I made this program primarily to show how to zoom in for a sniper rifle if anyone wanted to adapt it for any first person shooting games that they might have been working on. If that is the case, then look at the world method called "zoom" and you can see how I made the camera zoom in with all the animations of the rifle. The "xZoom" world variable is the magnification number that you want the rifle to zoom in. You can set it to any number, but right now it is set at 10x zoom. If you change the variable to 5, it will be 5x zoom, if you change it to 40, it will be 40x zoom (thats looking really far!).

thats pretty freakin beast, i just wish someone could exaplin to me how the aim code works, i dont get it at all :(

ps: the sound after you shoot makes it crash for me

Dameria
04-05-2011, 07:06 PM
thats pretty freakin beast, i just wish someone could exaplin to me how the aim code works, i dont get it at all :(

ps: the sound after you shoot makes it crash for me

I guess that you could delete the sound code if it makes it crash for you. I hope it doesn't make it crash for everyone or I'll have to take it out and repost it.

nickster654
04-05-2011, 07:14 PM
I guess that you could delete the sound code if it makes it crash for you. I hope it doesn't make it crash for everyone or I'll have to take it out and repost it.

kk, btw how did it take you to learn how to make it aim?

Dameria
04-05-2011, 07:18 PM
What do you mean "how to make it aim"? Do you mean how to make it detect each individual subpart instead of the whole person? Or how to zoom in with the crosshair?

nickster654
04-05-2011, 07:19 PM
What do you mean "how to make it aim"? Do you mean how to make it detect each individual subpart instead of the whole person? Or how to zoom in with the crosshair?

i mean for the camera to follow the mouse

Dameria
04-05-2011, 07:29 PM
i mean for the camera to follow the mouse

Thats actually an easier method to duplicate, just look at the first method that pops up when you open the program, its a world method called "mouseAim", just skip everything that has to do with "startingCircle" but do all the other stuff as it is written there and you should be able to do it. I had this method initialize when you click the red circle in the middle of the screen.

nickster654
04-05-2011, 07:29 PM
Thats actually an easier method to duplicate, just look at the first method that pops up when you open the program, its a world method called "mouseAim", just skip everything that has to do with "startingCircle" but do all the other stuff as it is written there and you should be able to do it. I had this method initialize when you click the red circle in the middle of the screen.

yea i know how to duplicate it, i just dont get how it works :/

arty-fishL
04-06-2011, 02:27 AM
That's very good and realistic, although shoot to restart wasn't working. http://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gif

Dameria
04-06-2011, 06:17 AM
That's very good and realistic, although shoot to restart wasn't working.

Yeah for some reason even though I coded it so that shooting the box would restart the body, it didn't work at all, no matter what I could do! But for some strange reason, shooting the dead body will bring it back to life, haha. Kind of ironic. Try shooting the body and tell me if it brings him back for you.

nickster654
04-06-2011, 08:33 AM
That's very good and realistic, although shoot to restart wasn't working. http://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gifhttp://www.alice.org/community/images/icons/icon14.gif

it works for me, all you gotta do is shoot the penis.... :)

reuben2011
04-06-2011, 11:56 AM
I'll be sure to play. And to make sure I don't forget, I created a bookmark folder called "Unplayed Alice Games" so I remember which ones I haven't played yet. Anyways, the whole zoom thing sounds pretty beast, so kudos to you! :D

arty-fishL
04-06-2011, 03:44 PM
it works for me, all you gotta do is shoot the penis.... :)Yeh, that worked for me. Another issue - you can only shoot if its going to hit him.

Fritz
04-07-2011, 03:48 PM
Interesting but there are a few flaws I can see. Also, your method for moving the mouse is rather inefficient and doesn't work correctly when the window isn't the original size.

Dameria
04-07-2011, 04:25 PM
Interesting but there are a few flaws I can see. Also, your method for moving the mouse is rather inefficient and doesn't work correctly when the window isn't the original size.

fix it if you want, this is an abandoned project that i did a long time ago.

jediaction
04-07-2011, 07:27 PM
Um. This is really similar to mine. You have seen mine right?

Dameria
04-07-2011, 09:11 PM
Um. This is really similar to mine. You have seen mine right?

Yours was an animation that you could not control, mine is a lot different actually because it has a lot more actual user control in it. All yours shows is an animation, mine shows how to zoom, how to hit subparts of objects, and a couple other things. Yours is meant more for a movie, mine is meant more for a sniper game.

jediaction
04-08-2011, 08:39 AM
Mine zooms....

Dameria
04-08-2011, 04:39 PM
Oh yeah I see it now, I was thinking of something else. Mine is a bit different from yours though. Your sniper rifle is pointed upwards a bit (you should probably aim forwards, not up), and when you zoom it zooms to the left, not straight ahead.

It just be different versions of Alice, idk, but yours seems off to me. Plus, mine shows subpart collision and less buggy overall. Tell me if I'm wrong, maybe its just on my computer that yours is different.

jediaction
04-08-2011, 05:06 PM
Well, its a little off but the concept was the idea. You got it down thought so cool.

nickster654
04-09-2011, 01:28 PM
hey i tyed to duplicate your aim method and it didnt work at all, why not?

jediaction
04-09-2011, 02:13 PM
Why would you need to duplicate it when I already made an aim method

Dameria
04-09-2011, 02:37 PM
hey i tyed to duplicate your aim method and it didnt work at all, why not?

O.O that was weird.

I tried to fix the program, and Alice like bugged out on me and made no sense. I replicated the method exactly as it was in my program and played it, but it didn't work, so then I played around with a few things and it just started getting weirder and weirder. There must be something wrong with your program, maybe even your version of Alice, the way it writes code based on you dropping the text. Maybe you should delete your Alice and re-download it, because you might run into the problem while coding again if it is the case.

Also, in my method of mouse-camera movement, you need to have a "body" (i use a square), and set it point of view to the camera, and then make the camera vehicle to the body. This way the body will turn side to side while the camera can look up and down. If you have the camera doing everything, I've found that you can look up, and then turning to the side will make you look sideways and the camera angle will be screwed up. This is the best way that I've found to fix this problem, and you did not put that in (because I didn't tell you about it, I'm sorry). Thats why my code has "(body) turn right" and stuff like that. All horizontal movements are done with the body and all vertical movements with the camera.

nickster654
04-09-2011, 02:37 PM
Why would you need to duplicate it when I already made an aim method

cause i didnt know you did, where is it?

jediaction
04-09-2011, 03:02 PM
I have had it up for probably a year now. Its in 2 locations...

Mouse_Movement (http://www.alice.org/community/showthread.php?t=6214&highlight=tutorials)

This is my tutorial and projects help page. Its the best one. You can download it from there. Just look at the titles