Small respawn issue in V4 builds.

ChrisFalconSTB

Active member
I currently use the build v3 6391 and bloodbane's simple scripts for special moves.

bor - 0004.png
This is how the attack looks like. An energy ball.

But whenever I do the same attack in the v4 build, this happens:
bor - 0003.png
No projectiles spawned at all.

As for the codes for both the character and the projectiles spawned, here they are:

Character-specific code:
Code:
Name         Snow_White
health        100
mp         100
speed        9
jumpheight      3
running     18 3 2 1 0
type        player
gfxshadow    1
atchain     1  1  2  3  4
icon        data/chars/Shimo/icon.png 1
palette        data/chars/Shimo/col1.png
alternatepal    data/chars/Shimo/col2.png
animationscript data/scripts/script.c
load            Kikosho
load            Dragon
load            Tornado
com             a2     freespecial
com             d f a  freespecial5
com             d u a  freespecial6
com             d f a2 freespecial8

anim    attack1
    hitflash    Flash
    hitfx    data/sounds/Hit1.wav
    cancel    0 99 1 a2 freespecial
    loop    0
    offset    61 137
    delay    4
    frame    Data/Chars/Shimo/Shimo_8-0.png
    frame    Data/Chars/Shimo/Shimo_8-1.png
    attack    64 53 64 40 2 0 0 0 5 30
    dropv    1 1 0
    frame    Data/Chars/Shimo/Shimo_8-2.png
    frame    Data/Chars/Shimo/Shimo_8-3.png
    frame    Data/Chars/Shimo/Shimo_8-0.png
        
anim    attack2
    hitflash    Flash
    hitfx    data/sounds/Hit1.wav
    cancel    0 99 1 a2 freespecial
    loop    0
    offset    61 137
    delay    4
    frame    Data/Chars/Shimo/Shimo_9-0.png
    frame    Data/Chars/Shimo/Shimo_9-1.png
    frame    Data/Chars/Shimo/Shimo_9-2.png
    attack    71 52 49 67 2 0 0 0 5 30
    dropv    1 0.5 0
    frame    Data/Chars/Shimo/Shimo_9-3.png
    frame    Data/Chars/Shimo/Shimo_9-4.png
    frame    Data/Chars/Shimo/Shimo_9-5.png
    frame    Data/Chars/Shimo/Shimo_9-2.png
    frame    Data/Chars/Shimo/Shimo_9-1.png
        
anim    attack3
    hitflash    Flash2
    hitfx    data/sounds/Hit2.wav
    cancel    0 99 1 a2 freespecial
    loop    0
    offset    61 137
    delay    4
    frame    Data/Chars/Shimo/Shimo_10-0.png
    frame    Data/Chars/Shimo/Shimo_10-1.png
    attack    72 45 64 79 2 0 0 0 5 30
    dropv    1 1.5 0
    frame    Data/Chars/Shimo/Shimo_10-2.png
    frame    Data/Chars/Shimo/Shimo_10-3.png
    frame    Data/Chars/Shimo/Shimo_10-4.png
    frame    Data/Chars/Shimo/Shimo_10-5.png
    frame    Data/Chars/Shimo/Shimo_10-6.png
    frame    Data/Chars/Shimo/Shimo_10-7.png
        
anim    attack4
    hitflash    Flash3
    hitfx    data/sounds/Hit3.wav
    cancel    0 99 1 a2 freespecial
    loop    0
    offset    61 137
    delay    4
    frame    Data/Chars/Shimo/Shimo_11-0.png
    frame    Data/Chars/Shimo/Shimo_11-1.png
    frame    Data/Chars/Shimo/Shimo_11-2.png
    frame    Data/Chars/Shimo/Shimo_11-3.png
    attack    42 68 99 43 3 1 0 0 5 30
    dropv    1.5 2 0
    frame    Data/Chars/Shimo/Shimo_11-4.png
    frame    Data/Chars/Shimo/Shimo_11-5.png
    frame    Data/Chars/Shimo/Shimo_11-6.png
    frame    Data/Chars/Shimo/Shimo_11-7.png
    frame    Data/Chars/Shimo/Shimo_11-8.png
    frame    Data/Chars/Shimo/Shimo_11-9.png
        
