Solved Slam height question.

Question that is answered or resolved.

DD Tokki

Well-known member
1708684636087.png

When the player character catches an opponent, is it possible to make the player's catch different when there is a difference in height like A, B, C?
 
  • Like
Reactions: NED
It's very possible to detect specific target's height in pixels for grab, but how do you want the player to interact and grab the head according to the concept and height?
I think it's necessary to make it feel like the player is climbing up and clinging to the opponent.
For example, it detects height like Choi or Sakura Kasugano's Throw.
 
Even if I exclude the legs, I want to detect the body and head.
OK. So, two parts then. The head and the body. Even the legs are gonna become part of the body itself for grabs. For the legs, do you want them to be ungrabbed or get grabbed along with the body itself?

I think it's necessary to make it feel like the player is climbing up and clinging to the opponent.
For example, it detects height like Choi or Sakura Kasugano's Throw.
Ah! Two parts again then. It's all about height detection, right? Isn't it like Choi grabs opponents by the legs and/or body, while Sakura grabs by the head for throwing?

I cannot remember the link where @Piccolo made a body detection script and shared around here long time ago. But I do have it which I learned about body detection in script. This one has script to be detected of getting hurt in specific ways.
 

Attachments

Last edited:
In this test, I know that it blinks red when hitting with Attack 1 or 2, but I would like to know more about how it is connected to the slam (grab) and how to use it.
When using the grab(slamstart) function, the goal is for the player's catch position to vary depending on the enemy's height.
 
Last edited:
I set enemy's height and width in enemy's entity variables for Rise of Warduke. This is for Shannon's backgrab in which she literally backstabs enemy while latching on the enemy's back. Rise of Warduke's enemies are varied from short enemies such goblins and kobolds to tall enemies such as demons, that's why these variables are needed.
Back to topic, at the start of backstab Shannon adjust her position relative to enemy's using the latter's height and width.
This is her Backstab move:
Code:
anim follow25 # Backstab
    delay    1
    landframe 12
    offset  220 166
    frame    data/chars/thief/jf00.gif
    delay    15
    offset  220 161
    @cmd    stealth 300
    @cmd    slamstart
    @cmd    selfposition 120 0 1
    frame    data/chars/thief/backstab1.gif
    delay    25
    frame    data/chars/thief/backstab2.gif
    delay    5
    frame    data/chars/thief/backstab3.gif
    @cmd    hurt 16
    sound    data/sounds/dagger.wav
    frame    data/chars/thief/backstab4.gif #
    delay    25
    frame    data/chars/thief/backstab2.gif
    delay    5
    frame    data/chars/thief/backstab3.gif
    @cmd    hurt 17
    sound    data/sounds/dagger.wav
    frame    data/chars/thief/backstab4.gif #
    delay    25
    frame    data/chars/thief/backstab2.gif
    delay    5
    frame    data/chars/thief/backstab3.gif
    @cmd    hurt 17
    sound    data/sounds/dagger.wav
    frame    data/chars/thief/backstab4.gif #
    delay    400
    offset  220 166
    @cmd    depost 0
    @cmd    finish 15 2 2 0 0
    @cmd    leaper -1 2 0
    frame    data/chars/thief/jf05.gif
    delay    10
    @cmd    stealth 0
    bbox    208 106 32 61
    sound data/chars/thief/sounds/land.wav
    frame    data/chars/thief/jlan00.gif
    frame    data/chars/thief/jlan01.gif

This is selfposition function:
C:
void selfposition(int Time, int Frame, int face)
{// Position self based on opponent's settings
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
      int Tx = getentityproperty(target, "x");
      int y = getentityvar(target, 2);
      int x = getentityvar(target, 3);

      if(Direction == 1){                
        changeentityproperty(target, "direction", 1);
        changeentityproperty(self, "position", Tx+x, NULL(), y);
      } else {
        changeentityproperty(target, "direction", 0);
        changeentityproperty(self, "position", Tx-x, NULL(), y);
      }

      floater(Time);
      updateframe(target, Frame);
      bindentity(target, self, -x, 1, 5-y, face, 0);
   }
}

Oh yes, each backstabable enemy has this script in their SPAWN animation:
Code:
anim spawn
@script
    if(frame == 1){
      void self = getlocalvar("self");

      setentityvar(self, 2, 45); // height
      setentityvar(self, 3, -10); // x adjustment
    }
