I didn't see this post. Lol.
How to do Selective Fire:
There's many ways to do many things, but I find that many Alice Users instinctively fire only one shot per click (That's fine.) The way I would do it is the same.
We're going to do a crap ton of assuming in making selective fire. Let's assume you know enough Alice that you'd be able to reverse engineer someone else's code if you took the time. Let's assume that I have built a working shooting method that fires only one round (Single fire). Let's assume that ammunition has been implemented and will stop your gun from firing if the magazine has run out of rounds. Let's assume that I have a number variable "Fire Mode" ranging from 0 to 4. 0 is Safety, 1 is Single Fire, 2 is 2-Burst Fire(Almost no one uses this), 3 is Three-Burst Fire, and 4 is Fully Automatic.
Now any competent gun maker chooses Safety, and two other modes. Sometimes Single and Auto, Single and Semi 3-Burst (for civilians), and 3-Burst and Auto (Common among military guns).
Understand where I'm going with this? That's right, you're going to make the gun loop the firing method as many times as this number variable is. Isn't it amazing how simple that is? But now we need an exclusion don't we—for fully auto. Not hard. Just stick an if/else statement asking if our number variable is 4. If it is, make it fire in an infinite loop. If it isn't, run the standard loop (Based on 0-3).
You stick all of this in an Event that acts during "while the mouse is clicked."
If you do that, then when they continue to hold the mouse while in single or 3-burst, it will not fire, much like in games or real life.
It seems like a simple idea to make the method which switches firing modes. The number variable starts at 0. Let's assume the modes we've chosen are 3-burst and Auto.
Code:
if (numberVariable == 0){
numberVariable = 3;
} else if (numberVariable == 3){
numberVariable = 4;
} else if (numberVariable == 4){
numberVariable = 0;
} else {
numberVariable = 0;
}
That's how you do it in Java. This is why you had to know how to reverse engineer someone else's code. But in case you can't, what it does is set it from 0, to 3, then 4, then back to 0. In any other case, say if numberVariable were to be some outlandish number like 5 or -1, we will set it back to 0 so our selective fire method works.
P. S. - This button is usually bound to F.