Solved Item duplicate bug

Question that is answered or resolved.

dantedevil

Well-known member
When hit an obstacle with item inside, with the torpedo of Raiden, the items turn in 3.
Thats very rare.

Here the Raiden complete animation:
Code:
anim freespecial8
    loop    0
        followanim 6
        followcond 1
    delay   4
    offset    87 177
    sound   data/chars/raiden/rtorp1.wav
        bbox    76 88 41 90
    frame    data/chars/raiden/s1.png
    frame    data/chars/raiden/s1b.png
    delay   2
    move    6
        bbox    73 86 47 38
    frame    data/chars/raiden/s2.png
    frame    data/chars/raiden/s2.png
    frame    data/chars/raiden/s2.png
    frame    data/chars/raiden/s2.png
        hitfx    data/sounds/beat1b.wav
        bbox    36 96 82 23
        forcedirection -1
    attack30  58 94 92 24 20 1 0 0 20
    move    8
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    move    6
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        move    4
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        move    3
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        move    2
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        attack     0 0 0 0 0 0 0 0 0
        move    1
        bbox    73 86 47 38
    frame    data/chars/raiden/s2.png
    frame    data/chars/raiden/s2.png
        move    0
    delay   4
        bbox    76 88 41 90
    frame    data/chars/raiden/s1b.png
    frame    data/chars/raiden/s1.png

anim follow6
    loop    0
        landframe 58
    offset    87 177
    fastattack 1
        attackone  1
    delay   1
        bbox    0 0 0 0
    frame    data/chars/raiden/s3.png
    delay   2
    move    14
        @cmd    slamstart2
        @cmd    position 10 50 5 -1 0
    frame    data/chars/raiden/s3.png
        @cmd    antiwall 60 -60 -1
        @cmd    position 10 50 5 -1 0
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        @cmd    wallhit2 70 "ANI_FOLLOW12"
        @cmd    position 10 50 5 -1 0
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        @cmd    wallhit2 70 "ANI_FOLLOW12"
        @cmd    position 10 50 5 -1 0
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        frame    data/chars/raiden/s3.png
        @cmd    wallhit2 70 "ANI_FOLLOW12"
        @cmd    position 10 50 5 -1 0
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
    frame    data/chars/raiden/s3.png
        @cmd    wallhit2 70 "ANI_FOLLOW12"
        @cmd    position 10 50 5 -1 0
    frame    data/chars/raiden/s3.png
    sound   data/sounds/indirect.wav
    move    0
        @cmd    antiwall 60 -60 -1
        @cmd    depost 0
        @cmd    finish 14 1 0 2 0 0
    frame    data/chars/raiden/s3.png
    delay   3
        bbox    36 96 82 23
    frame    data/chars/raiden/s3.png
        bbox    73 86 47 38
    frame    data/chars/raiden/s2.png
    delay    2
        offset    95 159
        #jumpframe 33 3 -1 0
        @cmd leaper -1 3 0
    bbox    0 0 0 0
    sound   data/chars/raiden/rtorp2.wav
        attack  78 69 46 51 15 1 0 0 0
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j04.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j02.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j04.png
        frame    data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j04.png
        frame    data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j02.png
        attack    0 0 0 0
        delay   5
    offset    87 145
    bbox    68 61 42 59
    frame    data/chars/raiden/ja01.png
        delay   999
    offset    87 157
    bbox    72 57 37 80
    frame    data/chars/raiden/j2.png
        delay   15
    offset    87 177
    bbox    80 96 34 81
    frame    data/chars/raiden/u1.png



