Solved special move question.

Question that is answered or resolved.

DD Tokki

Well-known member
1694107931682.png
This screenshot is a special move.

Is there a way to fix the cut-in in Openbor to the center of the screen regardless of where the player character is, like the cut-in that appears when activating a special move in a fighting game?
 

See if this thread I made a while back helps you.
After my first reply I mention that I wanted the flash screen to follow me even if I move or teleported but still manage to be in the center of the screen.
 

See if this thread I made a while back helps you.
After my first reply I mention that I wanted the flash screen to follow me even if I move or teleported but still manage to be in the center of the screen.
thank you Let's create a cut-in and give it a try.
 
bor - 0054.png

bor - 0056.png

Cut-in was applied with spawn05. This has one drawback. On a fixed screen where the scrolling has stopped, it appears correctly, but on a wide stage that moves left and right, as you can see, it does not follow the screen and comes out at the end.
 
C:
void spawn02(void vName, float fX, float fY, float fZ)
{    //Spawns entity based on left screen edge
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
        //fZ: Z location adjustment

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
        int XPos = openborvariant("xpos"); //Get screen edge's x position
        int YPos = openborvariant("ypos"); //Get screen edge's y position

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

    vSpawn = spawn(); //Spawn in entity.
    changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY);
    return vSpawn; //Return spawn.
}

bor - 0001.png

I solved it myself. Using the "spawn02" script, the player stays stuck on the screen no matter where he moves.
 
C:
void spawn02(void vName, float fX, float fY, float fZ)
{    //Spawns entity based on left screen edge
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
        //fZ: Z location adjustment

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
        int XPos = openborvariant("xpos"); //Get screen edge's x position
        int YPos = openborvariant("ypos"); //Get screen edge's y position

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

    vSpawn = spawn(); //Spawn in entity.
    changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY);
    return vSpawn; //Return spawn.
}

View attachment 5168

I solved it myself. Using the "spawn02" script, the player stays stuck on the screen no matter where he moves.
looks phenomenal! what exact code ended up working for you?
 
looks phenomenal! what exact code ended up working for you?
When using the "spawn05" code, the coordinates of the level (stage) were fixed, so if the player moved, the position would pass by, but with "spawn02", the effect would be created at the left end of the screen even if the player moved.
 
This has one drawback. On a fixed screen where the scrolling has stopped, it appears correctly, but on a wide stage that moves left and right, as you can see, it does not follow the screen and comes out at the end.

Hmm... can I see your spawn05 function? the result sounds different than the one I have here.
 
Hmm... can I see your spawn05 function? the result sounds different than the one I have here.
C:
    loop    0
    energycost    106
    mponly    1
    delay    4
    offset    35 101
    @cmd    degravity    -0.5
    frame    data/sprites/sprite/chara/robert/sp-skill-b01.gif
    offset    35 109
    @cmd    spawn05 "robert-sp" 479 0 70
    @cmd    spawnbind "special" 0 76 1
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    delay    3
    offset    35 109
    sound    data/sounds/se/robert/vc-sp1.wav
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    @cmd    anichange "ANI_FOLLOW5"
    frame     none


The video is a scene where the “spawn05” script was applied and tested.

C:
    loop    0
    energycost    106
    mponly    1
    delay    4
    offset    35 101
    @cmd    degravity    -0.5
    frame    data/sprites/sprite/chara/robert/sp-skill-b01.gif
    offset    35 109
    @cmd    spawn02 "robert-sp" 479 0 70
    @cmd    spawnbind "special" 0 76 1
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    delay    3
    offset    35 109
    sound    data/sounds/se/robert/vc-sp1.wav
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 4
    drawmethod    tintcolor 255_255_255
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    drawmethod    tintmode 0
    drawmethod    tintcolor 0_0_0
    frame    data/sprites/sprite/chara/robert/sp-skill-b02.gif
    @cmd    anichange "ANI_FOLLOW5"
    frame     none


This time, this is a video where “spawn02” was applied and tested.

C:
void spawn05(void vName, int Tx, int Ty, int Tz)
{
    //Spawns entity based on level panel coordinate

        void self = getlocalvar("self");
        float x = getentityproperty(self, "x"); // Get entity's x coordinate
        float z = getentityproperty(self, "z"); // Get entity's z coordinate
    void vSpawn; //Spawn object.

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

        setlocalvar("x"+self, (Tx-x));
        setlocalvar("z"+self, (Tz-z));

    vSpawn = spawn(); //Spawn in entity.
    changeentityproperty(vSpawn, "position", Tx, Tz, Ty); //Set spawn location.
    return vSpawn; //Return spawn.
}

The “spawn05” I applied is like this. I'm uploading the script because I thought it might be different.
 
this is my spawn05, I think it's from @Bloodbane

C:
void spawn05(void vName, float fX, float fY, float fZ)
{
    //Spawns entity based on left screen edge and z axis
    //
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
      //fZ: Z coordinate

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int Direction = getentityproperty(self, "direction");
        int XPos = openborvariant("xpos"); //Get screen edge's position
        int Screen = openborvariant("hResolution"); // Get screen width

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

   if (Direction == 0){ //Is entity facing left?                 
      fX = Screen-fX; //Reverse X direction to match facing and screen length
   }

    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX + XPos, fZ, fY); //Set spawn location.
    return vSpawn; //Return spawn
 
this is my spawn05, I think it's from @Bloodbane

C:
void spawn05(void vName, float fX, float fY, float fZ)
{
    //Spawns entity based on left screen edge and z axis
    //
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
      //fZ: Z coordinate

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int Direction = getentityproperty(self, "direction");
        int XPos = openborvariant("xpos"); //Get screen edge's position
        int Screen = openborvariant("hResolution"); // Get screen width

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

   if (Direction == 0){ //Is entity facing left?               
      fX = Screen-fX; //Reverse X direction to match facing and screen length
   }

    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX + XPos, fZ, fY); //Set spawn location.
    return vSpawn; //Return spawn
bor - 0007.png

Thank you. The script I used had a completely different "spawn05" structure.
It works. The difference is that in the script you uploaded this time, the coordinates are in the middle rather than at the end, so I adjusted it and it worked.
 
Last edited:
Back
Top Bottom