anim    forwardjump
    loop    0
    offset    61 137
    delay    8
    frame    Data/Chars/Shimo/Shimo_5-0.png
    frame    Data/Chars/Shimo/Shimo_5-1.png
    frame    Data/Chars/Shimo/Shimo_5-2.png
    frame    Data/Chars/Shimo/Shimo_5-3.png
    frame    Data/Chars/Shimo/Shimo_5-4.png
    frame    Data/Chars/Shimo/Shimo_5-5.png
    frame    Data/Chars/Shimo/Shimo_5-6.png
    frame    Data/Chars/Shimo/Shimo_5-7.png
    frame    Data/Chars/Shimo/Shimo_5-8.png
    frame    Data/Chars/Shimo/Shimo_5-9.png
        
anim    freespecial
    hitflash    Flash2
    hitfx    data/sounds/Hit2.wav
    fastattack    1
    loop    0
    offset    61 137
    delay    6
    @cmd    leaper 0.5 0 0
    frame    Data/Chars/Shimo/Shimo_12-0.png
    frame    Data/Chars/Shimo/Shimo_12-1.png
    attack    56 63 51 70 2 1 0 0 15 30
    dropv    2 0.5 0
    frame    Data/Chars/Shimo/Shimo_12-2.png
    attack    0 0 0 0 0 0 0 0 0 0
    frame    Data/Chars/Shimo/Shimo_12-3.png
    frame    Data/Chars/Shimo/Shimo_12-4.png
    frame    Data/Chars/Shimo/Shimo_12-5.png
    attack    68 4 41 124 2 1 0 0 5 30
    dropv    3 0.5 0
    frame    Data/Chars/Shimo/Shimo_12-6.png
    frame    Data/Chars/Shimo/Shimo_12-7.png
    frame    Data/Chars/Shimo/Shimo_12-8.png
    frame    Data/Chars/Shimo/Shimo_12-9.png
    frame    Data/Chars/Shimo/Shimo_12-10.png
        
anim    freespecial2
    hitflash    Flash
    hitfx    data/sounds/Hit1.wav
    cancel    0 99 1 a2 freespecial3
    cancel    0 99 1 d u a freespecial6
    loop    0
    offset    61 137
    delay    8
    @cmd    leaper 0.5 1 0
    frame    Data/Chars/Shimo/Shimo_14-0.png
    frame    Data/Chars/Shimo/Shimo_14-1.png
    delay    30
    attack    28 32 74 74 2 1 0 0 5 30
    dropv    1.5 1 0
    frame    Data/Chars/Shimo/Shimo_14-2.png
    delay    8
    frame    Data/Chars/Shimo/Shimo_14-3.png
        
anim    freespecial3
    hitflash    Flash2
    hitfx    data/sounds/Hit2.wav
    cancel    0 99 1 a2 freespecial4
    cancel    0 99 1 d u a freespecial6
    loop    0
    offset    61 137
    delay    8
    @cmd    leaper 0.5 2 0
    frame    Data/Chars/Shimo/Shimo_15-0.png
    frame    Data/Chars/Shimo/Shimo_15-1.png
    delay    30
    attack    43 14 66 90 2 1 0 0 5 30
    dropv    1.5 0.5 0
    frame    Data/Chars/Shimo/Shimo_15-2.png
    delay    8
    frame    Data/Chars/Shimo/Shimo_15-3.png
    frame    Data/Chars/Shimo/Shimo_15-4.png
        
anim    freespecial4
    hitflash    Flash3
    hitfx    data/sounds/Hit3.wav
    loop    0
    offset    61 137
    delay    8
    cancel    0 99 1 d u a freespecial6
    @cmd    leaper 1 1 0
    frame    Data/Chars/Shimo/Shimo_16-0.png
    frame    Data/Chars/Shimo/Shimo_16-1.png
    frame    Data/Chars/Shimo/Shimo_16-2.png
    attack    33 60 103 53 3 1 0 0 5 30
    dropv    1 2 0
    frame    Data/Chars/Shimo/Shimo_16-3.png
    frame    Data/Chars/Shimo/Shimo_16-4.png
    frame    Data/Chars/Shimo/Shimo_16-5.png
    frame    Data/Chars/Shimo/Shimo_16-6.png
    frame    Data/Chars/Shimo/Shimo_16-7.png
        