anim follow12
    loop    0
        landframe 30
    offset    87 177
    fastattack 1
        attackone  1
    delay   2
        bbox    0 0 0 0
    sound   data/sounds/indirect.wav
        @cmd    antiwall 60 -60 -1
    frame    data/chars/raiden/s3.png
    move    0
        @cmd    depost 0
        @cmd    finish 14 1 0 2 0 0
    frame    data/chars/raiden/s3.png
    delay   3
        bbox    36 96 82 23
    frame    data/chars/raiden/s3.png
        bbox    73 86 47 38
    frame    data/chars/raiden/s2.png
    delay    2
        offset    95 159
        jumpframe 5 3 -1 0
    bbox    0 0 0 0
    sound   data/chars/raiden/rtorp2.wav
        attack  78 69 46 51 15 1 0 0 0
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j04.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j02.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j04.png
        frame    data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j01.png
        frame    data/chars/raiden/j04.png
        frame    data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j03.png
        frame    data/chars/raiden/j02.png
        frame    data/chars/raiden/j02.png
        attack    0 0 0 0
        delay   5
    offset    87 145
    bbox    68 61 42 59
    frame    data/chars/raiden/ja01.png
        delay   999
    offset    87 157
    bbox    72 57 37 80
    frame    data/chars/raiden/j2.png
        delay   15
    offset    87 177
    bbox    80 96 34 81
    frame    data/chars/raiden/u1.png

Here the trash:
Code:
name    Trash
health    1
type    obstacle
gfxshadow  1
flash        flash
noatflash    1
diesound data/sounds/klunk.wav



anim idle
    loop    0
    delay    100
    offset    69 95
    bbox    50 17 37 80
    frame    data/chars/misc/trashcan.png


anim fall
    loop    1
    delay    1000
    offset    68 95
    frame    data/chars/misc/trashed.png

The money:
Code:
name       Money1
health       0
score       500
type       item
gfxshadow  1
facing     1
nolife 1


anim idle
    loop    1
    offset    47 85
    delay    100
    bbox    26 60 42 34
    drawmethod    scale 0.8 0.8
    frame    data/chars/misc/money1a.png
        delay   3
        frame    data/chars/misc/money1b.png

In the level simply declare like this:

spawn trash
item money1
coords 134 231
at 0



No matter which item used, the result is always the same in every level.
 
Last edited:
Solution
Finally can solve this problem.
Use a script cancelgrab in the first frame, so this way Raiden not grab the obstacle with the slamstart2 in the follow6.

Here the script:
Code:
void cancelgrab3()
        {// Check grabbed opponent's name
        // If it's forbidden to grab him/her, revert to IDLE
           void self = getlocalvar("self");
           void target = getlocalvar("Target" + self);

           if(target==NULL())
           {
             target = getentityproperty(self, "opponent");
             setlocalvar("Target" + self, target);
           }
           if(target!=NULL())
           {
             char Tname = getentityproperty(target, "defaultname");
             char iType = getentityproperty(target, "type");

         ...
its breaking the obstacle 3 times
raiden attack damages 20 and knocks
Code:
freespecial8
	attack30  58 94 92 24 20 1 0 0 20

obstacles must use anim fall7 to slamstart
and anim fall is looping it could be hitting the ground 3 times ?
anim fall
loop 1 <-----------//-------//-----/--/---
delay 1000
offset 68 95
frame data/chars/misc/trashed.png

there is a new option in newer versions to followcond that can check the enemy cantgrab 1 and it doesnt makes the follow... you could try it see if works ?

or use the standard... 2 seems to only check enemy or player
1 = this animation will followup as long as it hits an entity.
2 = this animation will followup as long as it hits an enemy (Or player if an enemy uses it).

 
O Ilusionista said:
The obstacle doesn't needs a fall7 animation.  Please post your follow6 animation here.

The follow6 is in the first post with the complete animation of Raiden.

Try using followcond 2 in the freespecial8 and the bug still happend.
 
Finally can solve this problem.
Use a script cancelgrab in the first frame, so this way Raiden not grab the obstacle with the slamstart2 in the follow6.

Here the script:
Code:
void cancelgrab3()
        {// Check grabbed opponent's name
        // If it's forbidden to grab him/her, revert to IDLE
           void self = getlocalvar("self");
           void target = getlocalvar("Target" + self);

           if(target==NULL())
           {
             target = getentityproperty(self, "opponent");
             setlocalvar("Target" + self, target);
           }
           if(target!=NULL())
           {
             char Tname = getentityproperty(target, "defaultname");
             char iType = getentityproperty(target, "type");

             if(Tname == "GORO" || Tname == "KINTARO" || Tname == "MOTARO" || Tname == "KNIFER" || iType == openborconstant

("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM"))
             {
                 changeentityproperty(self, "animation", openborconstant("ANI_FREESPECIAL30"));
             }
           }
        }
 
Solution
Back
Top Bottom