Even if I exclude the legs, I want to detect the body and head.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.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?
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?Even if I exclude the legs, I want to detect the body and head.
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 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.
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
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);
}
}
anim spawn
@script
if(frame == 1){
void self = getlocalvar("self");
setentityvar(self, 2, 45); // height
setentityvar(self, 3, -10); // x adjustment
}
@end_script
...
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 tried entering 0 to 2 in 'int face', but there was no change.face parameter defines bindentity's parameter directly so what values have you tried in selfposition function and what is the result of each?
face parameter defines bindentity's parameter directly so what values have you tried in selfposition function and what is the result of each?

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);
}
}