Alice Community  

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

Reply
 
Thread Tools Display Modes
FPS help
Old
fire burns
Guest
 
Status:
Posts: n/a
Default FPS help - 10-08-2010, 06:16 PM

I have been looking through the forums for answers for the past couple days and I have found many helpful things, such as making a weapon "automatic" by holding a key, or making an "ammo limit" for a gun. For these I'd like to give kudos to debussybunny563, x2495iiii, and jediaction. Unfortunately my computer studies teacher knows nothing about this program and he's the school's music teacher.

So I would like to ask a few things on behalf of my class:

1. Collision detection. How do I make it?

2. As an example I am going to use a world I recently made. I made a "game" where you have an AK-47 and you can hold space to make it go automatic. Now, with this I have 3 "bullets" (domes) fly out the end of the barrel when you hold space. Now when you have stopped holding space, the "bullets" just stop in mid air. I would like to fix this so the "bullets" continue their method until get back to their starting point. I have the bullets move 500m quickly out of the gun and move back 500m in 0 seconds so they appear to reappear in the gun.

3. "Switching weapons" I would like to assign a number, such as 1,2, or 3 to make the character "switch guns". How would I go about doing this? Also I would like to assign a different sound for each weapon so they do not all sound the same.

Thank you all very much for helping us with this as this is just not a person who needs help with homework, this is coming from a class with a very inexperienced teacher who has not taught computers in 15 years.

I would also like to request that if you do figure something out you please explain what you did in a reply in addition to the modified world with a name such as "awesome fps(1)" or so so we do not mix it up with the original file.
Attached Files
File Type: a2w awesome fps.a2w (2.53 MB, 36 views)
   
Reply With Quote
Old
pucu2
Guest
 
Status:
Posts: n/a
Lightbulb 10-11-2010, 09:20 PM

1.Collision detection is difficult. What exactly do you want it to detect? What you need is "if 'object' is within threshold of 'object2'" and then what you want to happen. It takes a lot of work if you want a character to not go through walls, but it shouldn't be too difficult if you just want it to say whether you shot a character or not.
2. You're going to have to explain better about your gun. Do you want it to be a burst fire weapon, or fully automatic?
I don't really know about the rest. I'm sort've a noob
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 10-11-2010, 09:49 PM

Quote:
Originally Posted by fire burns View Post
1. Collision detection. How do I make it?

2. As an example I am going to use a world I recently made. I made a "game" where you have an AK-47 and you can hold space to make it go automatic. Now, with this I have 3 "bullets" (domes) fly out the end of the barrel when you hold space. Now when you have stopped holding space, the "bullets" just stop in mid air. I would like to fix this so the "bullets" continue their method until get back to their starting point. I have the bullets move 500m quickly out of the gun and move back 500m in 0 seconds so they appear to reappear in the gun.

