Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Multi-project Announcement and Help
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default Multi-project Announcement and Help - 12-10-2008, 04:18 PM

Chris101b Inc. (lol) is now going to be a multi-project studio. So not only am I making War Zone 2, but I am also making Infiltration 2. In light of this announcement, I needed help with something. I want to have 2 firing modes in the game. The normal firing mode (Either burst or automatic, have not decided) and then a sniper mode. When you press a certain key, the gun raises up to your eyes and you go into sniper mode. My question is how do you do the multiple firing modes. Right now, the mode is activated when I press the Q key. I want to make it so that when you press the space bar, it fires the normal shot, but when you hold down the Q key, the gun fires a single (more powerful shot). How do you do this. If at all possible, can someone make an example and post it. It would be greatly appreciated.
   
Reply With Quote
Old
EmosaurusRex
Guest
 
Status:
Posts: n/a
Default 12-11-2008, 08:34 AM

Not sure if you were looking for something with a scope or not, but here's a Q&D example about how I would do it. The program itself doesn't actually do anything but the code should show you what I mean.
Attached Files
File Type: a2w snipertoggle.a2w (170.8 KB, 45 views)
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 12-11-2008, 09:28 AM

Well, I have all the animations done right now. When I hold the Q key, the gun comes up to eye level and then zooms in. The problem is the different shooting mode. I want to make it so that when the Q button is held, instead of a burst fire, it shoots one shot. Also, I want a different firing sound. How would I do this.
   
Reply With Quote
Old
Ch0pStickS
Guest
 
Status:
Posts: n/a
Default 12-11-2008, 07:06 PM

create a world variable called ZoomedIn for example. Then have it become false at first. When you hold down Q, it should change it to true, then when you let go of it, you can change it to false. So now, have it say

If ZoomedIn = False
Then
world.NormalFire (a method you should make)
Else
world.SniperFire(the single shot with more powerful one)

tell me if you need more help, i can fix most gaming problems.
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 12-11-2008, 07:23 PM

Unfortunately, though I have been using Alice for years, I have absolutely no idea how to work with variables. I see the button that says create variables and create parameter, but when I click on create new variable, I get so confused. First off, what do I select, Number, Object, Boolean, etc. And then what do I do from there?
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 12-11-2008, 07:59 PM

Quote:
Originally Posted by Chris101b View Post
Unfortunately, though I have been using Alice for years, I have absolutely no idea how to work with variables.
Interesting, since you are among the top Alice programmers (if not the best) when it comes to creativity, yet you seem to have a problem with one of the more basic (but not simple) topics. Obviously, an in depth understanding of some of the more difficult topics is not necessary to be effective (fortunately for both of us ). For a start, see http://www.alice.org/community/showt...ight=variables .

Dick Baldwin also posted a discussion of the different types of variables - and type options - in different languages, but I couldn't find it with a quick search. His tutorials are also good on this, although fairly wordy because of the level of detailed covered. Maybe he will comment further - I'm really not a CS gru.
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 12-11-2008, 08:15 PM

Oh wait, I figured it out kind of. I had to use my famous improvisation to get it to work, but I got it working. Thanks for your help. Couldn't have done without your help.
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 12-11-2008, 08:21 PM

Quote:
Originally Posted by DrJim View Post
Interesting, since you are among the top Alice programmers (if not the best) when it comes to creativity, yet you seem to have a problem with one of the more basic (but not simple) topics. Obviously, an in depth understanding of some of the more difficult topics is not necessary to be effective (fortunately for both of us ). For a start, see http://www.alice.org/community/showt...ight=variables .

Dick Baldwin also posted a discussion of the different types of variables - and type options - in different languages, but I couldn't find it with a quick search. His tutorials are also good on this, although fairly wordy because of the level of detailed covered. Maybe he will comment further - I'm really not a CS gru.
Hahaha, I just got it and read your message. Yeah, it is hard to think that I wouldn't know how to variables, but I don't know how to because I have never had to use them. I read up on Dick Baldwin's tutorial and it helped some. All I did was I made a sphere and put it under the level. Then I told the program that if the bounding box is showing, that the sniper shoots one shot. If not, it shoots a burst. Then I said that when the "F" key is pressed, the bounding box is showing and when you release the key, It goes away. I will have to update the engine beta that I posted with the new firing mode. Also, I'll change the sounds before I post it too because I have a chicken as the burst fire and a thud as the sniper. Lol. Thanks for all your help guys.
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.