@end_script
...

I know it's complex but it's how it's done in Rise of Warduke.
 
I set enemy's height and width in enemy's entity variables for Rise of Warduke. This is for Shannon's backgrab in which she literally backstabs enemy while latching on the enemy's back. Rise of Warduke's enemies are varied from short enemies such goblins and kobolds to tall enemies such as demons, that's why these variables are needed.
Back to topic, at the start of backstab Shannon adjust her position relative to enemy's using the latter's height and width.
This is her Backstab move:
Code:
anim follow25 # Backstab
    delay    1
    landframe 12
    offset  220 166
    frame    data/chars/thief/jf00.gif
    delay    15
    offset  220 161
    @cmd    stealth 300
    @cmd    slamstart
    @cmd    selfposition 120 0 1
    frame    data/chars/thief/backstab1.gif
    delay    25
    frame    data/chars/thief/backstab2.gif
    delay    5
    frame    data/chars/thief/backstab3.gif
    @cmd    hurt 16
    sound    data/sounds/dagger.wav
    frame    data/chars/thief/backstab4.gif #
    delay    25
    frame    data/chars/thief/backstab2.gif
    delay    5
    frame    data/chars/thief/backstab3.gif
    @cmd    hurt 17
    sound    data/sounds/dagger.wav
    frame    data/chars/thief/backstab4.gif #
    delay    25
    frame    data/chars/thief/backstab2.gif
    delay    5
    frame    data/chars/thief/backstab3.gif
    @cmd    hurt 17
    sound    data/sounds/dagger.wav
    frame    data/chars/thief/backstab4.gif #
    delay    400
    offset  220 166
    @cmd    depost 0
    @cmd    finish 15 2 2 0 0
    @cmd    leaper -1 2 0
    frame    data/chars/thief/jf05.gif
    delay    10
    @cmd    stealth 0
    bbox    208 106 32 61
    sound data/chars/thief/sounds/land.wav
    frame    data/chars/thief/jlan00.gif
    frame    data/chars/thief/jlan01.gif

This is selfposition function:
C:
void selfposition(int Time, int Frame, int face)
{// Position self based on opponent's settings
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
      int Tx = getentityproperty(target, "x");
      int y = getentityvar(target, 2);
      int x = getentityvar(target, 3);

      if(Direction == 1){               
        changeentityproperty(target, "direction", 1);
        changeentityproperty(self, "position", Tx+x, NULL(), y);
      } else {
        changeentityproperty(target, "direction", 0);
        changeentityproperty(self, "position", Tx-x, NULL(), y);
      }

      floater(Time);
      updateframe(target, Frame);
      bindentity(target, self, -x, 1, 5-y, face, 0);
   }
}

Oh yes, each backstabable enemy has this script in their SPAWN animation:
Code:
anim spawn
@script
    if(frame == 1){
      void self = getlocalvar("self");

      setentityvar(self, 2, 45); // height
      setentityvar(self, 3, -10); // x adjustment
    }
@end_script
...

I know it's complex but it's how it's done in Rise of Warduke.
KoR - 0011.pngKoR - 0012.png

The player's position was successfully moved depending on the opponent's height.
However, the captured opponent keeps turning his back.
void selfposition(int Time, int Frame, int face)
I tried to adjust the direction with 'int face', but it didn't work.
 
face parameter defines bindentity's parameter directly so what values have you tried in selfposition function and what is the result of each?
KoR - 0016.png

I found the cause.
There is a command in the script that forces the direction to change.

C:
void selfposition(int Time, int Frame, int face)
{// Position self based on opponent's settings
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
      int Tx = getentityproperty(target, "x");
      int y = getentityvar(target, 2);
      int x = getentityvar(target, 3);

      if(Direction == 1){              
        changeentityproperty(target, "direction", 1);
        changeentityproperty(self, "position", Tx+x, NULL(), y);
      } else {
        changeentityproperty(target, "direction", 0);
        changeentityproperty(self, "position", Tx-x, NULL(), y);
      }

      floater(Time);
      updateframe(target, Frame);
      bindentity(target, self, -x, 1, 5-y, face, 0);
   }
}

if(Direction == 1){
By changing '1' to '0', the phenomenon of enemies showing their backs has disappeared.

The structure of the script seems to have been like that because Dungeons & Dragons' character settings focus on the enemy's back.
 
Back
Top Bottom