3. "Switching weapons" I would like to assign a number, such as 1,2, or 3 to make the character "switch guns". How would I go about doing this? Also I would like to assign a different sound for each weapon so they do not all sound the same.
1. Depends on what kind of collision you want (sorry, I can't be too specific). Dameria's probably the expert on this topic, hopefully he'll voice his input on this.

2. Instead of the "move backward 100 meters," I placed a dummy at the domes, and had "move to dummy." This accomplishes the same task, but allows you to do one more thing. In the "end" portion of the "While <space> is Pressed" event, you can put that there again, so that whenever you release the space button, the dome will move back to the dummy as well. This way, no matter where the bullet is in it's path, it will always reset its position when you release the space bar.

3. You would have to create a number variable for the weapons (i.e. 1=AK, 2=M4, 3=Norinco QBZ), and have whether or not a certain weapon's method should execute governed by the current weapon variable. It's easier if you implement the different weapons first (just add the shooting/reloading methods and stuff, not the variables and whatnot), and I can show you through code what you have to do. I'm sorry for not directly answering your question, it's just that I don't know how I should go about doing things since I don't know how you want it.
As for the sound, it also has to do with the weapon's number variable, so once again it'd be better for me if you could just make the weapon's methods so I have something to go off of.


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.

Last edited by debussybunny563; 10-11-2010 at 09:51 PM. Reason: x is funnay
   
Reply With Quote
Old
fire burns
Guest
 
Status:
Posts: n/a
Default 10-14-2010, 09:03 PM

Thank you both for your input. Fortunately, the kid that sits beside me figured out how to do bullet detection. I have been messing around with the game for a few days now and I have made a lot more features than before, such as sprinting, jumping, knifing, and some other details that might take a while to explain.

For collision, I have figured out how to make an object react when a dome comes near it but now I have a couple problems. When I am near a character without doing the shooting method the person just falls over (lol). How would I make it so that the character only reacts when a certain method is in the process? I would like to apply this to shooting and knifing. I only have it set so when the object comes near an object it reacts.

In addition to this, I would like to know how to make collision so you do not walk through walls.

And sorry, I have NO idea what your talking, about, debussybunny563, as I've only been using Alice for a short time.

Hopefully this newer file may help.

EDIT: Oh jeez, I forgot to mention that I (kind of) solved the people reacting more than once by having them wait like 10000000 seconds or something crazy like that.
Attached Files
File Type: a2w awesome fps.a2w (5.14 MB, 14 views)

Last edited by fire burns; 10-14-2010 at 09:06 PM. Reason: Missing info
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 10-14-2010, 09:17 PM

Quote:
Originally Posted by fire burns View Post
Thank you both for your input. Fortunately, the kid that sits beside me figured out how to do bullet detection. I have been messing around with the game for a few days now and I have made a lot more features than before, such as sprinting, jumping, knifing, and some other details that might take a while to explain.

For collision, I have figured out how to make an object react when a dome comes near it but now I have a couple problems. When I am near a character without doing the shooting method the person just falls over (lol). How would I make it so that the character only reacts when a certain method is in the process? I would like to apply this to shooting and knifing. I only have it set so when the object comes near an object it reacts.

In addition to this, I would like to know how to make collision so you do not walk through walls.

And sorry, I have NO idea what your talking, about, debussybunny563, as I've only been using Alice for a short time.

Hopefully this newer file may help.

EDIT: Oh jeez, I forgot to mention that I (kind of) solved the people reacting more than once by having them wait like 10000000 seconds or something crazy like that.
Instead of 10000000 seconds, I'd use infinity. Just type the word "infinity" into the custom number text box, and it'll be infinity.

For making it so that you can't kill if you're not shooting or knifing, have two world-level boolean variables, "knifing" and "shooting." In your knife method, have the boolean set to true at the beginning of the method, and false at the end. Do the same for the shooting variable-set true when you begin to fire, and false when you stop firing.
Now, in your collision/die methods, drag and If/Else statement into the method and put the rest of your code there. In the "if" part, drag a "both <a> and <b>" world-level function in there, and for a and b select knifing==false and shooting==false. Leave the "else" part as "do nothing."
If done correctly, Only when you're knifing or firing will they be able to die.


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
fire burns
Guest
 
Status:
Posts: n/a
Default 10-14-2010, 09:40 PM

Quote:
Originally Posted by debussybunny563 View Post



For making it so that you can't kill if you're not shooting or knifing, have two world-level boolean variables, "knifing" and "shooting." In your knife method, have the boolean set to true at the beginning of the method, and false at the end. Do the same for the shooting variable-set true when you begin to fire, and false when you stop firing.
Now, in your collision/die methods, drag and If/Else statement into the method and put the rest of your code there. In the "if" part, drag a "both <a> and <b>" world-level function in there, and for a and b select knifing==false and shooting==false. Leave the "else" part as "do nothing."
If done correctly, Only when you're knifing or firing will they be able to die.
I'm sorry but I do not understand. Do I leave the boolean variable as false in the method? And do I have to delete a lot of my events I have for the dying animation?

Again I'm sorry if my inadequacy has been a nuisance.

Plus I'm kind of confused about the boolean variable being at the world-level. How would I make the boolean refer to the method I want it to do? Plus how would I get it to let me drag the variable into the [true] == [true] boxes? (the [word] stand for the box because I'm not a forums dude who knows how to make a box)

EDIT: I'm sorry, I didn't realize that you wanted me to put it in the method. Looks like I have to create like 10 new methods of people just dying. lol Sorry, I just had the method of them rolling left in the event instead of making a new method for the method to go in. Method. Method...? METHOD! I don't think I've said it enough

Last edited by fire burns; 10-14-2010 at 09:51 PM. Reason: WAIT. I THINK I SORTA GET IT.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 10-14-2010, 10:06 PM

Here's what I've got.

It's not perfect for the shooting method yet, but it still works well.
Attached Files
File Type: a2w awesome fps (1).a2w (5.16 MB, 12 views)


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
fire burns
Guest
 
Status:
Posts: n/a
Default 10-14-2010, 10:11 PM

Okay, I think that I have done something wrong because it is not working. But it seems that I have done all you said except for the glaring error of you saying make a boolean variable at the world method because I do not understand how to do that.

I have attached the world and I have only done what you have said for zombie1 so far. Please take a look and see what I have done wrong.

EDIT: Gah you posted while I was getting a drink and posting at the same time!
Attached Files
File Type: a2w awesome fps.a2w (5.25 MB, 7 views)
   
Reply With Quote
Old
fire burns
Guest
 
Status:
Posts: n/a
Default 10-14-2010, 10:18 PM

Oh okay! Now I see how you did it! Thanks! Your a saint!

EDIT: Okay, I did a detailed browse through all the events now and I think I may have an idea of what is wrong here but when I shoot the gun no longer has an "Ammo Limit" and I think the variable doesn't decrease anymore because the method is being set to false every time the space bar is lifted up. Please inform me if I'm wrong.

Last edited by fire burns; 10-14-2010 at 10:29 PM.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 10-14-2010, 10:41 PM

I see. Just put the decrement method and the fire method in a "Do Together" as shown below.

I believe the same thing would've happened without the variables too, the fact that the decrement is after the shooting variable is the cause (it waits 'till after the shot to lose the ammo, so you can see where the problem would arise there).
Attached Images
File Type: jpg dotogether02.JPG (23.7 KB, 76 views)


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
Reply

Tags
collision detection, fps

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