@cmd projectile help

esn23

Active member
Hey I was having a problem with the numbers and what they do.. I wanted him to shoot a rose from the this frame going directly down to the ground diagonaly from his arm like he is throwing it.

Here is a picture
jmppun1_2.png


Here is my code
anim jumpattack
delay 6
offset 99 189
hitflash flash3
bbox 74 80 45 77
frame data/chars/tuxedo/jmppun1-1.png
bbox 76 80 44 73
delay 10
@cmd shooter "airrose" 25 -35 0 2
frame data/chars/tuxedo/jmppun1-2.png
bbox 78 77 43 78
attack 0 0 0 0 0 0 0 0 0 0
delay 10
frame data/chars/tuxedo/jmppun1-1.png

can some one tell me what the number control like how would i get it to shoot the way i need it to.. If it doesnt hit the enemy it should hit the ground.
 
Can you check with the script you got for shooter? It seems you're not specifying it, so you're missing a few parameters from the script you called. I see 4 for shooter instead of 6. We got the projectile name already. Now, first three is for positioning the projectile, while the last three is for direction in which the projectile moves.

Example:

Code:
anim	jumpattack2
	bbox	20 6 22 60
	offset	32 65
	loop	1 10 12
	frame	data/chars/james/asd00.png
	frame	data/chars/james/asd01.png
	frame	data/chars/james/asd02.png
	frame	data/chars/james/asd03.png
	@cmd	shooter "Power2" 15 25 0 2 -4 0
	sound	data/chars/james/beam2.wav
	frame	data/chars/james/asd04.png
	frame	data/chars/james/asd05.png
	frame	data/chars/james/asd06.png
	frame	data/chars/james/asd07.png
	frame	data/chars/james/asd08.png
	frame	data/chars/james/asd09.png
	offset	49 95
	frame	data/chars/james/jump08.png
	frame	data/chars/james/jump09.png
	frame	data/chars/james/jump10.png
	frame	data/chars/james/jump11.png

The example shows that the projectile moves going diagonal forward and downward.
 
I agree with White Dragon, esn. You have to post the function here so we can help you
FYI, I made two versions of shooter function, one for regular beat'm ups while the other is for 2D mods
 
Bloodbane said:
I agree with White Dragon, esn. You have to post the function here so we can help you
FYI, I made two versions of shooter function, one for regular beat'm ups while the other is for 2D mods

It was the one that we used for xmen.. I just copied over the H script and library from xmen, is the function in h script or in library or in the projectile?
 
esn23 said:
Bloodbane said:
I agree with White Dragon, esn. You have to post the function here so we can help you
FYI, I made two versions of shooter function, one for regular beat'm ups while the other is for 2D mods

It was the one that we used for xmen.. I just copied over the H script and library from xmen, is the function in h script or in library or in the projectile?

Here is the txt from the hscript
//Script for player's projectiles

#include "data/scripts/library/spawn.h"
#include "data/scripts/library/target.h"
#include "data/scripts/library/basic.h"

void groundkill()
{// Check altitude. If projectile is on ground, suicide!
    void self = getlocalvar("self");
    int x = getentityproperty(self,"x");
    int z = getentityproperty(self,"z");
    int y = getentityproperty(self,"a");

    int H = checkhole(x,z,y-100);

    if( y <= 1 && H != 1){ // On ground but not on hole?
      killentity(self); //Suicide!
    }
}

void groundchange(void Ani)
{// Check altitude. If projectile is on ground, change animation!
    void self = getlocalvar("self");
    int x = getentityproperty(self,"x");
    int z = getentityproperty(self,"z");
    int y = getentityproperty(self,"a");

    int H = checkhole(x,z,y-100);

    if( y <= 1 && H != 1){ // On ground but not on hole?
      changeentityproperty(self, "animation", openborconstant(Ani));
    }
}