anim    freespecial5
    hitflash    Flash2
    hitfx    data/sounds/Hit2.wav
    loop    0
    offset    61 137
    delay    6
    frame    Data/Chars/Shimo/Shimo_21-0.png
    frame    Data/Chars/Shimo/Shimo_21-1.png
    frame    Data/Chars/Shimo/Shimo_21-2.png
    frame    Data/Chars/Shimo/Shimo_21-3.png
    frame    Data/Chars/Shimo/Shimo_21-4.png
    @cmd    spawn "Kikosho" 0 0 0
    @cmd    shoot "Kikosho" 0 0 0
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
        
anim    freespecial6
    loop    0
    offset    61 137
    delay    6
    @cmd    leaper 0.5 3 0
    @cmd    shoot "tornado" 0.5 4 0
    frame    data/chars/Shimo/Shimo_22-0.png
    frame    data/chars/Shimo/Shimo_22-1.png
    frame    data/chars/Shimo/Shimo_22-2.png
    frame    data/chars/Shimo/Shimo_22-3.png
    frame    data/chars/Shimo/Shimo_22-4.png
    frame    data/chars/Shimo/Shimo_22-5.png
    frame    data/chars/Shimo/Shimo_22-6.png
    frame    data/chars/Shimo/Shimo_22-7.png
    frame    data/chars/Shimo/Shimo_22-8.png
    frame    data/chars/Shimo/Shimo_22-9.png
    frame    data/chars/Shimo/Shimo_22-10.png
    frame    data/chars/Shimo/Shimo_22-11.png
        
anim    freespecial8
    hitflash    Flash2
    hitfx    data/sounds/Hit2.wav
    summonframe    0 0 0 0 0
    subentity    Hyper
    loop    0
    offset    61 137
    delay    6
    frame    Data/Chars/Shimo/Shimo_21-0.png
    frame    Data/Chars/Shimo/Shimo_21-1.png
    frame    Data/Chars/Shimo/Shimo_21-2.png
    frame    Data/Chars/Shimo/Shimo_21-3.png
    frame    Data/Chars/Shimo/Shimo_21-4.png
    @cmd    shoot "Dragon" 0 0 0
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
        
anim    get
    loop    0
    offset    61 137
    delay    8
    frame    Data/Chars/Shimo/Shimo_2-0.png
    frame    Data/Chars/Shimo/Shimo_2-1.png
    frame    Data/Chars/Shimo/Shimo_2-2.png
    frame    Data/Chars/Shimo/Shimo_2-1.png
    frame    Data/Chars/Shimo/Shimo_2-0.png
        
anim    idle
    loop    1
    offset    61 137
    delay    8
    bbox    0 0 0 0
    frame    Data/Chars/Shimo/Shimo_0-0.png
    frame    Data/Chars/Shimo/Shimo_0-1.png
    frame    Data/Chars/Shimo/Shimo_0-2.png
    frame    Data/Chars/Shimo/Shimo_0-3.png
    frame    Data/Chars/Shimo/Shimo_0-4.png
    frame    Data/Chars/Shimo/Shimo_0-5.png
    frame    Data/Chars/Shimo/Shimo_0-6.png
    frame    Data/Chars/Shimo/Shimo_0-7.png
        
anim    jump
    loop    0
    offset    61 137
    delay    8
    frame    Data/Chars/Shimo/Shimo_4-0.png
    frame    Data/Chars/Shimo/Shimo_4-1.png
    frame    Data/Chars/Shimo/Shimo_4-2.png
    frame    Data/Chars/Shimo/Shimo_4-3.png
    frame    Data/Chars/Shimo/Shimo_4-4.png
    frame    Data/Chars/Shimo/Shimo_4-5.png
    frame    Data/Chars/Shimo/Shimo_4-6.png
    frame    Data/Chars/Shimo/Shimo_4-7.png
    frame    Data/Chars/Shimo/Shimo_4-8.png
    frame    Data/Chars/Shimo/Shimo_4-9.png
    frame    Data/Chars/Shimo/Shimo_4-10.png
        
anim    jumpattack
    hitflash    Flash2
    hitfx    data/sounds/Hit2.wav
    cancel    0 99 1 a2 freespecial2
    loop    0
    offset    61 137
    delay    8
    frame    Data/Chars/Shimo/Shimo_13-0.png
    frame    Data/Chars/Shimo/Shimo_13-1.png
    Attack1    45 55 96 38 3 1 0 0 5 30
    dropv    2 0.5 0
    frame    Data/Chars/Shimo/Shimo_13-2.png
    frame    Data/Chars/Shimo/Shimo_13-3.png
    frame    Data/Chars/Shimo/Shimo_13-4.png
        
