Jump to content

Recommended Posts

Posted

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? :confused:

Posted
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? :confused:

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]
  }
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...