"Grabber" entities to fix Binding problems on Older module script?

oldyz

Well-known member
hello, i had crazy idea that would "dinamically" fix or unbind any buggy grabs, throws or body slams on night slashers that where "created" by the new engine....

some time ago i told DC that i would like the arms of characters to have a "3D" /multilayer effect when doing some grabs or throws, so spawnbind seems to do the job well, so i was thinking might as well use the arm entities and take advantage of some of spawnbind's functions or features to fix some "grab" problems in the module too...

i was thinking on using spawnbind script's ability to "kill" the entity if frames don't match, and so, if a grab is not successful for any reason, with some characters,
like dracula here:
, the grab animation would be cancelled and the "Sitcky" bug would not happen...

so during Jake's slam suplex animaton, a spawnbind "jake arms" entitiy would appear and contain the commands for the slam, if anything goes wrong during the suplex animation, the "jake arms" entitiy should dissppear and let go of the dracula automatically...

well turns out that the "jake arms" entitiy appears , but the commands do nothing to Dracula or any other character...
at fhis point , i think spawnbind seems to use visual attributes only, if the spawnbinded entity has attack boxes or commands on the animation, they don't seem to work.

here is jake's modified script for the suplex:

Code:
## 2023 suplex to back ###    
anim    grabbackward
@cmd spawnbind    "jackarms"    0    0    0    1    6
    offset    72 140
    delay    15
    attackone    1
    bbox    0 0 0 0


    frame    data/chars/jack/b1

    sound    data/sounds/n/jkuoo.wav

    frame    data/chars/jack/052        #b2

    frame    data/chars/jack/b3
    delay    30

    frame    data/chars/jack/b4
    delay    20
    frame    data/chars/jack/104
    frame    data/chars/jack/105
    frame    data/chars/jack/106

the jake arms entity code:

Code:
name    Jackarms
health    100
mp 100
speed    10
grabwalk 9
mprate 1
nolife 1
chargerate 2
type    trap
shadow    3
makeinv 4
running  20 4 2 1 0
throw    2 4
grabdistance 24
bflash flashf
thold 1
noquake 1
throwdamage    20
atchain 1 2 3 4
gfxshadow 1
jumpheight 4
bounce 1
weapons jack2 jack3 jack4 jack5 jack6 jack7 jack8 jack12 jack10 jack11 jack202 Jack






icon data/chars/jack/icon
animationscript data/scripts/player.c
 

dust dust
nodieblink 1
height  109 ## new 2023
diesound data/sounds/n/jkdie.wav
projectilehit enemy obstacle npc
candamage enemy npc obstacle
palette data/chars/misc/z1



## 2023 suplex to back ###    
anim    grabbackward
    offset    72 140
    delay    15
    attackone    1
    bbox    0 0 0 0
    @cmd    ani002 "ANI_GRABBED" 0
    @cmd    anti
    @cmd    position 0 38 0 -1 1
    frame    data/chars/jack/b1
    @cmd    hurt 0 7
    sound    data/sounds/n/jkuoo.wav
    @cmd    position 0 30 10 -1 1
    frame    data/chars/jack/052        #b2
    @cmd    hurt 0 7
    @cmd    position 1 -10 65 -1 1
    frame    data/chars/jack/b3
    delay    30
    @cmd    hurt 0 7
    @cmd    position 1 -10 30 -1 1
    @cmd    depost 0
    @cmd    throw 25 3 -2 2 0 0
    frame    data/chars/jack/b4
    delay    20
    frame    data/chars/jack/104
    frame    data/chars/jack/105
    frame    data/chars/jack/106

the jakcarms entity has been tested as enemy, npc, trap (if i set it as player it crashes the engine)
 
Last edited:
hello, i had crazy idea that would "dinamically" fix or unbind any buggy grabs, throws or body slams on night slashers that where "created" by the new engine....

some time ago i told DC that i would like the arms of characters to have a "3D" /multilayer effect when doing some grabs or throws, so spawnbind seems to do the job well, so i was thinking might as well use the arm entities and take advantage of some of spawnbind's functions or features to fix some "grab" problems in the module too...

i was thinking on using spawnbind script's ability to "kill" the entity if frames don't match, and so, if a grab is not successful for any reason, with some characters,
like dracula here:
, the grab animation would be cancelled and the "Sitcky" bug would not happen...

so during Jake's slam suplex animaton, a spawnbind "jake arms" entitiy would appear and contain the commands for the slam, if anything goes wrong during the suplex animation, the "jake arms" entitiy should dissppear and let go of the dracula automatically...

well turns out that the "jake arms" entitiy appears , but the commands do nothing to Dracula or any other character...
at fhis point , i think spawnbind seems to use visual attributes only, if the spawnbinded entity has attack boxes or commands on the animation, they don't seem to work.

