Problems with special animation ( A + J )

dantedevil

Well-known member
Hello!

I have a problem with all my players in my mod.
In models txt i set ajspecial 1 to use block, the A + B  anim special.

I set  mponly  1, energycost 50  in all characters but the bar not decrease when they perform the attack.

A very strange problem is left me execute special only once, if i try again the hero dont do nothing, if i keep playing trying every minute at last finally works again, but when not works the hero dont do anything, even the "cant" animation

I trying setting        @cmd    mpcost 50 and the bar decrease ok, but still with the big problem. Only can do one special, and no more.

Wath happend here?

header: 
mp 100

Here one of the anim special 
Code:
anim special
	loop	0
	delay	5
	offset	91 177
	bbox	0 0 0 0
	loop	0
	delay	6
        @cmd    mpcost 50
	frame	data/chars/kang/sel1.gif
	frame	data/chars/kang/sel2.gif
	frame	data/chars/kang/sel3.gif
	frame	data/chars/kang/sel4.gif
	frame	data/chars/kang/sel5.gif
	frame	data/chars/kang/sel6.gif
	frame	data/chars/kang/sel7.gif
	frame	data/chars/kang/sel8.gif
	delay	25
	sound	data/sounds/magic.wav
	frame	data/chars/kang/sel9.gif
	delay	5
	offset	127 225
        bbox      0 0 0 0
        sound   data/sounds/morph.wav
	frame	data/chars/kang/dragon00.gif
	frame	data/chars/kang/dragon01.gif
	frame	data/chars/kang/dragon02.gif
	frame	data/chars/kang/dragon03.gif
	frame	data/chars/kang/dragon04.gif
	frame	data/chars/kang/dragon05.gif
	frame	data/chars/kang/dragon06.gif
	frame	data/chars/kang/dragon07.gif
        sound   data/chars/kang/dragon.wav
	frame	data/chars/kang/dragon08.gif
	delay	15
	frame	data/chars/kang/dragon09.gif
	delay	12
	frame	data/chars/kang/dragon17.gif
	frame	data/chars/kang/dragon18.gif
	frame	data/chars/kang/dragon19.gif
	delay	35
	frame	data/chars/kang/dragon20.gif
	delay	8
	frame	data/chars/kang/dragon19.gif
	offset	318 235
        sound   data/chars/kang/acid/acid.wav
	frame	data/chars/kang/dragonsp01.gif
	frame	data/chars/kang/dragonsp02.gif
        sound   data/chars/kang/acid/acid.wav
	frame	data/chars/kang/dragonsp03.gif
	frame	data/chars/kang/dragonsp04.gif
        sound   data/chars/kang/acid/acid.wav
	frame	data/chars/kang/dragonsp05.gif
	frame	data/chars/kang/dragonsp06.gif
	frame	data/chars/kang/dragonsp07.gif
	frame	data/chars/kang/dragonsp08.gif
	delay	8
	offset	127 225
	frame	data/chars/kang/dragon19.gif
       @cmd     toss "acid" 200 240 -1
	frame	data/chars/kang/dragon19.gif
       @cmd     toss "acid" 50 240 0
	frame	data/chars/kang/dragon19.gif
       @cmd     toss "acid" -100 240 1
	frame	data/chars/kang/dragon19.gif
       @cmd     toss "acid" -100 240 -1
	frame	data/chars/kang/dragon19.gif
       @cmd     toss "acid" 50 240 0
	frame	data/chars/kang/dragon19.gif
       @cmd     toss "acid" 200 240 1
	frame	data/chars/kang/dragon19.gif
	delay	35
	frame	data/chars/kang/dragon20.gif
	offset	127 225
        sound   data/sounds/morph.wav
	delay	5
	frame	data/chars/kang/dragon08.gif
	frame	data/chars/kang/dragon07.gif
	frame	data/chars/kang/dragon06.gif
	frame	data/chars/kang/dragon05.gif
	frame	data/chars/kang/dragon04.gif
	frame	data/chars/kang/dragon03.gif
	frame	data/chars/kang/dragon02.gif
	frame	data/chars/kang/dragon01.gif
	frame	data/chars/kang/dragon00.gif
	offset	91 177
	delay	25
        @cmd    clearL
	frame	data/chars/kang/sel9.gif
	delay	9
	frame	data/chars/kang/sel1.gif


 