anim    run
    loop    1 2 8
    offset    61 137
    delay    8
    bbox    0 0 0 0
    frame    Data/Chars/Shimo/Shimo_7-0.png
    frame    Data/Chars/Shimo/Shimo_7-1.png
    frame    Data/Chars/Shimo/Shimo_7-2.png
    frame    Data/Chars/Shimo/Shimo_7-3.png
    frame    Data/Chars/Shimo/Shimo_7-4.png
    frame    Data/Chars/Shimo/Shimo_7-5.png
    frame    Data/Chars/Shimo/Shimo_7-6.png
    frame    Data/Chars/Shimo/Shimo_7-1.png
        
anim    runattack
    hitflash    Flash3
    hitfx    data/sounds/Hit3.wav
    loop    0
    offset    61 137
    delay    6
    @cmd    dasher 1.5 0 0
    frame    Data/Chars/Shimo/Shimo_20-0.png
    frame    Data/Chars/Shimo/Shimo_20-1.png
    attack    55 64 81 41 4 1 0 0 5 30
    dropv    1 2 0
    frame    Data/Chars/Shimo/Shimo_20-2.png
    frame    Data/Chars/Shimo/Shimo_20-3.png
    frame    Data/Chars/Shimo/Shimo_20-4.png
    frame    Data/Chars/Shimo/Shimo_20-5.png
    frame    Data/Chars/Shimo/Shimo_20-6.png
        
anim    turn
    loop    0
    offset    61 137
    delay    6
    frame    Data/Chars/Shimo/Shimo_1-0.png
    frame    Data/Chars/Shimo/Shimo_1-1.png
    frame    Data/Chars/Shimo/Shimo_1-2.png
        
anim    walk
    loop    1
    offset    61 137
    delay    8
    bbox    0 0 0 0
    frame    Data/Chars/Shimo/Shimo_3-0.png
    frame    Data/Chars/Shimo/Shimo_3-1.png
    frame    Data/Chars/Shimo/Shimo_3-2.png
    frame    Data/Chars/Shimo/Shimo_3-3.png
    frame    Data/Chars/Shimo/Shimo_3-4.png
    frame    Data/Chars/Shimo/Shimo_3-5.png
    frame    Data/Chars/Shimo/Shimo_3-6.png

As for both the attacks affected by the "non-spawn":

Code:
name Kikosho
health 1
nolife 1
type npc
hostile enemy obstacle npc
candamage enemy obstacle npc
speed 0
nomove 1
falldie 1
subtype flydie
shadow  0
remove  0
subject_to_wall 0
subject_to_screen 0
palette data/chars/Shimo/Kikosho/Kikosho_0.png

anim    death
    loop    0
    delay    2
    offset    1 1
    bbox    0 0 0 0
    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
    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    1 1
    bbox    0 0 0 0
    frame    data/chars/misc/empty.png
    frame    data/chars/misc/empty.png
    frame    data/chars/misc/empty.png
        
anim    idle
    offset    -20 109
    loop    0
    delay    5
    fastattack    1
    hitflash    flash2
    hitfx    data/sounds/hit2.wav
    attack    6 10 95 90 5 0 1 0 8 30
    dropv    0.5 0.5 0
    frame    data/chars/Shimo/Kikosho/Kikosho_0.png
    Attack    0
    frame    data/chars/Shimo/Kikosho/Kikosho_1.png
    attack    6 10 95 90 5 0 1 0 8 30
    dropv    0.5 0.5 0
    frame    data/chars/Shimo/Kikosho/Kikosho_2.png
    Attack    0
    frame    data/chars/Shimo/Kikosho/Kikosho_3.png
    attack    6 10 95 90 5 0 1 0 8 30
    dropv    0.5 0.5 0
    frame    data/chars/Shimo/Kikosho/Kikosho_4.png
    Attack    0
    frame    data/chars/Shimo/Kikosho/Kikosho_5.png
    attack    6 10 95 90 5 1 1 0 8 30
    dropv    2 0.5 0
    frame    data/chars/Shimo/Kikosho/Kikosho_6.png
    Attack    0
    frame    data/chars/Shimo/Kikosho/Kikosho_7.png
    frame    data/chars/Shimo/Kikosho/Kikosho_8.png
    frame    data/chars/Shimo/Kikosho/Kikosho_9.png
    frame    data/chars/Shimo/Kikosho/Kikosho_10.png
    frame    data/chars/Shimo/Kikosho/Kikosho_11.png
    frame    data/chars/Shimo/Kikosho/Kikosho_12.png