here is jake's modified script for the suplex:

Code:
## 2023 suplex to back ###    
anim    grabbackward
@cmd spawnbind    "jackarms"    0    0    0    1    6
    offset    72 140
    delay    15
    attackone    1
    bbox    0 0 0 0


    frame    data/chars/jack/b1

    sound    data/sounds/n/jkuoo.wav

    frame    data/chars/jack/052        #b2

    frame    data/chars/jack/b3
    delay    30

    frame    data/chars/jack/b4
    delay    20
    frame    data/chars/jack/104
    frame    data/chars/jack/105
    frame    data/chars/jack/106

the jake arms entity code:

Code:
name    Jackarms
health    100
mp 100
speed    10
grabwalk 9
mprate 1
nolife 1
chargerate 2
type    trap
shadow    3
makeinv 4
running  20 4 2 1 0
throw    2 4
grabdistance 24
bflash flashf
thold 1
noquake 1
throwdamage    20
atchain 1 2 3 4
gfxshadow 1
jumpheight 4
bounce 1
weapons jack2 jack3 jack4 jack5 jack6 jack7 jack8 jack12 jack10 jack11 jack202 Jack






icon data/chars/jack/icon
animationscript data/scripts/player.c
 

dust dust
nodieblink 1
height  109 ## new 2023
diesound data/sounds/n/jkdie.wav
projectilehit enemy obstacle npc
candamage enemy npc obstacle
palette data/chars/misc/z1



## 2023 suplex to back ###    
anim    grabbackward
    offset    72 140
    delay    15
    attackone    1
    bbox    0 0 0 0
    @cmd    ani002 "ANI_GRABBED" 0
    @cmd    anti
    @cmd    position 0 38 0 -1 1
    frame    data/chars/jack/b1
    @cmd    hurt 0 7
    sound    data/sounds/n/jkuoo.wav
    @cmd    position 0 30 10 -1 1
    frame    data/chars/jack/052        #b2
    @cmd    hurt 0 7
    @cmd    position 1 -10 65 -1 1
    frame    data/chars/jack/b3
    delay    30
    @cmd    hurt 0 7
    @cmd    position 1 -10 30 -1 1
    @cmd    depost 0
    @cmd    throw 25 3 -2 2 0 0
    frame    data/chars/jack/b4
    delay    20
    frame    data/chars/jack/104
    frame    data/chars/jack/105
    frame    data/chars/jack/106

the jakcarms entity has been tested as enemy, npc, trap (if i set it as player it crashes the engine)
I see you are using scripted grabs but where are the @cmd slamstart? This step is necessary to save the grabbed opponent into a variable and then control all the effects applied to him.

Another question is about Dracula, why is he attacking during the scripted grab? He's supposed to be frozen in the fall7 animation, I believe it's due to the missing @cmd slamstart which applies this animation to him...

fix or unbind any buggy grabs, throws or body slams on night slashers that where "created" by the new engine....
I didn't understand this part... Buggy grabs "created" by the engine?

@cmd ani002 "ANI_GRABBED" 0
@cmd anti
@cmd hurt 0 7
What these three functions do?
 
I didn't understand this part... Buggy grabs "created" by the engine?
Yes, the original 2008 game uses an older version of the engine and
for example:
the Dracula vs Suplex issue does not happen.
for some reason those old scripts are no longer working reliably.
- i can't remember if i gave you a copy of an edited 2008 nightslashers module , where you can test and see that if you use the old.exe, the bug does not exist, but if you use the newest or your own custom versions, the bug is present.

the point is, I actually like the fact that some entities , like Dracula , can somehow escape the the suplex moves
so by using another entity as the attacker,/grabber, i thought that if the animation does not complete, Dracula or any rebellious entity can potentially escape the grip , interrupt the grab/throw, slam -etc and not get stuck...
I see you are using scripted grabs but where are the @cmd slamstart? This step is necessary to save the grabbed opponent into a variable and then control all the effects applied to him.
at this moment i am comparing similar moves on other characters -
so far i have noticed that christopher does not seem to have any issues with his throws and grabs, and i will make sure to see if he features "grabstart" -

i think that Bonus JZ prgrammed Jake first before all other characters, that is whjy he may have the issues...
 
