SP meter script (Tech Demo)

you already know how to use spawnframe to spawn a custom entity. rather then having one entity with 22 freespecials why not have 22 different enemies with names relative to their attacks that way you can control who to spawn for what attack.
 
I'm sorry I wasn't clear of what I've tried to describe.
The freespecial skills are already created for characters (for players).
Since the characters (for players) already have all these freespecial skills, I would like to find a way to execute these freespecial skills from different characters. This way I won't have to create same freespecials and load them.
Maybe something like
@cmd /Ryu/freespecial22. This won't work for sure. I'm just giving you an idea of what I'm thinking about. I hope it makes sense lol.

Thank you
 
There is no way to do that but if you reference the same sprites for 2 moves the sprites will only be loaded once.
 
There is no way to do that but if you reference the same sprites for 2 moves the sprites will only be loaded once.
Just to elaborate - don't try to get cute with optimizing. The engine already does most of this for you. One example is cutting sprites. Don't try to cut sprites individually like you would for Mugen. OpenBOR does this automatically on load, so all you'll accomplish is wasting your own time.

There are of course lots of ways you can optimize, but its a good idea to consult us first so you don't spend your time doing something pointless.

DC
 
There is no way to do that but if you reference the same sprites for 2 moves the sprites will only be loaded once.
I created a new skill with the same sprites and loaded, everything is working fine except the skill animation remains on the screen and never disappears, in addition, the attackbox keeps on attacking the enemies that get inside its range.
Maybe it has to do with subtype NPC...
and only had
Anim idle
.....
.....


Thank you
 
Add this to the last line of animation

@cmd killentity getlocalvar("self")
Code:
anim    freespecial5  
    @cmd costsp 5 "ANI_freespecial9"
    @cmd shadow 5 20 120 6 2   255 0 255  # Magenta
    landframe 1
    loop    0
    offset    476 354
    bbox    0 0 0 0
    spawnframe 1 360 0 -780 0  #spawnframe {frame} {x}{z}{y}{relative}                                
    subentity SuperPower_G_SP   
    delay   5
    frame    data/chars/players/Ty/land01.gif
    delay   10
    frame    data/chars/players/Ty/stance01.gif
    frame    data/chars/players/Ty/stance02.gif   
    frame    data/chars/players/Ty/stance03.gif   
    frame    data/chars/players/Ty/stance04.gif   
    frame    data/chars/players/Ty/stance05.gif   
    frame    data/chars/players/Ty/stance06.gif
    delay   20
    frame    data/chars/players/Ty/stance06.gif   
    delay   5
    frame    data/chars/players/Ty/stance05.gif
    frame    data/chars/players/Ty/stance04.gif   
    frame    data/chars/players/Ty/stance03.gif   
    delay   10
    frame    data/chars/players/Ty/land01.gif   




name          SuperPower_G_SP
health        1
nolife        1
type        npc
hostile        enemy npc obstacle shot
candamage    enemy npc obstacle shot
speed        0
remove        0
nomove        1
noquake        1
falldie        2
subtype        flydie
gfxshadow     1 3
flash         flash
bflash         guard
dust        dust

palette data/chars/players/Vice/throwforward05.gif #1


anim    idle
    hitflash    hitspark
    hitfx        data/sounds/beat3.wav
    fastattack    1
    attackone    0
    loop    0
    bbox    0 0 0 0
    offset    476 354
    delay 3
    frame    data/chars/players/Vice/throwforward01.gif
    frame    data/chars/players/Vice/throwforward02.gif
    frame    data/chars/players/Vice/throwforward03.gif
    attack12    193 45 615 479  0  1 100 1 30 30
    dropv    2  1
    delay 5
    frame    data/chars/players/Vice/throwforward04.gif
    frame    data/chars/players/Vice/throwforward05.gif
    frame    data/chars/players/Vice/throwforward06.gif
    frame    data/chars/players/Vice/throwforward07.gif
    frame    data/chars/players/Vice/throwforward08.gif
    @cmd    projectile 1 "SuperPower_G" 0 0 0
    @cmd    projectile 1 "dust03" 0 0 0
    frame    data/chars/players/Vice/throwforward09.gif
    delay 10
    frame    data/chars/players/Vice/throwforward09.gif
    @cmd killentity getlocalvar("self")


I just added killentity but no luck. The entity does its skill and remains on the screen.
lifespan seems to work but I have to edit the time over and over until it disappears right after the skill.
I don't like using this lifespan to solve this problem. I also added death animation with this lifespan, but death animation is not working for some reasons...
I am sure there must be something wrong with my code, and it needs to be fixed instead of using the lifespan
Thank you
 
Last edited:
You need to have a frame after any @cmd command for them to work.

frame data/chars/players/Vice/throwforward09.gif
@cmd killentity getlocalvar("self")
frame none #adding this line will fix it.
 
Code:
    //KEYSCRIPTS
    void ani = getentityproperty(self,"animationid");
        if (ani == openborconstant("ANI_IDLE") || ani == openborconstant("ANI_WALK") || ani == openborconstant("ANI_ATTACK1") )
            {// these are the animations that can be canceled
                sp_atk("freespecial10",3,"a3"); //if you press forward and attack when you have 10SP or more perform freespecial

By default this keyscript only allows cancel into the SP_atk. Is it possible to alter this to make it cancel at any time as long as I have enough SP?
 
Yes just remove the if conditions.

C-like:
//KEYSCRIPTS    

 sp_atk("freespecial10",3,"a3"); //if you press forward and attack when you have 10SP or more perform freespecial

But if using in a keyscript file then you can cancel any animation even cutscene, death, falling or even grapples. So it could break your game so be careful.
 
Yes just remove the if conditions.

C-like:
//KEYSCRIPTS   

 sp_atk("freespecial10",3,"a3"); //if you press forward and attack when you have 10SP or more perform freespecial

But if using in a keyscript file then you can cancel any animation even cutscene, death, falling or even grapples. So it could break your game so be careful.
Cool I did that, there's a few situations I dont want it to trigger, is there a way to do IF NOT?
 
Cool I did that, there's a few situations I dont want it to trigger, is there a way to do IF NOT?

Add a condition, but use the NOT operator. Like this:

C:
if (ani != openborconstant("ANI_IDLE"))
{
     // Do this if the animation is NOT idle.
}

You can also use the NOT operator to check if some value is blank or 0.

C:
int my_int = 0;

if (!my_int)
{
     // Do this if my_int is 0 or has no value at all (like NULL).
}

HTH,
DC
 
Seems stright forward just have a bunch of freespecials each one uses spawnframe to bring out different striker (thats what they are called in kof) characters.
 
Back
Top Bottom