Code:
name Dragon
health 1
nolife 1
type npc
hostile enemy obstacle npc
candamage enemy obstacle npc
speed 0
nomove 1
falldie 1
subtype flydie
shadow  0
remove  0
subject_to_wall 0
subject_to_screen 0
palette data/chars/Shimo/Dragon/Dragon_0.png
alpha   1

anim    death
    loop    0
    delay    2
    offset    1 1
    bbox    0 0 0 0
    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
    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    1 1
    bbox    0 0 0 0
    frame    data/chars/misc/empty.png
    frame    data/chars/misc/empty.png
    frame    data/chars/misc/empty.png
        
anim    idle
    offset    70 182
    loop    0
    delay    5
    fastattack    1
    otg    1
    hitflash    flash2
    hitfx    data/sounds/hit2.wav
    frame    data/chars/Shimo/Dragon/Dragon_0.png
    frame    data/chars/Shimo/Dragon/Dragon_1.png
    attack    14 117 116 81 2 1 0 0 5 30
    dropv    2 0.5 0
    frame    data/chars/Shimo/Dragon/Dragon_2.png
    attack    0
    frame    data/chars/Shimo/Dragon/Dragon_3.png
    attack    1 6 129 193 2 1 0 0 5 30
    dropv    2 0 0
    frame    data/chars/Shimo/Dragon/Dragon_4.png
    Attack    0
    frame    data/chars/Shimo/Dragon/Dragon_5.png
    attack    0 0 112 197 2 1 0 0 5 30
    dropv    0.5 0 0
    frame    data/chars/Shimo/Dragon/Dragon_6.png
    Attack    0
    frame    data/chars/Shimo/Dragon/Dragon_7.png
    delay    8
    attack    0 6 129 191 2 1 0 0 5 30
    dropv    0.5 1 0
    frame    data/chars/Shimo/Dragon/Dragon_8.png
    delay    6
    Attack    0
    frame    data/chars/Shimo/Dragon/Dragon_9.png
    delay    7
    attack    6 10 272 178 2 1 0 0 5 30
    dropv    0.5 1 0
    frame    data/chars/Shimo/Dragon/Dragon_10.png
    delay    4
    Attack    0
    frame    data/chars/Shimo/Dragon/Dragon_11.png
    delay    1
    attack    6 10 290 182 2 1 0 0 5 30
    dropv    0.5 1 0
    frame    data/chars/Shimo/Dragon/Dragon_12.png
    Attack    0
    frame    data/chars/Shimo/Dragon/Dragon_13.png
    attack    30 15 287 182 2 1 0 0 5 30
    dropv    0.5 1 0
    frame    data/chars/Shimo/Dragon/Dragon_14.png
    Attack    0
    frame    data/chars/Shimo/Dragon/Dragon_15.png
    attack    93 74 248 116 2 1 0 0 5 30
    dropv    0.5 1 0
    frame    data/chars/Shimo/Dragon/Dragon_16.png
    Attack    0
    frame    data/chars/Shimo/Dragon/Dragon_17.png
    frame    data/chars/Shimo/Dragon/Dragon_18.png
    frame    data/chars/Shimo/Dragon/Dragon_19.png
    frame    data/chars/Shimo/Dragon/Dragon_20.png
    frame    data/chars/Shimo/Dragon/Dragon_21.png
    frame    data/chars/Shimo/Dragon/Dragon_22.png
    frame    data/chars/Shimo/Dragon/Dragon_23.png
    frame    data/chars/Shimo/Dragon/Dragon_24.png

The animations affected are freespecial5 and freespecial8; freespecial6 works fine.
 
Hi friend. Please, can you post the scripts below? I mean, the code from you scripts library.

Code:
@cmd    spawn "Kikosho" 0 0 0
@cmd    shoot "Kikosho" 0 0 0

I suggest tagging @Bloodbane too.
I don't know if it's the cause, but spawns are commonly used as "@cmd spawn01", not "@cmd spawn".

Okay, here's the code I have:

C:
void block(int Flag)
{// Turns blocking status
    void self = getlocalvar("self");
    changeentityproperty(self, "aiflag", "blocking", Flag);
}

void move(int dx, int dz,int da)
{ // Moves entity freely and ignores obstacles
    void self = getlocalvar("self");
    int x = getentityproperty(self,"x"); //Get character's x coordinate
    int z = getentityproperty(self,"z"); //Get character's z coordinate
    int a = getentityproperty(self,"a"); //Get character's a coordinate
    int dir = getentityproperty(self,"direction"); //Get character's facing direction

     if(dir==0){ // Facing left?
      changeentityproperty(self, "position", x-dx, z+dz, a+da); //Move
     }
     else if(dir==1){ // Facing right?
      changeentityproperty(self, "position", x+dx, z+dz, a+da); //Move
     }
}

void dasher( float Vx, float Vy, float Vz )
{// Dash with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }

    changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move!
}

void leaper( float Vx, float Vy, float Vz )
{// Leap with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }

    tossentity(self, Vy, Vx, Vz); //Leap!
}

void mpcost( int Cost)
{// Spend some MP
    void self = getlocalvar("self");
    void MP = getentityproperty(self,"mp");

    changeentityproperty(self, "mp", MP-Cost); //Spend!
}

void limiter(int Limit)
{// Prevents hero from performing the animation if his/her MP is less than Limit
    void self = getlocalvar("self");
    void MP = getentityproperty(self,"mp"); //Get entity's MP.

   if(MP<=Limit) // Don't have enough MP?
   {
     setidle(self); //Don't play the animation.
   }
}

void clearL()
{// Clears all local variables
     clearlocalvar();
}

void keyint(void Ani, int Frame, void Key, int Hflag, int Limit)
{// Change current animation if proper key is pressed or released provided MP is more than limit

    void self = getlocalvar("self");
    void Health = getentityproperty(self,"health");
    void MP = getentityproperty(self,"mp");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void iRKey;

        if (Key=="U"){ //Up Required?
          iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
    }

        if (Key=="D"){ //Down Required?
          iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
    }

        if (Key=="J"){ //Jump Required?
          iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
    }

        if (Key=="A"){ //Attack Required?
          iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
    }

        if (Key=="S"){ //Special Required?
          iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
    }

        if (Key=="A2"){ //Attack2 Required?
          iRKey = playerkeys(iPIndex, 0, "attack2"); // "Attack2"
    }

        if (Key=="A3"){ //Attack3 Required?
          iRKey = playerkeys(iPIndex, 0, "attack3"); // "Attack3"
    }

        if (Key=="A4"){ //Attack4 Required?
          iRKey = playerkeys(iPIndex, 0, "attack4"); // "Attack4"
    }

        if (Hflag==1){ //Not holding the button case?
          iRKey = !iRKey; //Take the opposite condition
    }

      if ((MP > Limit) && iRKey){
        changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
        changeentityproperty(self, "animpos", Frame);
      }
}

void keyflip()
{// Change hero's facing direction if left or right is pressed
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index

    if (playerkeys(iPIndex, 0, "moveleft")){ // Left is pressed?
      changeentityproperty(self, "direction", 0); //Face left
    } else if (playerkeys(iPIndex, 0, "moveright")){ // Right is pressed?
      changeentityproperty(self, "direction", 1); //Face right
    }
}

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");
   void vShot;

   if (Direction == 0){ //Is entity facing left?                 
      dx = -dx; //Reverse X direction to match facing
   }

   vShot = projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);
   return vShot;
}

void shooter(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting projectile with speed control
   void vShot = shoot(Shot, dx, dy, dz);

   changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
   changeentityproperty(vShot, "speed", Vx);
}

void keyshoot(void Shot, float dx, float dy, float dz, float Vx, float Vz)
{ // Shooting projectile with key based speed control
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void vShot = shoot(Shot, dx, dy, dz);

    if (playerkeys(iPIndex, 0, "moveup")){
      changeentityproperty(vShot, "velocity", Vx, -Vz);
    } else if (playerkeys(iPIndex, 0, "movedown")){
      changeentityproperty(vShot, "velocity", Vx, Vz);
    } else {
      changeentityproperty(vShot, "velocity", Vx, 0);
    }
    changeentityproperty(vShot, "speed", Vx);
}

