Rapidly Shooting (noob question :O)

Well I did search for it but I couldn’t find anything. So now I’m asking you guys. How can you make a gun rapidly shoot? (holding space makes it shoot each 0.5 seconds) I think this has to do with properties and if not oh well. Also, don’t tell me to use Social’s FPS Template because I find it complicated (of course) and he even said that it wasn’t meant for beginners. Well it was meant to give them something to start from but he said it isn’t made for beginners to learn from. Or, atleast I think he said that. Also tell me if this is impossible without scripting. I’m pretty sure you can make it with only logic bricks but I really don’t know much.

OK, to do something like this you need a timer called shootTime and a property called canShoot (bool). When connecting the logic bricks that create the bullet, change the AND sensor to an expression and type canShoot == true. Connect this to a property sensor setting shootTime to -0.5 (timers count upwards) and canShoot to false. Now create a new sensor and set it to property. Change the type of property to ‘Interval’ (do this through the drop-down menu given when you set the sensor.) In the min put 0, and the max put 1. Connet the interval to AND sensor and the AND sensor to a property actuator. In this actuator set canShoot to true.

Well the shooting works but what it does is when I press space it shoots one time and when I let go of space it shoots one time. I was confused what to do with the property sensor so I just set the shootTime and the min -0.5 and then max 0.5 (I notice it works with 0 also) So if you can maybe show a picture of how it would look. (sorry for my newbiness…I never think i’ve been so nooby :O) This is how my logic bricks look right now.

http://img85.imageshack.us/img85/5382/logicbricksjd2.png

Thanks for helping and sorry for these stupid questions :stuck_out_tongue:

Edit:I just noticed I did something wrong…I think
Oh I see what you did…you changed it. Sneaky :stuck_out_tongue:

Ok sorry for the double post but I’ve noticed editing my post over and over again won’t get anybodies attention and the question will fail. Now, I still don’t understand. I confused on this part. “Connect this to a property sensor setting shootTime to -0.5 (timers count upwards) and canShoot to false. Now create a new sensor and set it to property. Change the type of property to ‘Interval’ (do this through the drop-down menu given when you set the sensor.) In the min put 0, and the max put 1.” I know how to make property sensors but here are some questions.

1:Do you mean to make 2 property sensors and make them equal and then set those numbers?

2:If so, then what about the 3 property sensor? Do I set it to canShoot or shootTime?

I think showing a picture would be easier. Wow, I never knew it would be this complicated for me :expressionless:

Actually I said that it was made to scare beginners into starting out with something simpler than an FPS - as they should.

Of course, being mostly idiots, very few beginners take the advice.

PS: Nice avatar. I love Portal.

Hmm I see. Also thanks for the comment on my avatar :stuck_out_tongue: I made it on flash, and I love Portal too :smiley: I can’t wait until I get the Orange Box.

Set the keyboard sensor to true pulse mode by pushing it(little button with 3 dots near the top)

Alright so I have made it shoot rapidly but the timer isn’t working. Also I used the logic bricks I used before since you didn’t answer the 2 questions. I just figured out that the timer works as a countdown of how long I need to hold space until it finally shoots bullets veeeeeeeeery fast. Not really what I need :stuck_out_tongue: Anyways, heres how it looks now. It will also show you how the cube shoots.

http://img219.imageshack.us/img219/1526/logicbricks2hh2.png

Edit:Also don’t worry I’m not making an FPS. I’m making something different and I think it’s a lot more simple. (lets hope)

you have to reduce the tic rate duh!, its the value you have to put to the place in the keyboard sensor where it is written (f:0) just to the side of the TRUE pulse mode you’ve triggered. if you put (f:30) it means it will pulse 1 time every 30 frame wich can correspond to 0.5 sec.

Hooray it’s working! Thanks! Now heres another question ( sorry :frowning: ) and it’s related to this. I noticed that the player can just keep pressing space rapidly to shoot bullets faster than the gun is supposed to. (means they can still make a line of bullets connected to each other if they can press space fast enough) So is there a way to make the delay of the gun to keep going even when space isn’t pressed? Because I don’t think pressing the trigger on a real gun faster than it can shoot if you hold down the trigger will make any difference.

Thanks!

Edit:Hmm. Well I sort of figured out what to do. I set the property shootTime to 0.000 and made the bullet go faster. The player then really doesn’t have a chance of cheating since it’s going too fast to beat. But answering my question above would still be nice :stuck_out_tongue:

You could have a property called shoot time, and start a timer when space is not pressed (use a keyboard sensor and press the little inv button.), and attatch a property sensor to detect the property value and the sensor to press space to an and controller and in the actuator shoot the bullet and set it back to 0.