backpain script question.

DD Tokki

Well-known member

Here's what's in the link.
I'm trying to apply the backpain script to my game, but when I try to learn how to do it and apply it, I get this error message.


Script error: data/scripts/backpain.c, line 24: Unknown error '.' (in production 'log_and_expr')

if ( anim_id == openborconstant("ANI_DIE") || .. ... .. ) {
^


I wonder if I applied it wrong, and I want to fix the error.
 
Well, you can't type .... in a script. Try removing it like this:
C:
if(anim_id == openborconstant("ANI_DIE")) {

I deleted "... ..." from the script and got the following problem:

Command 'backpain' not understood in file 'data/chars/kula/kula.txt'!

Script compile error in 'updateentityscript': self line 2, column 19

********** An Error Occurred **********
* Shutting Down *

Can't compile script 'updateentityscript' data/chars/kula/kula.txt
 
There must be a script in Kula's update script which is missing self.
The backpain I wanted to complete with a script seems to be "backpain 1" applied to the header, which is what I wanted.

When I tested it on Beats of Rage, "backpain 1" gave me the result I wanted.

However, in King of Rage, there is a bug or setting that moves in the opposite direction, so the progress may be delayed for a while until it is fixed.
 
C:
anim    attack1
    rangea    0 110
    range    40 76
    loop    0
    fastattack    1
    forcedirection    -1
    jugglecost    5
    delay    1
    offset    24 101
    bbox    2 0 45 97
    attack    0 0 0 0 0 0 0 0 0 0
    @cmd    degravity    -0.5
    frame    data/sprites/chara/en/st00/e00vn/attack-a01.gif
    delay       2
    attack    9999 9999 10 10 0 0 0 0 0 0
    frame    data/sprites/chara/en/st00/e00vn/attack-a01.gif
    delay    3
    offset    24 102
    bbox    10 0 45 98
    sound    data/sounds/misc/attack1.wav
    attack    29 -2 66 45 9 0 0 0 0 16
    hitflash    flash-middle
    hitfx    data/sounds/misc/flash-punch1.wav
    dropv    2.4 1 0
    frame    data/sprites/chara/en/st00/e00vn/attack-a02.gif
    offset    25 102
    bbox    3 0 45 98
    attack    0 0 0 0 0 0 0 0 0 0
    frame    data/sprites/chara/en/st00/e00vn/attack-a03.gif
    offset    25 102
    bbox    1 0 45 98
    frame    data/sprites/chara/en/st00/e00vn/attack-a04.gif
    delay       9
    offset    24 102
    bbox    1 0 45 98
    frame    data/sprites/chara/en/st00/e00vn/attack-a05.gif


I found out the cause.
All of the character's attacks had "forcedirection -1" set, so when I set backpain, I would fall in the opposite direction.
 
C:
void slamGrab()
{ // Slam Starter for nongrab slams
// Use finish or throw after using this
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);


   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     damageentity(target, self, 0, 1, openborconstant("ATK_NORMAL102")); // Slam Starter
   }
}

The problem with enemies or player characters attacking from behind has been resolved.

The problem is that, as shown in the video, enemies use slam script to grab attacks, but grabbing forward is normal, and grabbing backward is the player's random movement.

I want to change this so that even if you attack from behind, you grab forward.
 
I'm asking for a solution to a game issue and it's taking too long for an answer to come.
I was originally going to wait while I worked on other parts, but I'm waiting because I'll reflect the fix when it's resolved anyway.
 
Can you post your enemies grab attack? I'm having a difficult time understanding how you are animating the player while being grabbed and attacked.
 
Can you post your enemies grab attack? I'm having a difficult time understanding how you are animating the player while being grabbed and attacked.

C:
anim    freespecial
    rangea    0 1
    range    0 40
    loop    0
    fastattack    1
    delay    1
    offset    35 95
    attack3    40 20 30 30 0 0 1 1 0 20
    followanim    1
    followcond    2
    @cmd    degravity    -0.5
    frame    data/sprites/chara/en/st00/e00vn/grab.gif
        