void toss(void Bomb, float dx, float dy, float dz)
{ // Tossing bomb
   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 == 0){ //Is entity facing left?                 
      dx = -dx; //Reverse X direction to match facing
   }

   projectile(Bomb, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
}

void spawn01(void vName, float fX, float fY, float fZ)
{
    //spawn01 (Generic spawner)
    //Damon Vaughn Caskey
    //07/06/2007
    //
    //Spawns entity next to caller.
    //
    //vName: Model name of entity to be spawned in.
    //fX: X location adjustment.
    //fY: Y location adjustment.
      //fZ: Z location adjustment.

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int  iDirection = getentityproperty(self, "direction");

    clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

    if (iDirection == 0){ //Is entity facing left?                 
          fX = -fX; //Reverse X direction to match facing.
    }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
    
    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
    changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
    
    return vSpawn; //Return spawn.
}

void shooter2(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting special projectile with speed control
   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, dz);
   changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
   return vShot;
}
 
Okay, here's the code I have:

C:
void block(int Flag)
{// Turns blocking status
    void self = getlocalvar("self");
    changeentityproperty(self, "aiflag", "blocking", Flag);
}

void move(int dx, int dz,int da)
{ // Moves entity freely and ignores obstacles
    void self = getlocalvar("self");
    int x = getentityproperty(self,"x"); //Get character's x coordinate
    int z = getentityproperty(self,"z"); //Get character's z coordinate
    int a = getentityproperty(self,"a"); //Get character's a coordinate
    int dir = getentityproperty(self,"direction"); //Get character's facing direction

     if(dir==0){ // Facing left?
      changeentityproperty(self, "position", x-dx, z+dz, a+da); //Move
     }
     else if(dir==1){ // Facing right?
      changeentityproperty(self, "position", x+dx, z+dz, a+da); //Move
     }
}

void dasher( float Vx, float Vy, float Vz )
{// Dash with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }

    changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move!
}

void leaper( float Vx, float Vy, float Vz )
{// Leap with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }

    tossentity(self, Vy, Vx, Vz); //Leap!
}

void mpcost( int Cost)
{// Spend some MP
    void self = getlocalvar("self");
    void MP = getentityproperty(self,"mp");

    changeentityproperty(self, "mp", MP-Cost); //Spend!
}

void limiter(int Limit)
{// Prevents hero from performing the animation if his/her MP is less than Limit
    void self = getlocalvar("self");
    void MP = getentityproperty(self,"mp"); //Get entity's MP.

   if(MP<=Limit) // Don't have enough MP?
   {
     setidle(self); //Don't play the animation.
   }
}

void clearL()
{// Clears all local variables
     clearlocalvar();
}

void keyint(void Ani, int Frame, void Key, int Hflag, int Limit)
{// Change current animation if proper key is pressed or released provided MP is more than limit

    void self = getlocalvar("self");
    void Health = getentityproperty(self,"health");
    void MP = getentityproperty(self,"mp");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void iRKey;

        if (Key=="U"){ //Up Required?
          iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
    }

        if (Key=="D"){ //Down Required?
          iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
    }

        if (Key=="J"){ //Jump Required?
          iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
    }

        if (Key=="A"){ //Attack Required?
          iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
    }

        if (Key=="S"){ //Special Required?
          iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
    }

        if (Key=="A2"){ //Attack2 Required?
          iRKey = playerkeys(iPIndex, 0, "attack2"); // "Attack2"
    }

        if (Key=="A3"){ //Attack3 Required?
          iRKey = playerkeys(iPIndex, 0, "attack3"); // "Attack3"
    }

        if (Key=="A4"){ //Attack4 Required?
          iRKey = playerkeys(iPIndex, 0, "attack4"); // "Attack4"
    }

        if (Hflag==1){ //Not holding the button case?
          iRKey = !iRKey; //Take the opposite condition
    }

      if ((MP > Limit) && iRKey){
        changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
        changeentityproperty(self, "animpos", Frame);
      }
}

void keyflip()
{// Change hero's facing direction if left or right is pressed
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index

    if (playerkeys(iPIndex, 0, "moveleft")){ // Left is pressed?
      changeentityproperty(self, "direction", 0); //Face left
    } else if (playerkeys(iPIndex, 0, "moveright")){ // Right is pressed?
      changeentityproperty(self, "direction", 1); //Face right
    }
}

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");
   void vShot;

   if (Direction == 0){ //Is entity facing left?                
      dx = -dx; //Reverse X direction to match facing
   }

   vShot = projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);
   return vShot;
}

