Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-24-2011, 04:03 PM

Quote:
Originally Posted by sargentnbbranco View Post
You know, that gets me annoyed. I mean, that name states who you really are. I mean, your not just a Chief, and your not just a Master. You are so amazing that they had to combine them into one, and henceforth, you are a Master at being a Chief, or a Chief of a Master. You are a Master Chief.
last comment from me on mastercheif:

just like not a moderator but a SUPER moderator


<Insert_Signature_Here>
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-24-2011, 04:05 PM

Quote:
Originally Posted by Mr Kidnapper View Post
So you say madder chief?

At any the rate, I'd like to see what you guys want done in the FPS Tutorial. Now that I've got calibrationless camera movement I'm confident that we can do anything barring Scaleform.
So far I'm doing selective fire modes. Not that hard.
at least you got a lot of views


<Insert_Signature_Here>
   
Reply With Quote
Old
sargentnbbranco
Member
 
sargentnbbranco's Avatar
 
Status: Offline
Posts: 39
Join Date: Dec 2011
Location: Stewartsville, New Jersey
Default 01-10-2012, 12:10 PM

Quote:
Originally Posted by Mr Kidnapper View Post
So you say madder chief?
No, we kind of say mas-DER Chief, but ever once in a while you will hear mastder chief of masterd chief.
I would also like to learn how to program selective fire modes. Would an if else statement work i there?


SOPA Piracy Act has disabled signiture
   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 01-21-2012, 01:24 AM

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.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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