Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   FPS Rapid fire Q (http://www.alice.org/community/showthread.php?t=4994)

SirThorfinn 09-12-2010 10:46 AM

FPS Rapid fire Q
 
How do i create a rapid fire effect when i press the left mouse button until i release the mouse button without having loop until its done the animation a set # of times?:confused:

x2495iiii 09-12-2010 11:18 AM

Pretty much the same thing as [URL="http://www.alice.org/community/showthread.php?p=25152#post25152"]here,[/URL] but with the mouse button instead of a key.

SirThorfinn 09-12-2010 11:22 AM

[QUOTE=x2495iiii;25197]Pretty much the same thing as [URL="http://www.alice.org/community/showthread.php?p=25152#post25152"]here,[/URL] but with the mouse button instead of a key.[/QUOTE]

Well thats what i did but once i let go of the mouse it stops mid way through the animation and the gun starts drifting forward if i do that multiple times.:(

debussybunny563 09-12-2010 11:56 AM

[SIZE="2"]I think it's good that you're making an FPS, because it, more than anything else (well, that's debatable), gives you an understanding of practically everything in Alice.

Anyway, to do what you're doing, I'm once again going to need an attachment, so I can more directly show you.

In my FPS as well, I have to do the same thing. Basically, what you want is the gun/person to reset their point of view in the end portion, and even in the end of the firing method (this also helps if you want to experiment around with varying amounts of recoil without having to re-plug EVERYTHING in).

Basically, upload the world and I'll see what I can do.[/SIZE]

SirThorfinn 09-12-2010 12:16 PM

1 Attachment(s)
OK this is what i started but i haven't done much. I'm trying to get the player's view to work good before i start getting really into it.
When i would hold the fire button and let go before the animation play's 50 times (just what i had it set for) it would ether stop mid way and drift off if i did it multiple times or crash the simulation.:(
[ATTACH]3512[/ATTACH]

debussybunny563 09-12-2010 12:20 PM

1 Attachment(s)
[SIZE="2"]Downloading...

Fixing...


The error, I think, is caused by the sound, not the shooting method.

Still working...


Okay, finished it. Ask your questions.


EDIT: Oh, you posted while I was editing. Oh well. :rolleyes:
Yes, you can still have sound. Just take a look at the recursive sound method I added.[/SIZE]

SirThorfinn 09-12-2010 12:34 PM

OK well how would i still be able to have the sound when it shoots with out the glitch and allow it to rapid fire without stopping the animation mid way when you let go?

SirThorfinn 09-12-2010 12:40 PM

OK thanks a lot!:D ill check it out. thanks.

SirThorfinn 09-12-2010 12:46 PM

OK it works great but what ever you did (IDK how you did it) now when i aim down the sight the gun shoots to the side and when i aim off the sight the gun drifts off screen and the fire gets really big sometimes. :confused:. now this may be my amateurish methods but i don't know.:(

debussybunny563 09-12-2010 12:48 PM

[SIZE="2"]Actually, I think it'd be best if I explain a few things.

Instead of v_90 move forward 0.25 meters, I created a dummy and set its point of view to the p90 and its vehicle to the camera, and then p90 set point of view to dummy (which I named p90pivot). Does basically the same thing.

However, what I did to solve the displacement was in the 'end' portion of the while mouse is pressed event, I once again put the set point of view to p90pivot. Setting point of view is useful because instead of something like 'moving,' where it moves in a direction, it moves TO an object, which in this case is always in the same position relative the the camera. So, it'll never fault.

Also notice that in the beginning of the fire method, I have a variable 'firing' set value to true, and at the end set value to false. The set value to false is also in the end portion of the while mouse is pressed event too. This is for the sound method, which might take some effort to explain, and therefore I will refrain from doing so. :D (call me a quitter if you like, x2495iiii :p )


EDIT: AHHHH!!! Once again you post while I'm still posting! LOL no harm meant :)

I'll take a look at your aim method.[/SIZE]


All times are GMT -5. The time now is 06:56 AM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.