void shooter(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting projectile with speed control
   void vShot = shoot(Shot, dx, dy, dz);

   changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
   changeentityproperty(vShot, "speed", Vx);
}

void keyshoot(void Shot, float dx, float dy, float dz, float Vx, float Vz)
{ // Shooting projectile with key based speed control
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void vShot = shoot(Shot, dx, dy, dz);

    if (playerkeys(iPIndex, 0, "moveup")){
      changeentityproperty(vShot, "velocity", Vx, -Vz);
    } else if (playerkeys(iPIndex, 0, "movedown")){
      changeentityproperty(vShot, "velocity", Vx, Vz);
    } else {
      changeentityproperty(vShot, "velocity", Vx, 0);
    }
    changeentityproperty(vShot, "speed", Vx);
}

void toss(void Bomb, float dx, float dy, float dz)
{ // Tossing bomb
   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 == 0){ //Is entity facing left?                
      dx = -dx; //Reverse X direction to match facing
   }

   projectile(Bomb, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
}

void spawn01(void vName, float fX, float fY, float fZ)
{
    //spawn01 (Generic spawner)
    //Damon Vaughn Caskey
    //07/06/2007
    //
    //Spawns entity next to caller.
    //
    //vName: Model name of entity to be spawned in.
    //fX: X location adjustment.
    //fY: Y location adjustment.
      //fZ: Z location adjustment.

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int  iDirection = getentityproperty(self, "direction");

    clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

    if (iDirection == 0){ //Is entity facing left?                
          fX = -fX; //Reverse X direction to match facing.
    }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
   
    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
    changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
   
    return vSpawn; //Return spawn.
}

void shooter2(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting special projectile with speed control
   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, dz);
   changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
   return vShot;
}
I see that the "spawn" script is in fact "spawn01", I suggest trying ro change it in your animation.
Other than that, I did a quick look and everything looks fine. Try to use other scripts to see if there's more than one not working.
I have similar scripts in my SORX, but everything is working fine so far.

Code:
void spawn01(void vName, float fX, float fY, float fZ)
 
Hmmm... :unsure:
Code:
anim    freespecial5
    hitflash    Flash2
    hitfx    data/sounds/Hit2.wav
    loop    0
    offset    61 137
    delay    6
    frame    Data/Chars/Shimo/Shimo_21-0.png
    frame    Data/Chars/Shimo/Shimo_21-1.png
    frame    Data/Chars/Shimo/Shimo_21-2.png
    frame    Data/Chars/Shimo/Shimo_21-3.png
    frame    Data/Chars/Shimo/Shimo_21-4.png
    @cmd    spawn "Kikosho" 0 0 0
    @cmd    shoot "Kikosho" 0 0 0
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png
    frame    Data/Chars/Shimo/Shimo_21-5.png
    frame    Data/Chars/Shimo/Shimo_21-6.png
    frame    Data/Chars/Shimo/Shimo_21-7.png

Is there any reason to declare two different functions to shoot one same projectile?

I agree with Kratus, that you should use spawn01 function instead. And use just one function.
 
I declared @cmd spawn because simply declaring @cmd shooter wasn't triggering the projectile. Didn't work, so...

Now, let's see...

bor - 0005.png
Declaring @cmd spawn01 together with @cmd shooter results in this.


FHR - 0002.png
Happening in Fighter's History Revenge as well. In here, Ray's supposed to shoot a projectile, but as soon as the inputs are done, here it is.
I didn't change anything in the code, just opened the game using the v4 build.
 
I tried with the 7735 (which I got here in the download page) and the 7533 (github) builds.
@ChrisFalconSTB I tested all your codes and created a projectile using exactly yours as reference. I was able to make it work using two solutions:

1) In your "shoot" script at the library, just make the changes below

Replace this
Code:
vShot = projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);

With this. The change is related to some minor fixes made in the projectile's v4 code.
Code:
vShot = projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 1, 0);

2) Just remove the fall animation. I need to investigate why it is occurring, but even after removing the whole header, the only thing that made an effect is the fall anim removal.

About the spawn01 script, just change the type from "npc" to "none" and it will solve the problem.

Tested in the v4 7612, I know that the 7533 will work but didn't test in the 7735.
 
Back
Top Bottom