void directorA()
{// Change Animation based on aggression
    void self = getlocalvar("self");
    void Aggro = getentityproperty(self, "aggression");

    if(Aggro == 2 || Aggro == 6){
      performattack(self, openborconstant("ANI_FOLLOW3"));
    } else if(Aggro == -2 || Aggro == -6){
      performattack(self, openborconstant("ANI_FOLLOW4"));
    } else if(Aggro == 4){
      performattack(self, openborconstant("ANI_FOLLOW5"));
    } else if(Aggro == -4){
      performattack(self, openborconstant("ANI_FOLLOW6"));
    } else if(Aggro == 1 || Aggro == 7){
      performattack(self, openborconstant("ANI_FOLLOW7"));
    } else if(Aggro == -1 || Aggro == -7){
      performattack(self, openborconstant("ANI_FOLLOW8"));
    } else if(Aggro == 3 || Aggro == 5){
      performattack(self, openborconstant("ANI_FOLLOW9"));
    } else if(Aggro == -3 || Aggro == -5){
      performattack(self, openborconstant("ANI_FOLLOW10"));
    } else {
      performattack(self, openborconstant("ANI_FOLLOW2"));
    }
}

script use in projectile
@script
    void self = getlocalvar("self");

  if (frame == 0){
      changeentityproperty(self, "velocity", 0, 0, 0);
      changeentityproperty(self, "speed", 0);
  }
 
Oh esn, you could use Search function to find where shooter is typed :)

Anyways, here it is:
Code:
void shooter(void Shot, float dx, float dy, float Vx, float Vy)
{ // Shooting special projectile with speed control
// Shot from entity's offset
   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 = spawn01(Shot, dx, dy, 0);
   changeentityproperty(vShot, "velocity", Vx, 0, Vy);

   if(Vx < 0){                  
     changeentityproperty(vShot, "direction", 0);
   } else {
     changeentityproperty(vShot, "direction", 1);
   }

   return vShot;
}

1st parameter, Shot = Name of projectile to be shot
2nd and 3rd parameter, dx & dy = x and y distance from offset from which projectile will be shot
4th and 5th parameter, Vx & Vy = x and y velocity of the projectile
 
yea i messed around with those numbers a lot and could not figure out how to make it shoot diagonally it would either move down real fast and then shoot straight or it would move straight across the screen.  It never would shoot diagonally down and hit the ground.
 
To make projectile move diagonally, give value to the last two parameters something like:

@cmd shooter "Shot" 20 20 2 4

for diagonal forward up OR

@cmd shooter "Shot" 20 20 2 -4

for diagonal forward down
 
Bloodbane said:
To make projectile move diagonally, give value to the last two parameters something like:

@cmd shooter "Shot" 20 20 2 4

for diagonal forward up OR

@cmd shooter "Shot" 20 20 2 -4

for diagonal forward down

It didn't work its weird... The first one goes down just a bit and flies off the screen @cmd shooter "Shot" 20 20 2 4
the second one does the same thing but goes behind the sprites and flies off the screen this one  @cmd shooter "Shot" 20 20 2 -4

I want his rose to do what akumas air fire ball does :P thanks for the help though
 
Cool that helped so in sailor moon I wanted to give each character 2 attack buttons one for punches and one for kicks.  I am using the follow command for the kicks.. The problem is with the follow command alone if he hits the player the rest of the combo keeps going.. I want it to be like the normal attack button where you have to press it to keep the combo going.. I was told to use the cancel function for this but it still does the same thing.. Am I doing thiss correctly?

anim follow2
bbox 71 92 46 98
followanim 4
followcond 1
cancel 0 1 1
        fastattack 1
attack 0 0 0 0 0 0 0 0 0 0
delay 10
offset 99 189
hitflash flash1
frame data/chars/tuxedo/kik1-1.png
attack 99 126 52 45 3 0 1 0 0 0
bbox 70 93 41 98
delay 20
frame data/chars/tuxedo/kik1-2.png
bbox 73 92 34 98
delay 10
frame data/chars/tuxedo/kik1-1.png

anim follow4
bbox 74 91 45 98
followanim 5
followcond 1
cancel 0 2 1
        fastattack 1
