Bomb question

betterbold

Active member
Hello, everyone. I enjoy modding everyday. ;D
I come up with the bomb attack like this.

Bombs fall in several places at once !!
Is it possible?
 
You need to use script for that. I don't know if you are already using animaiton script or not but if you do, here's the function you can add there:

Code:
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); 
}

With this you can toss multiple bombs like this:

        @cmd    tosser "Grenade" 0 50 0 0.8 3 -0.2
        @cmd    tosser "Grenade" 0 50 0 1 3 0
        @cmd    tosser "Grenade" 0 50 0 0.8 3 0.2
frame data/chars/lesus/toss02.gif

Play with the last 3 parameters to achieve what you desired :)
 
Back
Top Bottom