Please help with my shooting animation glitch

Hi, I have started making an fps, just because it looked like something that would help me learn a lot, and there would (should) be a satisfying outcome. So far, I have basics like moving around and aiming, but there are two bugs that I have had difficulty fixing.

The bug that seems easiest to fix is the cross hair not showing up completely, and it seems as though it might just be a bug with blender.

The more difficult to fix bug is with the shooting animations. I am very happy with the way the gun shoots (even though nothing comes out…yet) and the way it zooms in and shoots, but after I have shot while zoomed in, the normal shooting animation jumps around to different frames.

I would like to upload the .blend file but as I am new to blenderartists.org, I have not figured out how to do so. Could someone please tell me how to add an attachment so they can test it?

Thanks

There is no way to upload the blend directly to the forums. You need to upload it to an external host. I think box.net is a good one? I can’t remember, I don’t use them.

As far as your crosshair goes, how does it work? Is it parented to the camera or is it on an overlay scene? Does it use the Add or Alpha blending mode?

www.4shared.com is a free easy storage site.

You say when shooting the frames jump around. What does that mean? you have an ipo set for the shooting? and the frames dont play as you want them too?

Have you read the docs regarding the commands for ipo actions? You can learn more reading about the logic blocks here:
http://download.blender.org/documentation/NaN_docs/BlenderGameReference/expression.html

When you get there you need to change to the page for actuators.

For some reason, I am not able to reach the site today. Maybe blender.org is down?

Anyway, hope that helps you.

It sounds like the problem is the ipo for zooming in is conflicting with the ipo for shooting. I think if you move the logic bricks for zooming in to the top, it will make firing the priority. I’m not sure though. And for the cross hair, I’m going to assume it’s parented to the camera, and not an overlay. If so, it’s probably too close. Set the camera’s clipping to 0, and see if that fixes it.

Okay, the .blend file is available at http://www.box.net/shared/c5dytmo1kx.

The cross hair is a tiny mesh right in front of the camera, with no specular, and full emit.I have a feeling that its problem is due to its size.

I made a left click sensor that activates the first few frames of the gun’s ipo animation. I also made a right click sensor that plays the next part of its animation, which is to look through the sights. Then I joined both sensors to an AND connector, which I then joined up with the last part of the animation, a shot through the scope.

Thanks for the replies by the way :).

I see the challenge with the ipos holding in after you zoom and then shoot. Definately a logic problem. Will try to look at it tom.

I dont have any problem with seeing the crosshairs at all. they change from yellow to green when you change directions.

With the GE when you set up the camara view before pressing play, you must move the view to the inner square of the camera for the most correct view and the least distortion.

I did that before playing, so perhaps thats all you need to do to see the crosshairs as I did.

Zooming in while in camera view did fix the cross hair… a bit. It still isn’t perfect, but I think it is because it isn’t perfectly horizontal or vertical.

The cross hair colour is a bit strange. It looks like there is a colour ramp on it, but there isn’t :eyebrowlift2:. I thought that getting rid of the specular and making it full emit would fix it, and it has to a certain degree, but not completely.

Again, thanks for the reply/help/interest :).

The crosshairs change color due to the lighting. I think. Just like the gun.

I played with the logic for a while tonight with no luck. Im new to this stuff too. You can see in the picture what I tried to do.

I added a true/false property and set up ands. However, I think my ands are incorrect?

I also moved the zoom to the top as suggested. I think that when you hold the right button down, then press the left button to shoot the right button also receives another pulse and actually plays its ipo again, then the zoom shoot plays.

And thats why you see the double there. I think this set-up works better than yours, but its still not correct. I dont know how to get that right mouse button to play just once, even after you click the left button.

It makes sense that it would pulse both of them, since both are being held when you fire the left button. Soooooo,

This may need to be done in py. Its easy enough to set up a new zoom shoot ipo and a different plain shoot ipo, that is totally different from what it is now.

Then try my logic and see what happens. If I have time tom I will try it out, im very curious about this. Smile.

Attachments