What these three functions do?
no clue about this one, chris does not use it at all

}void ani002(void vAni, int iFrame){
void vSelf = getlocalvar("self");
void vTarget = getentityproperty(vSelf, "opponent");
changeentityproperty(vTarget, "animation", openborconstant(vAni));
changeentityproperty(vTarget, "animpos", iFrame);

here is anti:
}void anti(){
void self = getlocalvar("self");
void target = getlocalvar("Target" + self);
if(target==NULL()){
changeentityproperty(target, "attacking", 0);
target = getentityproperty(self, "grabbing");
setlocalvar("Target" + self, target);
}if(target!=NULL()){
changeentityproperty(target, "attacking", 1);
tossentity(target, 0, 0, 0);
}
noitce that anti finishes with this "}" symbol unlike ani002

here is hurt:
}void hurt(int Damage, int AtNumber){
void self = getlocalvar("self");
void target = getlocalvar("Target" + self);
if(target==NULL()){
target = getentityproperty(self, "grabbing");
setlocalvar("Target" + self, target);
}if(target!=NULL()){
if(AtNumber==1){
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL"));
}if(AtNumber==7){
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL7"));
}if(AtNumber==8){
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL8"));
}
}

i noticed that chris does not use ani002 on his throws or slams here is ani001:

}void ani001(void vAni, int iFrame){
void vSelf = getlocalvar("self");
changeentityproperty(vSelf, "animation", openborconstant(vAni));
changeentityproperty(vSelf, "animpos", iFrame);
 
here is a comparison,

Jake's jumping suplex to the back
grab+back+jump
(this move also gets the bug too)
Code:
### jumping suplex to back - grab+back+jump ####       
anim    freespecial27
    offset    72 140
    delay    20
    jumpframe    1 3 -1 0
    attackone    1
    landframe    5
    quakeframe    5 3 -3
    bbox    0 0 0 0
    @cmd    anti
    @cmd    position 0 38 0 -1 1
    frame    data/chars/jack/b1
    @cmd    hurt 0 7
    sound    data/sounds/n/jkuoo.wav
    @cmd    position 0 30 10 -1 1
    frame    data/chars/jack/b2
    delay    10
    @cmd    hurt 0 7
    @cmd    position 1 -10 65 -1 1
    frame    data/chars/jack/b3
    @cmd    hurt 0 7
    @cmd    position 1 -10 65 -1 1
    frame    data/chars/jack/b3
    @cmd    hurt 0 7
    delay    1000
    @cmd    position 1 -10 65 -1 1
    frame    data/chars/jack/b3
    @cmd    hurt 0 8
    delay    10
    @cmd    position 0 -45 0 -1 -1
    @cmd    shoot "slamfl" -45 0 1
    @cmd    shoot "dust" -20 1 0
    sound    data/sounds/bigfal.wav
    frame    data/chars/jack/b4
    @cmd    hurt 0 8
    @cmd    position 0 -45 0 -1 -1
    frame    data/chars/jack/b4
    @cmd    hurt 0 8
    @cmd    position 0 -45 0 -1 -1
    frame    data/chars/jack/b4
    @cmd    depost 0
    delay    30
    @cmd    finish 50 3 2 2 0 1
    frame    data/chars/jack/b4
    delay    10
    frame    data/chars/jack/104
    frame    data/chars/jack/105
    frame    data/chars/jack/106

and here is Christopher's similar move, no bugs

Code:
    ###  backwards slam - grab+back+jump ### 2023   
anim    freespecial27
    offset    72 140
    delay    30
    jumpframe    0 4 -1 0
    attackone    1
    landframe    7
    quakeframe    7 3 -3
    bbox    0 0 0 0
    @cmd    anti
    @cmd    position 0 28 10 -1 1
    frame    data/chars/chris/128
    delay    10
    @cmd    hurt 0 7
    sound    data/sounds/huaa.wav
    @cmd    position 1 0 50 -1 1
    frame    data/chars/chris/127
    @cmd    hurt 0 7
    @cmd    position 1 0 50 -1 1
    frame    data/chars/chris/127
    offset    63 140
    @cmd    hurt 0 8
    @cmd    position 0 -30 30 -1 -1
    frame    data/chars/chris/126
    offset    63 130
    @cmd    hurt 0 8
    @cmd    position 0 -30 20 -1 -1
    frame    data/chars/chris/126
    offset    63 120
    @cmd    hurt 0 8
    @cmd    position 0 -30 10 -1 -1
    frame    data/chars/chris/126
    offset    63 110
    delay    1000
    @cmd    hurt 0 8
    @cmd    position 0 -30 0 -1 -1
    frame    data/chars/chris/126
    @cmd    hurt 0 8
    @cmd    position 0 -30 0 -1 -1
    delay    10
    @cmd    shoot "slamfl" 0 15 1
    @cmd    shoot "dust" 0 1 0
    sound    data/sounds/bigfal.wav
    frame    data/chars/chris/126
    @cmd    hurt 0 8
    @cmd    position 0 -30 0 -1 -1
    frame    data/chars/chris/126
    @cmd    hurt 0 8
    @cmd    position 0 -30 0 -1 -1
    frame    data/chars/chris/126
    @cmd    depost 0
    @cmd    finish 50 3 2 2 0 1
    frame    data/chars/chris/126
    delay    20
    offset    72 140
    frame    data/chars/chris/080
    delay    10
    frame    data/chars/chris/081
    frame    data/chars/chris/082
    frame    data/chars/chris/083
 
A simple fix is the Y position of the first frames in the hero throw moves

@cmd position 0 38 0 -1 1 (enemy still on base so can perform escape move [anim special3] during throw which causes the bug)

change to

@cmd position 0 38 5 -1 1 (enemy elevated above base in first frame of hero throw and can't perform escape)




I changed the entire throw systems code as I encountered more bugs, with the new throw system I decided with the help of o ilu, kratus and bloodbane to add different throws.
 
Another question is about Dracula, why is he attacking during the scripted grab?
Because the Y position on his code is set as zero. If the enemy has a riseattack, he will try to use it (remember the enemy is on a FALL animation)

@cmd position 0 38 0 -1 1

Its not an engine bug on this case, as it is trying to do what it was meant for, just a wrong script usage.

As @danno explained, setting the Y to a non zero value will fix it.

edit: by the way, the same issue would happen if the code was using PAIN instead of a FALL animation, as the enemy would try to use its SPECIAL if he has one, thanks to the 0 Y position.
 
@danno & @O Ilusionista -
i will add notes of these values on the scripts and make an excel tool...

ah , its like the door zombies on level 2 - the old engine would accept a value of zero and the newer engines do not..


I changed the entire throw systems code as I encountered more bugs, with the new throw system I decided with the help of o ilu, kratus and bloodbane to add different throws.
did you ever make a list? i can count about 6 of them and i suspect they are related to this Y elevation issue and they all seem to involve grabs or throws - then there is the the "throw recover" which should be fixed relatively easily using a health check and a forced death animation -

Ok , let's say i would like Dracula to keep this behavior because of the 0 position -
(i think this is fine, because with Jake, using the suplex or jumping suplex successfully agains dracula currently only works 2 out of 4 times)

is it possible to add an unbind command to his rise/anim special3 attack?
 
@danno & @O Ilusionista -
i will add notes of these values on the scripts and make an excel tool...

ah , its like the door zombies on level 2 - the old engine would accept a value of zero and the newer engines do not..



did you ever make a list? i can count about 6 of them and i suspect they are related to this Y elevation issue and they all seem to involve grabs or throws - then there is the the "throw recover" which should be fixed relatively easily using a health check and a forced death animation -

Ok , let's say i would like Dracula to keep this behavior because of the 0 position -
(i think this is fine, because with Jake, using the suplex or jumping suplex successfully agains dracula currently only works 2 out of 4 times)

is it possible to add an unbind command to his rise/anim special3 attack?
Same as @danno and @O Ilusionista said, the Y value for the @cmd position must be zero otherwise the grabbed opponent will react as soon as he detects the ground. I had the same problem some time ago in my scripted grabs and fixed it by changing the lowest height in all @cmd positions to 1 instead of 0.

The original @cmd slamstart/position works using the "fall7" animation, technically the grabbed opponent is in a "falling" instance and as soon as you force him to land by setting the Y to 0 he will perform rise/riseattack and then reset to idle without unbind.
 
did you ever make a list?

Nope, I've replaced about 90% of the original code because I found it easier than fixing problem after problem, the only code that's left for me to remove is stage intro's/outro's and kratus already provided a better way for me to do that using final fight X as practice.

then there is the the "throw recover" which should be fixed relatively easily using a health check and a forced death animation

For that problem I made an inline script that makes sure no health is taken on the recovery animations landing, so no death and no being stuck on last frame of recovery animation.

Ok , let's say i would like Dracula to keep this behavior because of the 0 position -
(i think this is fine,

Don't, it's not fine, it not a chance, it will happen every time and it's game breaking.

is it possible to add an unbind command to his rise/anim special3 attack?

You could but it's kinda like when you set an entity's subject interaction (subject_to_screen for example) you better turn it on and off correctly or else you'll run into more problems.
 
the only code that's left for me to remove is stage intro's/outro's
same boat, i want to get rid of weapon model usage and use an entity instead with script, the only issue may be that if an enemy damages the entity, (frankenstein stage, if your character spends too much time making salutes, the random frank that is more aggressive attacks) the main model probably won't reflect it...

For that problem I made an inline script that makes sure no health is taken on the recovery animations landing, so no death and no being stuck on last frame of recovery animation.
i want to go with an special death animation if health is 0 , the frames are there to simulate exhaustion collapse - lol i'm not sure i have yet identified the animations tho...
 
Back
Top Bottom