I finally solved with this topic, energycost never works.
http://www.chronocrash.com/forum/index.php?topic=8.msg154#msg154

There is a scipt courtesy of Bloodbane and works perfect for this.
Here the script:
Code:
   @script
   void vSelf = getlocalvar("self");
   int   iMP = getentityproperty(vSelf, "mp");
   if ( frame == 0 && iMP < 10 )
     {
        //then play can't animation
        performattack(vSelf, openborconstant("ANI_CANT"), 1);
     }
   if ( frame == 4 ){
        changeentityproperty(vSelf, "mp", iMP - 10);
        }
   @end_script

Now i have a different question:

What is for @cmd  spawnbind?

Wath difference with @cmd spawn01?

Thanks.

 
spawn01 function simply spawns other entity.
spawnbind is extended version of that function which works by spawning an entity then immediately binds it to spawning entity.
 
Just 2 side notes:

-That spawbind script doesn't controls neither the direction or the last value of bindentity function (bindanimation) (in bold):

void spawnbind(void Name, float dx, float dy, float dz)
{ // Spawn and bind other entity
  void self = getlocalvar("self");
  void Spawn;

  Spawn = spawn01(Name, dx, dy, 0);
  bindentity(Spawn, self, dx, dz, dy, 0, 0);

Those are the values of bindentity:
bindentity(entity, target, int x, int z, int a, int direction, int bindanimation)
~Bind entity to target, so the target moves, the entity moves.
~x, z, a: relative to target.
~direction: 0 no change 1 same direction as target -1 opposite direction as target 2 always right -2 always left
~bindanimation: 0 No effect. 1 Keep same animation as the target. 2 Also keep same frame as the target. 4 Kill the entity if the animation doesn't match.
~To unbind a entity, use bindentity(entity, NULL());
~Notice: You can combine those values for bindanimation, so it can be 6 which means 2 and 4.

To solve that, I modified this script:
Code:
void spawnbind(void Name, float dx, float dy, float dz, int iDir,int iBind)
{ // Spawn and bind other entity
   void self = getlocalvar("self");
   void Spawn;

   Spawn = spawn01(Name, dx, dy, 0);
   bindentity(Spawn, self, dx, dz, dy, iDir, iBind);
Bear in mind that this script takes 2 more values than the previous one when you call it.

- There is a bug in openBor related to bindentity. I saddly discovered it on my game and WhiteDragon made a workaround to fix it. http://www.chronocrash.com/forum/index.php?topic=703.msg10845#msg10845

I pmed utunnels and Plombo about it and posted it on the forum. No reply from both.
 
dantedevil said:
I finally solved with this topic, energycost never works.
http://www.chronocrash.com/forum/index.php?topic=8.msg154#msg154

There is a scipt courtesy of Bloodbane and works perfect for this.
Here the script:
Code:
   @script
   void vSelf = getlocalvar("self");
   int   iMP = getentityproperty(vSelf, "mp");
   if ( frame == 0 && iMP < 10 )
     {
        //then play can't animation
        performattack(vSelf, openborconstant("ANI_CANT"), 1);
     }
   if ( frame == 4 ){
        changeentityproperty(vSelf, "mp", iMP - 10);
        }
   @end_script

Its possible change this script to make only freeze enemies alive?
Not enemies dead show the death animation and not entities, like type: none.
 
I have 2 animations need freeze all enemies on the screen when start: special and fatality.

SPECIAL: when the hero makes the special spawn an entity (effect special flash, giant twister, lighting storm, etc).
If i use smartbomb of the script freeze of this spot the entities dont show, all freezes to the end of freezing time then after all the entities show.

FATALITY: when the hero make a fatality i need all enemies alive be freezed, but this script freeze the enemy when shows death fatality and freeze too all entities the player spawn during fatality, like thunder of the skies,  bones explote, etc.

 
Back
Top Bottom