I don’t quite understand… I’m guessing “sensor” is just another right-click… maybe to differentiate itself from the other right-click sensor? But but I have no clue to what “sensor3” could be :eyebrowlift2:. It looks like it would sense the end of right-click, only that is impossible to do… I think.

Could you please explain?

I think we need to figure out whether the ipo animations are the problem, or the click pulses.

[Update]
Oh, is sensor3 left-click? … it seems to be even more glitchy that way.

Sorry, sensor is another left click to run the zoom shoot.

sensor3 is when the right mouse button is released then it changes prop to false so the last right mouse button is used instead of the one for the zoom shoot above.

I made new ipos for the gun to check my theory and I am wrong. It is playing both ipos for the left button. Its really odd. I dont know how to fix that, except with py script. Which should be very easy if you know py.

Adding the prop T/F should have fixed the dble firing of the ipos, but it didnt. Perhaps I am using the and incorrectly?

Perhaps Mmph! will see this and help, he is very good with logic blocks. Smile. You might pm him for help too. In case he doesnt see this thread.

Here is the file with the changes. If you just press p and then press the right mouse button and hold then press the left and release a couple times, it works fine.

But if you release the right button and then press the left and the go back to the right hold, and press the left to shoot, it plays the dble ipos.

I’ve never seen the “inv” button before :slight_smile: I didn’t know you could do that with the sensors.

I have a vague understanding of python, but generally for scripts I just use bits of other people’s code :o.

I don’t see how using python could make it any better than using logic bricks. After all, the logic bricks are sort of the same thing, only with a GUI.

I’ll give Mmph! a yell…

thanks for your .blend file.

Sorry I really dont know.

I have never used the Blender game engine for a 3d shooter, or anything really first person.
For all my first person needs I use Crystalspace…

I just use blender for Scroller games, and 3rd person games.

For guns and projectiles I just parent an empty to my player, and make sure it is far away from the players physics bounds.

Using py is much different than using the blocks, trust me on that. You control everything and can stop the dble ipo.

Just think about it a bit.

So, I put in some if statements to run the ipos, one if the prop is true and one if it is false. But it still runs that first ipo???

Im going crazy. Here is the file, please, Someone help with this? I will have to start another thread and then it will get closed because it is a duplicate, LOLOLOLOL wink wink.

I’m beginning to think that this is really just a blender bug, with no workaround (yet).

It looks as though the animation is played THEN blender realizes that there was an AND controller that stops it. Even though that would be a tad dumb :eyebrowlift2:.

I will make a simple quick test this arvo to check if it is actually a bug.

If it is, how would we be able to report it and have someone actually act on it? My guess is that the request wouldn’t even be touched.

[edit]

The simple test is here. I think just for the game, I will have to actually use py to set rotations and locations for several frames when the mouse clicks. I really do not look forward to doing that

What would I title the bug report in http://projects.blender.org/tracker ??

[edit 2]

Okay, I officially have proved that it is a bug. Make two sensors, connect them both to an AND connector, then add an IPO flipper actuator. It stuffs up. Therefore, it is the flipper that is the problem, so maybe if we make it so the zooming out isn’t just Blender doing a flipper, and it is actually just playing another part of the IPO… let me go try it out :smiley:

Nope I tried that too, I think the first night.

Readthisthread, maybe try something like that?

I think its a BUG. The pointers to the ipos get lost in translation. If you hold the RMB and click the LMB before you do anything it works correctly.

Ive seen this before somewhere…here in the forum. And I think there is a fix for it, but I cannot remember it. Shoot. I think you have to take out one of the ipo curves?

Maybe it will come to me, Im sorry, I havent helped at all.

haha, way to bust my bubble

OK, I have talked to about 3 people, and thanks for you help.

This is bug.

So the work around would be this:

Duplicate the gun and the ipo at the same time.

Set the logic so that when RMB is hit, you end the regular shooter, and add the new one with an empty.

Then do the oposite when the inv is activated. Delete the zoom shooter and add the regular shooter.

I did a fast test and it worked ok. Good luck.

This should be reported if it hasnt been yet. Also add BUG to the title of your first post, just go to advanced to change the title, thanks