@cmd shooter declared, nothing happens.

ChrisFalconSTB

Active member
The title is self-explanatory.

I've set up a command that releases an anti-aerial attack. Said attack releases a projectile, which is properly called in models.txt and it has all of its frames declared correctly as well.

Yet still, when the character performs the animation, only the character animation will play, but the projectile declared won't.

This is the code of the animation I'm using for the attack:
Code:
anim	freespecial3
	loop	0
	offset	240 204
	mpcost	6 1 0
	delay	4
	jugglecost	2
	frame	data/chars/ryu/satk2_0.png
	frame	data/chars/ryu/satk2_1.png
	frame	data/chars/ryu/satk2_2.png
	frame	data/chars/ryu/satk2_3.png
	@cmd	shooter "flame" 0 0 0
	@cmd	shooter "flame" 0 0 0
	@cmd	shooter "flame" 0 0 0
	@cmd	shooter "flame" 0 0 0
	frame	data/chars/ryu/satk2_4.png
	frame	data/chars/ryu/satk2_5.png
	delay	12
	frame	data/chars/ryu/satk2_6.png
	frame	data/chars/ryu/satk2_7.png

The projectile that doesn't appear:

Code:
name    flame
health 	1
nolife	1
type	npc
hostile	enemy npc obstacle
candamage enemy npc obstacle
speed   0
nomove  1 0
noquake	1
falldie 1
subtype	flydie
shadow	0
remove	0
flash	flash
lifespan 2
subject_to_wall 0
palette	data/chars/misc/flame/flame0.png

anim	death
	offset	240 204
	bbox	0 0 0 0
	delay	5
	move	1000
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
		
anim	fall
	loop	0
	delay	2
	offset	30 30
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
		
anim	follow1
	loop	0
	offset	240 204
	bbox	0 0 0 0
	delay	5
	move	1000
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
		
anim	idle
	delay	4
	offset	0 200
	followanim	1
	followcond	1
	jugglecost	2
	fastattack	1
	attack.damage.force 0
	attack.effect.hit.flash.model hit2
	attack.effect.hit.sound.path Data/SOUNDS/hit2.wav
	attack.position.x 0
	attack.position.y 0
	attack.size.x 0
	attack.size.y 0
	frame	data/chars/misc/flame/flame_0.png
	frame	data/chars/misc/flame/flame_1.png
	attack.damage.force 15
	attack.position.x -6
	attack.position.y 18
	attack.reaction.fall.force 1
	attack.reaction.fall.velocity.x 0.5
	attack.reaction.fall.velocity.y 4.0
	attack.reaction.pause.time 1
	attack.size.x 107
	attack.size.y 206
	attack.size.z.1 30
	frame	data/chars/misc/flame/flame_2.png
	frame	data/chars/misc/flame/flame_3.png
	attack.damage.force 0
	attack.position.x -3
	attack.position.y -7
	attack.size.x 107
	attack.size.y 226
	frame	data/chars/misc/flame/flame_4.png
	attack.damage.force 0
	attack.position.x 0
	attack.position.y 0
	attack.size.x 0
	attack.size.y 0
	frame	data/chars/misc/flame/flame_5.png
	attack.damage.force 0
	attack.position.x -2
	attack.position.y -7
	attack.size.x 102
	attack.size.y 222
	frame	data/chars/misc/flame/flame_6.png
	frame	data/chars/misc/flame/flame_7.png
	frame	data/chars/misc/flame/flame_8.png
	frame	data/chars/misc/flame/flame_9.png
	frame	data/chars/misc/flame/flame_10.png
	frame	data/chars/misc/flame/flame_11.png
	delay	5
	move	1000
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
	frame	data/chars/misc/empty.png
		
#|edited by openBor Stats v 0.67

And here's something I found on my scriptlog:

Code:
#### animationscript function main #####
# data/chars/Ryu/Ryu.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==14)
    {
        if(frame==4)
        {
            shooter("flame", 0, 0, 0);
        }
        if(frame==4)
        {
            shooter("flame", 0, 0, 0);
        }
        if(frame==4)
        {
            shooter("flame", 0, 0, 0);
        }
        if(frame==4)
        {
            shooter("flame", 0, 0, 0);
        }
        return;
    }

}

The script I'm using is from Bloodbane's Crime Buster mod and I'm using the 6175 build.
 
