xero
01-21-2011, 03:44 AM
Hey there, Xero here with a simple tutorial on how to make a cooldown timer which can be used for cannons or turrets. This technique is especially useful for turrets or weapons that you don't want to be able to shoot forever. This logic will cause the weapon to overheat if shot constantly for a specified amount of time.
http://i102.photobucket.com/albums/m88/justin11213/APhoto_1-1.jpg
The AND gate(A)'s other input (off screen) should be the button that you want to use to shoot with. If your object shoots/emits with R1, wire R1 to the top input.
The first timer(B), should have its input set to direction. Tweak this to set how long the weapon will shoot for before overheating (you can replace this with a counter if you want a certain number of shots instead).
The second timer(C) is your cooldown, i.e. how long the weapon will be disabled after overheating. It's input should be set to Start Count Down.
The emitter is there to shoot the projectile, but you can put that anywhere you want. The sound object is there to make a sound to indicate when the cooldown has finished.
http://i102.photobucket.com/albums/m88/justin11213/APhoto2.jpg
It should now work! Have fun blasting away your friends.
Note: Optionally, you can also place the timers on the object instead of a chip, and set them to visible. This will show players how close they are to overheating, and how long they have to wait to shoot again.
Stay tuned for more tutorials in the future! :p
Send me a PM if you have any questions!
http://i102.photobucket.com/albums/m88/justin11213/APhoto_1-1.jpg
The AND gate(A)'s other input (off screen) should be the button that you want to use to shoot with. If your object shoots/emits with R1, wire R1 to the top input.
The first timer(B), should have its input set to direction. Tweak this to set how long the weapon will shoot for before overheating (you can replace this with a counter if you want a certain number of shots instead).
The second timer(C) is your cooldown, i.e. how long the weapon will be disabled after overheating. It's input should be set to Start Count Down.
The emitter is there to shoot the projectile, but you can put that anywhere you want. The sound object is there to make a sound to indicate when the cooldown has finished.
http://i102.photobucket.com/albums/m88/justin11213/APhoto2.jpg
It should now work! Have fun blasting away your friends.
Note: Optionally, you can also place the timers on the object instead of a chip, and set them to visible. This will show players how close they are to overheating, and how long they have to wait to shoot again.
Stay tuned for more tutorials in the future! :p
Send me a PM if you have any questions!