f*cking problem that i cant resolve(with sniper and uzzi)

(Klein) #1


i have an game wich has an sniper and an uzzi.
i use an bullet hole script(no bullets).
maybe u know that an sniper dont shoot so many shots like an uzzi.
Now the problem is that i wanna have the sniper to shoot 1 shot at 1 time and the uzzi many shots.OK.I´ve tried that with frequency of pulses, dont work because in the script is only 1 left-mouse sensor included and so i cant have 2 left mouses sensors to shoot different frequencies of pulses(Maybe here i need to know python[i dont know python]).
Then i´ve tried it with 2 scripts( 2 same scripts only with other sensors…) that doesnt work too.Even with replace mesh i´ve tried it but it allways does only 1 frequency of pulses(only from 1 sensor).
I have done all that is in my possibilities that i know, maybe any1 of u can help me

(SeaCigar) #2

Well… I can try to help…

Try using a keyboard button to switch programs exclusively.

First, give a new property to the actor that controls the guns. I would call this property “mode”. Go into the text screen, make a new TX: and name it “mode”, the same as your property. In this text screen, make yourself some notes; 0 = sniper, 1 = uzi. This is just to remind you of what number does what. Next, make a keyboard input logic brick, and connect that to an “and” brick, and finish with a property assign brick. The name of the property is, you guessed it, “mode”. And the value will be 0 ( the number, not the letter). assign whatever button you want to the keybouard actuator, i would pick ‘s’ for sniper. this button will tell your computer to activate the sniper rifle. We’re not done yet, though! now go to the actor that uses the sniper rifle program, and add this set of logic bricks, starting with a property input brick. the property name is mode, and the value is 0, at this point, you must connect this input actuator to your python script in a way that will make the rifle recognise it, and so it will work only if the left mouse button is pushed in conjunction with the newly activated program. Now go to your uzi, and repeat the previous steps, but now, use the keyboard button ‘U’ for uzi, and the numerical value 1 . The property name is still ‘mode’ . connect everything like the previous steps, but this time with the uzi actor. If you’re wondering what all this does, when you play the game, and push ‘S’, it will basically activate the sniper rifle, and deactivate the uzi. If both gun programs are programmed to fire at the left mouse click. the sniper rifle should be the only one firing. to change to the uzi, push ‘U’ . the uzi will be activated, while the rifle is now deactivated. if your firing rates are programmed properly, this should fix your problem.

[P.S] MNME helped me along these lines, im just applying it to a different problem. Just giving credit where it’s due…