• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

Solved Trying to fix the old "recovery flip" script

Question that is answered or resolved.

oldyz

Well-known member
i am trying to fix the old bug where a recovery landing freezes the players.
in this code are a couple of attempted fixes, like changing animation to a fall8 animation
or a sucide based on health.

@danno solved this problem by making sure the character gets +1 health point when landing,
where i seek the opposite, if health is zero character dies.

anyway here is the code:
Code:
anim    freespecial39
    @script
    void self = getlocalvar("self");
    void SHealth = getentityproperty(self,"health");
    if (frame == 5){
    setidle(self);
    changeentityproperty(self, "health", SHealth + 4);
    }
    @end_script   
    offset    72 140
    jumpframe    0 3 -1 0
    bbox    0 0 0 0
    landframe    5
    delay    10
    sound    data/sounds/jump.wav
    frame    data/chars/chris/d4
    @cmd    aiflag "falling" 0 "common_pain"
    @cmd    aiflag "drop" 0 "common_pain"
    @cmd    aiflag "projectile" 0 "common_pain"
    frame    data/chars/chris/d2
    frame    data/chars/chris/d1
@cmd HealthSwitch0 "ANI_fall8"
#@cmd DeadSwitch0 4
    frame    data/chars/chris/069
    delay    1000
    frame    data/chars/chris/056
    attack    0 0 0 0
    delay    5
    frame    data/chars/chris/sel0 ## og 054

be aware that i have tried @cmd killentity,@cmd suicide, @cmd hurtself, etc on the last frame, next to last frame, etc.
killentity results in the character completely dissapearing and with him all of the continues, game dont get stuck, but you loose all lives
 
i am trying to fix the old bug where a recovery landing freezes the players.
I already saw this happening few times, but I never realized what causes it exaclty.

One of the ways is when you have an animation with followcond/followanim which hits on the same frame the chracter jumps. Sometimes, if it hits on the same splitsecond, the character goes to the follow animation (which as a long delay time 1000) and the player got stuck on that frame until the delay ends.

The other way I can remember is when you use "dive" and your character lands on a platform.
 
The other way I can remember is when you use "dive" and your character lands on a platform.
i suppose that "check for platform below " has to be used in whatever script may be used to try and fix this,
hehe or the fix might be a simpler thing i cant imagine currently...
 
The solution was to modify the character's animation a bit and apply @Bloodbane 's force die animationscript for tosses or falls:

Code:
#####  2023.10.25 throw or punch flying recovery move vs Golem ####     
anim    freespecial39
#####  force death script  #####
@script
  if( frame == 5 ){
    void self = getlocalvar("self");
    int Health = getentityproperty(self, "health");
    int Land = getentityproperty(self, "damage_on_landing");

    changeentityproperty(self, "damage_on_landing", 0);

    if( Health > Land ){
      changeentityproperty(self, "health", Health-Land);
    } else if( Health <= Land ){
      damageentity(self, self, 20, 1, openborconstant("ATK_NORMAL3"));
    }
  }
@end_script
##### force death script END  #####
  ####  throw recovery script   ######
    @script
    void self = getlocalvar("self");
    void SHealth = getentityproperty(self,"health");
    if (frame == 6){
    setidle(self);
    changeentityproperty(self, "health", SHealth + 4);
    }
    @end_script
####  throw recovery script END  ###### 

    offset    72 140
    jumpframe    0 3 -1 0
    bbox    0 0 0 0
    landframe    6
    delay    10
    sound    data/sounds/jump.wav
frame    data/chars/chris/d4
    @cmd    aiflag "falling" 0 "common_pain"
    @cmd    aiflag "drop" 0 "common_pain"
    @cmd    aiflag "projectile" 0 "common_pain"
frame    data/chars/chris/d2
frame    data/chars/chris/d1
frame    data/chars/chris/069
    delay    1 # og 1000 divided for 2 duplicate frames
frame    data/chars/chris/056   ##### force death landframe (5)
    attack    0 0 0 0
        delay    999
frame    data/chars/chris/056   ##### recovery script landframe (6)
    attack    0 0 0 0
    delay    5
frame    data/chars/chris/054 ## og 054   (7)
        delay    1
frame    data/chars/chris/054 ## og 054
#####  throw or punch flying recovery move vs Golem End ####
 
So there has been a bug about the entity being frozen from landing after doing some attacks in the air?
I am having the freezing issue where I want the character to be able to recover with an attack from falling.
During the falling, I hit A1 to recover with an attack in the air, but he freezes after landing. After that I can not make him move or do certain skills for a while.
I am sure I setup the landframe and delay 999 correctly. I've tried many solutions but nothing worked so far :-(
 
@Bruce
unfortunately this script - as far as i know only seems to apply when damage is taken from some enemy tosses and some enemy attacks.

if i understand correctly from you post, you want to recover and the frames of the recovery animation have attack boxes/ attack qualities?

for a full picture of the workings of the code, i think that you might have to take a look at the Chris character text file the full animaton text, and the script dependencies

anyway, if you take a look at the fix that was implemented, the animation performs, but if the health is equal or less than 0 at frame 5 (not sure, but it worked) the character dies,
on the other hand , it seems that the recovery portion of the script does not seem to depend on a land frame, it only gives you some health if frame 6 happens....

the reason why the "force death" script exists, is because enemies would not peform a death animation after a toss, some music changes in the module where dependant on a death animation, so after finally understanding how the script worked
a version of it was added to the recovery animation to get rid of the landing bug.

anyway, the solution for me was to kill the entitiy at the animation land frame instead of giving players a potential exploit.
@danno
implemented the opposite, - if not mistaken - health is given and ensured at landing or last frame
 
@Bruce
unfortunately this script - as far as i know only seems to apply when damage is taken from some enemy tosses and some enemy attacks.

if i understand correctly from you post, you want to recover and the frames of the recovery animation have attack boxes/ attack qualities?

for a full picture of the workings of the code, i think that you might have to take a look at the Chris character text file the full animaton text, and the script dependencies

anyway, if you take a look at the fix that was implemented, the animation performs, but if the health is equal or less than 0 at frame 5 (not sure, but it worked) the character dies,
on the other hand , it seems that the recovery portion of the script does not seem to depend on a land frame, it only gives you some health if frame 6 happens....

the reason why the "force death" script exists, is because enemies would not peform a death animation after a toss, some music changes in the module where dependant on a death animation, so after finally understanding how the script worked
a version of it was added to the recovery animation to get rid of the landing bug.

anyway, the solution for me was to kill the entitiy at the animation land frame instead of giving players a potential exploit.
@danno
implemented the opposite, - if not mistaken - health is given and ensured at landing or last frame
nevermind, found the solution for me:
@cmd changeentityproperty getlocalvar("self") "aiflag" "drop" 0
@cmd changeentityproperty getlocalvar("self") "aiflag" "falling" 0
I had to add this to avoid the landing freezing bug. So weird.

Thank you
 
Back
Top Bottom