anim    follow
@script
    void self = getlocalvar("self");

    if(frame==0){
      changelevelproperty("scrollspeed", 0);
    }

    if(frame==19){
      changelevelproperty("scrollspeed", 1);
    }
    @end_script
    loop    0
    delay    60
    offset    32 95
    sound    data/sounds/misc/grab.wav
    @cmd    degravity    -0.5
    @cmd    slamGrab
    @cmd    position 14 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-01.gif
    delay    16
    offset    31 95
    sound    data/sounds/misc/Flash-ranbusp1.wav
    @cmd    shoot "Flash-middle" 21 71 1
    @cmd    hurtGrab 9
    @cmd    position 15 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-02.gif
    delay       5
    offset    31 96
    @cmd    position 15 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-03.gif
    offset    32 95
    @cmd    position 14 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-01.gif
    delay    16
    offset    31 95
    sound    data/sounds/misc/Flash-ranbusp1.wav
    @cmd    shoot "Flash-middle" 21 71 1
    @cmd    hurtGrab 9
    @cmd    position 15 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-02.gif
    delay       5
    offset    31 96
    @cmd    position 15 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-03.gif
    offset    32 95
    @cmd    position 14 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-01.gif
    delay    16
    offset    31 95
    sound    data/sounds/misc/Flash-ranbusp1.wav
    @cmd    shoot "Flash-middle" 21 71 1
    @cmd    hurtGrab 9
    @cmd    position 15 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-02.gif
    delay       5
    offset    31 96
    @cmd    position 15 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-03.gif
    offset    32 95
    @cmd    position 14 25 5 0 1
    frame    data/sprites/chara/en/st00/e00vn/grab-attack-01.gif
    delay       3
    offset    23 118
    sound    data/sounds/misc/Flash-finish1.wav
    @cmd    position 15 25 10 0 1
    @cmd    anti
    @cmd    shoot "Flash-strong" 38 87 1
    @cmd    hurtGrab 11
    @cmd    depost 0
    @cmd    throwP 1 4 -4 5 0 0
    @cmd    dasher 3 0 0
    frame    data/sprites/chara/en/st00/e00vn/attack-c04.gif
    offset    24 110
    @cmd    stop
    @cmd    clearL
    frame    data/sprites/chara/en/st00/e00vn/attack-c05.gif
    offset    24 109
    frame    data/sprites/chara/en/st00/e00vn/attack-c06.gif
    offset    23 108
    frame    data/sprites/chara/en/st00/e00vn/attack-c07.gif
    delay    30
    offset    21 108
    frame    data/sprites/chara/en/st00/e00vn/attack-c08.gif
    delay       5
    offset    19 105
    @cmd    dasher 2 0 0
    frame    data/sprites/chara/en/st00/e00vn/attack-c09.gif
    offset    11 103
    frame    data/sprites/chara/en/st00/e00vn/attack-c10.gif
    offset    17 106
    frame    data/sprites/chara/en/st00/e00vn/attack-c11.gif
    offset    22 105
    @cmd    stop
    frame    data/sprites/chara/en/st00/e00vn/attack-c12.gif
    delay    20
    offset    21 105
    bbox    -1 0 45 101
    frame    data/sprites/chara/en/st00/e00vn/idle-01.gif

This is Vanessa's grab in this video. When she grabs forward, it's normal, but when she grabs backward, the player's movements become strange.
 
At a guess I would say your @position CMD is not correct when facing,

You'll have to make sure the script always forces the target to face the same way as the entity,

Maybe for these particular throws you should write a second @cmd position script to always make sure they face eachother and is only activated when the player is facing his back to the enemy entity.
 
At a guess I would say your @position CMD is not correct when facing,

You'll have to make sure the script always forces the target to face the same way as the entity,

Maybe for these particular throws you should write a second @cmd position script to always make sure they face eachother and is only activated when the player is facing his back to the enemy entity.
This grab properly grabs the character from behind when it's not "backpain 1".

However, when it's "backpain 1", the fall motion appears as if the motion of grabbing the character from behind is missing.

So I want an effect where the opponent is grabbed from behind or another method.

Among the things you mentioned, I think it's a good idea to force the character's direction to face.
 
Back
Top Bottom