Alice Community  

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

Reply
 
Thread Tools Display Modes
Bullet firing problem?
Old
Apollo427
Guest
 
Status:
Posts: n/a
Default Bullet firing problem? - 12-19-2010, 09:35 PM

So I started this game, can anyone help me and tell my why my world method 'gun shoot' will only shoot one bullet? It's meant to shoot six, can anyone help me?
Attached Files
File Type: a2w zombie apocolypse.a2w (7.28 MB, 19 views)
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 12-20-2010, 03:54 PM

I probably can. How soon do you need help? I can work on it on December 23rd, the first day of my holiday vacation from school. I am to busy to work on it tonight.
   
Reply With Quote
Old
Pentaplox
Guest
 
Status:
Posts: n/a
Default 12-21-2010, 09:50 AM

Have 6 bullet objects, not just one.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 12-21-2010, 10:55 AM

Make it, when you press space, the bullet goes out, then goes back the same distance but duration 0 seconds. Then it should work infinitly


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 12-21-2010, 04:41 PM

Quote:
Originally Posted by jediaction View Post
Make it, when you press space, the bullet goes out, then goes back the same distance but duration 0 seconds. Then it should work infinitly
To add to that, if you wan't to use less objects, use this code.

Code:
<bullet> set opacity to 0% duration = 0 sec
<bullet> move back (set distance here) duration = 0 sec
<bullet> set opacity to 100% duration = 0 sec

I am not sure exactly the code would look exactly like my example when programmed into Alice, but it should give you a general idea. You probably already know this, but in this example, the name of the object is "bullet", so unless that is what you named your bullet, the code will not say <bullet>.

For example, if you named your object "crazy", your code would look like this:

Notice the changes in red text...

Code:
<crazy> set opacity to 0% duration = 0 sec
<crazy> move back (set distance here) duration = 0 sec
<crazy> set opacity to 100% duration = 0 sec

This code basically says that after the bullet fires, and is out of the camera's range, turn invisible, fly back to where it was before, and turn visible again, doing all of this in 0 seconds.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 12-21-2010, 05:57 PM

Quote:
Originally Posted by jediaction View Post
Make it, when you press space, the bullet goes out, then goes back the same distance but duration 0 seconds. Then it should work infinitly
Its a better idea to create a dummy object in the place where the bullet is, so that when the bullet gets fired out of the gun you can just tell it to automatically set point of view to the dummy object. This will eliminate any problems that might occur. Dummy object has to be vehicled to the gun.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 12-21-2010, 06:30 PM

Quote:
Originally Posted by David B View Post
To add to that, if you wan't to use less objects, use this code.

Code:
<bullet> set opacity to 0% duration = 0 sec
<bullet> move back (set distance here) duration = 0 sec
<bullet> set opacity to 100% duration = 0 sec

I am not sure exactly the code would look exactly like my example when programmed into Alice, but it should give you a general idea. You probably already know this, but in this example, the name of the object is "bullet", so unless that is what you named your bullet, the code will not say <bullet>.

For example, if you named your object "crazy", your code would look like this:

Notice the changes in red text...

Code:
<crazy> set opacity to 0% duration = 0 sec
<crazy> move back (set distance here) duration = 0 sec
<crazy> set opacity to 100% duration = 0 sec

This code basically says that after the bullet fires, and is out of the camera's range, turn invisible, fly back to where it was before, and turn visible again, doing all of this in 0 seconds.
Quote:
Originally Posted by Dameria View Post
Its a better idea to create a dummy object in the place where the bullet is, so that when the bullet gets fired out of the gun you can just tell it to automatically set point of view to the dummy object. This will eliminate any problems that might occur. Dummy object has to be vehicled to the gun.
Now that I think of it, it would be easier to create a dummy.

Again, my imaginary object is named "Bullet".

Select the bullet object, and choose to drop a dummy at that object. Give your dummy a name, such as "Bullet Return Dummy". Then, after you fire the bullet, and it is our of the camera's distance, enter this code:
Code:
<bullet> set opacity to 0% duration = 0 sec
<bullet> move to <Bullet Return Dummy> duration = 0 sec
<bullet> set opacity to 100% duration = 0 sec

This code basically says that after the bullet fires, and is out of the camera's range, turn invisible, move back to the dummy named Bullet Return Dummy, and turn visible again, doing all of this in 0 seconds.

Once again, I am not exactly sure what the code would look like when programmed into Alice, but it should give you a general idea.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Thumbs up 12-21-2010, 06:49 PM

Instead of using "move to," if you have the dummy oriented correctly use "set point of view to."

This is so that if you're turning and shooting, the bullet won't come back in an incorrect position.


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 12-21-2010, 07:26 PM

Quote:
Originally Posted by debussybunny563 View Post
Instead of using "move to," if you have the dummy oriented correctly use "set point of view to."

This is so that if you're turning and shooting, the bullet won't come back in an incorrect position.
That makes more sense. I just didn't realize that the world was developed in a way that you could manuever the way the gun was pointing.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 12-21-2010, 07:27 PM

Quote:
Originally Posted by debussybunny563 View Post
Instead of using "move to," if you have the dummy oriented correctly use "set point of view to."

This is so that if you're turning and shooting, the bullet won't come back in an incorrect position.
Sorry, I know that way to but I didnt say that one. Yah, I actually use that way in quite a few of my new FPS games. I think the halo game? Also and RPG


EDIT: I have 2,800 posts!!!!


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.