I can't find shooter function in Crime Buster mod so I believe it must be from other mod or from simple scripts I've shared some time ago here

I assume flame has been loaded in models.txt or at least in character's header

Hmmm...
@cmd shooter "flame" 0 0 0
@cmd shooter "flame" 0 0 0
@cmd shooter "flame" 0 0 0
@cmd shooter "flame" 0 0 0

shooter function has 7 parameters but you haven't defined the last 3 parameters there. The last 3 parameters defined projectile's velocity

Try defining velocities for those flames and see what happens :)
 
Gonna test your suggestion and send the feedback.

Edit: Turns out I overlooked a small detail in the character header (He was missing the "load flame.txt" line).

And I was also able to correct a wrong pointer into the projectile's palette file, I fixed two problems in a single thread. :D
 
Another interesting way to do this is the "Rocket Viper 2" method:

Code:
anim	freespecial5
	energycost	17
	mponly	1
	loop	0
	delay	6
	offset	123 176
	bbox	92 88 61 87
	frame	data/chars/1ken/ani/at3.png
	frame	data/chars/1ken/ani/at4.png
	@cmd	randSound0 "chars/1ken/voice/hadoken.wav" "chars/1ken/voice/med.wav"
	frame	data/chars/1ken/ani/at5.png
	@cmd	shoot "hadouken" 50 75 1      -------------------STILL USING COMMAND
	frame	data/chars/1ken/ani/at6.png
	frame	data/chars/1ken/ani/at7.png
	delay	5
	frame	data/chars/1ken/ani/at8.png
	frame	data/chars/1ken/ani/at9.png
	frame	data/chars/1ken/ani/at10.png
		
anim	freespecial6
	energycost	25
	mponly	1
	delay	7
	offset	130 175
	bbox	105 91 49 90
	frame	data/chars/1ken/ani/hado1.png
	frame	data/chars/1ken/ani/hado2.png
	@cmd	randSound0 "chars/1ken/voice/hadoken.wav" "chars/1ken/voice/med.wav"
	frame	data/chars/1ken/ani/hado3.png
	@cmd	shoot "hadoua" 50 52 1  ----------------------------ALSO X and Y CORD. 
	frame	data/chars/1ken/ani/hado4.png
	frame	data/chars/1ken/ani/hado5.png
	frame	data/chars/1ken/ani/hado6.png
	frame	data/chars/1ken/ani/hado7.png
	frame	data/chars/1ken/ani/hado8.png
	frame	data/chars/1ken/ani/hado9.png
	frame	data/chars/1ken/ani/hado10.png
	frame	data/chars/1ken/ani/hado11.png
	frame	data/chars/1ken/ani/hado12.png

But you need this script in "data/scripts/common/shoot.c:

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)
	{
		dx = -dx;
	}else{}

	void vSpawn=projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);

	if (getentityproperty(self,"type")==openborconstant("type_player"))
	{
		changeentityproperty(vSpawn,"candamage","type_enemy","type_obstacle");
	}else if(getentityproperty(self,"type")==openborconstant("type_enemy"))
	{
		changeentityproperty(vSpawn,"candamage","type_player","type_npc");
	}
}
void tosser(void Bomb, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{
	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){
		dx=-dx;
	}else{}
	void Shot = projectile(Bomb, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
	changeentityproperty(Shot, "parent", self);
	tossentity(Shot, Vy, Vx, Vz);
	changeentityproperty(Shot, "speed", Vx); 
	changeentityproperty(Shot, "hostile", getentityproperty(self, "hostile")+openborconstant("TYPE_RESERVED"));
	changeentityproperty(Shot, "candamage", getentityproperty(self, "candamage")+openborconstant("TYPE_RESERVED"));
}
void shoot2(void Shot, float dx, float dy, float dz,float vx, float vy, float vz)
{
	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){
	  dx = -dx;
	}else{}
	void vSpawn=projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
	changeentityproperty(vSpawn,"speed",vx);
	changeentityproperty(vSpawn,"velocity",vx,vz,vy);
	changeentityproperty(vSpawn, "hostile", getentityproperty(self, "hostile")+openborconstant("TYPE_RESERVED"));
	changeentityproperty(vSpawn, "candamage", getentityproperty(self, "candamage")+openborconstant("TYPE_RESERVED"));
}
 
Back
Top Bottom