Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How to I prevent backup of methods (FPS)
Old
Stolec
Junior Member
 
Status: Offline
Posts: 3
Join Date: Sep 2011
Location: Omaha, NE
Default How to I prevent backup of methods (FPS) - 09-13-2011, 09:05 AM

I have been trying to create a way to prevent methods from backing up and continuing after they have been activated if buttons are just being mashed. I am trying to make a basic FPS and this has been a real issue along with making a rifle on full auto stop firing when the mouse is no longer being clicked so if you can help me it would be very appreciated.

Thank You
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 09-13-2011, 10:52 AM

I'm guessing you have a loop in your method that starts when the mouse is pressed. If that loop is never told to stop, it'll keep going, making your gun keep firing. Try using a while loop instead, then having a variable change to true when the mouse is pressed, then false when it is released. Then all you have to do is put that variable in the while loop.
   
Reply With Quote
Old
Stolec
Junior Member
 
Status: Offline
Posts: 3
Join Date: Sep 2011
Location: Omaha, NE
Default 09-14-2011, 08:38 PM

I don't at the moment have a method created for a full auto fire but I'm just having trouble with the semi-auto backing up.
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 09-14-2011, 11:20 PM

First, make a boolean variable, then put an if/else statement in the beginning of the method. Drag the boolean to the part of the statement that says "If". Then, put under "Else" the boolean variable to change to true, then the shot, or whatever you want it to do. Put the variable to change to false after the shot.
If this doesn't work, post the world and I'll mess around with it myself.
   
Reply With Quote
Old
Stolec
Junior Member
 
Status: Offline
Posts: 3
Join Date: Sep 2011
Location: Omaha, NE
Red face 09-15-2011, 09:50 AM

Quote:
Originally Posted by GameKid View Post
First, make a boolean variable, then put an if/else statement in the beginning of the method. Drag the boolean to the part of the statement that says "If". Then, put under "Else" the boolean variable to change to true, then the shot, or whatever you want it to do. Put the variable to change to false after the shot.
If this doesn't work, post the world and I'll mess around with it myself.
Yeah I have no idea what you are talking about so I'll just post the file and see how you did it thanks.
Attached Files
File Type: a2w AR15.a2w (577.6 KB, 5 views)
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Unhappy 09-15-2011, 12:48 PM

Don't be suprised. People rarely understand what I speak of.
Well, I tried my boolean idea, but it didn't work. Sorry.
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 09-15-2011, 02:16 PM

Quote:
Originally Posted by donaldsmith View Post
Almost as important as any other issue is how to configure your Windows installation. Many of the problems and performance issues, especially the stuttering, accidents and sudden drops, can be loaded directly to the optimal settings of Windows and out of date drivers or misconfigured.
...why can't you just advertise an unrelated product like everyone else?


Thank you for taking the time to read this signature. This signature loves you.
   
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.