attack 0 0 0 0 0 0 0 0 0 0
delay 10
offset 99 189
hitflash flash2
frame data/chars/tuxedo/kik5-1.png
bbox 80 96 40 94
frame data/chars/tuxedo/kik5-2.png
delay 18
attack 111 109 60 41 4 0 1 0 0 0
bbox 81 96 43 93
frame data/chars/tuxedo/kik5-3.png
attack 104 112 60 39 2 0 1 0 0 0
bbox 79 95 34 95
frame data/chars/tuxedo/kik5-4.png
bbox 78 95 41 95
delay 10
frame data/chars/tuxedo/kik5-2.png
bbox 72 91 46 99
frame data/chars/tuxedo/kik5-1.png

anim follow5
bbox 78 100 30 90
followcond 1
cancel 0 4 1
        fastattack 1
attack 0 0 0 0 0 0 0 0 0 0
delay 9
offset 99 189
hitflash flash3
frame data/chars/tuxedo/kik3-1.png
bbox 81 97 38 93
frame data/chars/tuxedo/kik3-2.png
bbox 81 96 57 92
frame data/chars/tuxedo/kik3-3.png
bbox 76 95 62 95
frame data/chars/tuxedo/kik3-4.png
delay 25
attack 107 109 65 43 9 1 1 0 0 0
bbox 67 93 51 97
frame data/chars/tuxedo/kik5-3.png
delay 9
bbox 70 96 47 94
frame data/chars/tuxedo/kik5-2.png
bbox 70 91 50 99
frame data/chars/tuxedo/kik5-1.png

anim freespecial1
delay 4
loop 0
followcond 1
followanim 2
cancel 0 1 1
        hitflash flash
offset 99 189
bbox 69 93 48 96
frame data/chars/tuxedo/kik1-1.png
bbox 66 92 49 99
frame data/chars/tuxedo/kik1-2.png
attack 107 124 63 42 3 0 1 0 0 0
bbox 66 94 53 96
delay 15
        frame data/chars/tuxedo/kik1-3.png
 
That's followup system not cancel system
Example of kick combo with cancel is like this:
anim freespecial
delay 8
offset 170 302
bbox 129 60 88 244
cancel 5 5 0 A2 freespecial4
        sound  data/chars/kenshiro/ah.wav
        frame  data/chars/kenshiro/lkick1.png
bbox 76 65 105 239
        frame  data/chars/kenshiro/lkick2.png
        frame  data/chars/kenshiro/lkick3.png
attack  176 174 110 85 10 0 0 0 10
        frame  data/chars/kenshiro/lkick4.png
attack  0
        frame  data/chars/kenshiro/lkick5.png
        frame  data/chars/kenshiro/lkick5.png

anim freespecial4
delay 10
offset 170 302
bbox 80 55 97 250
cancel 4 4 0 A2 freespecial5
        sound  data/chars/kenshiro/ah.wav
        frame  data/chars/kenshiro/hkick1.png
bbox 45 78 100 226
        frame  data/chars/kenshiro/hkick2.png
attack4 143 80 156 51 10 0 0 0 10
        frame  data/chars/kenshiro/hkick3.png
attack  0
bbox 80 55 97 250
        frame  data/chars/kenshiro/hkick4.png
        frame  data/chars/kenshiro/hkick4.png

anim freespecial5
delay 7
offset 170 302
bbox 169 82 76 222
        sound  data/chars/kenshiro/ah.wav
        frame  data/chars/kenshiro/rkick1.png
bbox 114 66 127 240
        frame  data/chars/kenshiro/rkick2.png
attack2 240 49 124 114 20 1 0 0 20
dropv 4 4 0
        frame  data/chars/kenshiro/rkick3.png
attack  0
        frame  data/chars/kenshiro/rkick4.png
        frame  data/chars/kenshiro/rkick5.png
        frame  data/chars/kenshiro/rkick6.png
bbox 84 75 118 230
        frame  data/chars/kenshiro/rkick7.png
        frame  data/chars/kenshiro/rkick8.png
        frame  data/chars/kenshiro/rkick9.png
        frame  data/chars/kenshiro/rkick10.png

See the blue texts? that's how to set up cancels
 
Back
Top Bottom