ZeroDictator Posted June 6, 2015 Share Posted June 6, 2015 Hi, I would like to ask if it is possible to make a tank shoot multiple directions at the same time? Like for example I would like to make a tank that shoots backward and forward but this isn't possible "in the normal way" because the tank will shoot all bullets at the direction of the crosshair. How I am able to change it so it will shoot backward and forward or in any other direction? Quote Link to comment Share on other sites More sharing options...
RoundShades Posted June 6, 2015 Share Posted June 6, 2015 Hi, I would like to ask if it is possible to make a tank shoot multiple directions at the same time? Like for example I would like to make a tank that shoots backward and forward but this isn't possible "in the normal way" because the tank will shoot all bullets at the direction of the crosshair. How I am able to change it so it will shoot backward and forward or in any other direction? Recently, I did some coding with the stealth tank. It has a formula for spread. It makes it fire to the left and right, and then home inward to the center. A similar formula, can make the "right" not fire from the center at all, and the "left" fire at a 180 degree spread, and then just remove the homing. You can likely remove RandZ and everything including +Z... in the formula's end. var int j; simulated function rotator AddSpread(rotator BaseAim) { local vector X, Y, Z; local float CurrentSpread, RandY, RandZ; CurrentSpread = Spread[CurrentFireMode]; if (CurrentSpread == 0) { return BaseAim; } else { GetAxes(BaseAim, X, Y, Z); if(j++ == 0) RandY = -0.4; <---- change this. changes arc to the left, 0 is dead center else RandY = 0.4; <---- change this. changes arc to the right, uncertain what number "180 degrees" is if(j > 1) j = 0; RandZ = 0.1; <---- change this. changes initial up/down rotation of the rockets, don't include this at all return rotator(X + RandY * CurrentSpread * Y + RandZ * CurrentSpread * Z); <---- Don't include [+ RandZ * CurrentSpread * Z] } } Quote Link to comment Share on other sites More sharing options...
ZeroDictator Posted June 6, 2015 Author Share Posted June 6, 2015 Thanks for the answer! I managed to get my tank shoot different directions at the same time! Thanks for the help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.