shooting in all directions !

jonsilva

New member
shoot.jpg




hello
anyone knows of a script
that can shoot with Z movement and Z velocity
like the tosser does when it trows the bomb
void tosser(void Bomb, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Tossing bomb with desired speed
  void self = getlocalvar("self");
  int Direction = getentityproperty(self, "direction");
  int x = getentityproperty(self, "x");
  int y = getentityproperty(self, "a");
  int z = getentityproperty(self, "z");
  void Shot;

  if (Direction == 0){ //Is entity facing left?                 
      dx = -dx; //Reverse X direction to match facing
  }

  Shot = projectile(Bomb, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
  tossentity(Shot, Vy, Vx, Vz);
  changeentityproperty(Shot, "speed", Vx);
}


i was trying the shoots from contra and gijoe
but i cant seem to get it working...
 
I'd also like to ask for help on this again...

Bloodbane had explained it to me at lavalit, I've got it working,
but I can't seem to get the trajectory right so i can properly shoot enemies with it.

----
I think the command you want is 'shooter' I think contra has it. One of Bloodbane's scripts. 

Code:
void shooter(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting projectile with speed control
   void vShot = shoot(Shot, dx, dy, dz);

   changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
   changeentityproperty(vShot, "speed", Vx);
}

example
Code:
@cmd	shooter "Bullet" 40 1 -90 30 0 -30

 
thank beastie
i managed to find the shooter comand in contra but the (dz and vz)
were missing...

ive tried the script you posted
but i cant change the shot directions
it always goes the same direction...
 
Yeah I need help with this too, I can get them shooting but can't get the angle right, it rarely hits anything.  Sorry I can't help further, let's see what Bloodbane says.

Is your mod platform based like contra? I recall Bloodbane saying there was two script commands, one for 2d shooting (platform) one for 3d.  The other function I have is 'shoot'

Code:
void shoot(void Shot, float dx, float dy, float dz)
{ // Shooting projectile
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "a");
   int z = getentityproperty(self, "z");

   if (Direction == 0){ //Is entity facing left?                  
      dx = -dx; //Reverse X direction to match facing
   }

   projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);
}
 
iam using a 3d stage

the shoot animation is a little more complicated
the image starts small and ends big,
kind like those rockets from doom the enemy shoots at the player
ive used drwamethod to give it a 3d effect
 
Guys, shooter function in Contra is different than shooter function in beat'm up mods. That's because in Contra I completely not using knives anymore and instead I use type none bullets.

The function for shooting in various direction is this:

Code:
void shoot(void Shot, float dx, float dy, float dz)
{ // Shooting projectile
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "a");
   int z = getentityproperty(self, "z");
   void vShot;

   if (Direction == 0){ //Is entity facing left?                  
      dx = -dx; //Reverse X direction to match facing
   }

   vShot = projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);
   return vShot;
}

void shooter(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting projectile with speed control
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   void vShot;

   if (Direction == 0){ //Is entity facing left?                  
      Vx = -Vx; //Reverse Vx direction to match facing
   }

   vShot = shoot(Shot, dx, dy, dz);
   changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
   changeentityproperty(vShot, "speed", Vx);
}

If you want to shoot in 5 directions, declare this 5 times with different Vz setting.

I can get them shooting but can't get the angle right, it rarely hits anything.

I think it's because the projectile is too small or enemy bbox is not big enough to get hit :).
 
Back
Top Bottom