• All, I am currently in the process of migrating domain registrations. During this time there may be some intermittent outages or slowdowns. Please contact staff if you have any questions.

How do i prevent attack to hit enemy midair ?

bWWd

Well-known member
Any way to do this? I cant figure it out, i dont want the attack to affect enemies midair, only when theyre on ground
 
There's not a singular "no hitting if in air flag", but there is a native juggle cost system that can do the same thing. The catch is (IIRC) you have to set it up on every attack. I would just leverage the doattack event script instead. Five minutes and you're done.

Check this video out for an explanation. In your case, forget all that stuff with checking for previous attacks... just look at the target's "inair" flag, and if it's true, cancel the hit.


HTH,
DC
 
OK gonna derail as usual, so my real issue was that it looked off when i harpooned enemy midair or during fall with scorpion like move and pulled him from midair when he was fallin so... i forced fall3 anim to go to pain3 anim but im not sure if my aiflags are set correctly to kinda cancel the fall state... heres my fall and pain 3 that does the pull in and then when enemy is close hegoes to follow1 anim that does being dizzy animation.

What i worry about is enemies being stuck in kinda idle animation where i cant hit tthem, it happened already a few times but setting some aiflags kinda resolved it and happens less often and enemy does not have bboxes when he does that so the game is kinda stuck and i have to restart, i really dont like those scenarios and not sure how to protect against them,

Theres just no easy way to jump from fall to pain or from pain1 to pain2 without some issues coming out with enemy behaviours, you have to kinda know aiflags , i really really dont like that part of the engine , it breaks the game and forces you to restart if enemy is stuck.

So whats the proper way to do something like this ?

In mk if enemy is in air or on ground theyre getting pulled from the ground anyways so looks like pain is being forced even if enemy was in mid air, i kinda want to do the same but without my character getting locked in infinite idle without bboxes.


There is also one more issue... where i harpoon enemy from very close, then i think enemy does not go through all phases of the pull in scripts and goes instantly to follow1 which sometimes locks him in infinite idle .

Code:
anim fall3
    delay  1
        offset    104 243
            @cmd    performattack getlocalvar("self") openborconstant("ANI_PAIN3")
     frame      data/chars/gob/p_pain_4.gif

Code:
anim    pain3
    loop    0
    offset    102 243
    bbox    0 0 0 0

    quakeframe    1 1 6
        subentity    bloo
    spawnframe     2  -70 3  205
    sound    data/chars/gob/pain.wav
  
  
                @script
                void self = getlocalvar("self");
                 void opp = getentityproperty(self, "opponent");
                void    e;
                  changeentityproperty(self, "z",  getentityproperty(opp, "z" ) -2 );
                   changeentityproperty(self, "a",  getentityproperty(opp, "a" ) );
                   changeentityproperty(self ,"aiflag","projectile",0);
            changeentityproperty(self,"aiflag","falling",0);
            changeentityproperty(self,"aiflag","drop",0);
            changeentityproperty(self,"aiflag","frozen", 0);
        if ((getentityproperty(self, "direction")==0)&&(frame <= 0)){
        changeentityproperty(self, "velocity", 5, 0, 0);
        clearspawnentry();
    setspawnentry("name", "harpon");
    e = spawn();
           bindentity(e, self, -55, 0, 210, -1, 4,1);
        }
 
         if ((getentityproperty(self, "direction")==1)&&(frame <= 0)){
        changeentityproperty(self, "velocity", -5, 0, 0);
        clearspawnentry();
    setspawnentry("name", "harpon");
    e = spawn();
           bindentity(e, self, -55,0, 210, -1, 4-1);
        }

        if(frame == 3){
        changeentityproperty(self, "velocity", 0, 0, 0);
        } 
                if ((getentityproperty(self, "direction")==0)&&(frame == 9)){
        changeentityproperty(self, "velocity", -12, 0, 0);
        bindentity(e, self, 8, 0, 210, -1, 4,1);
        }
         if ((getentityproperty(self, "direction")==1)&&(frame == 9)){
        changeentityproperty(self, "velocity", 12, 0, 0);
        bindentity(e, self, 8, 0, 210, -1, 4,-1);
        }
        if    ((getentityproperty(self, "direction")==0)&&(    getentityproperty(opp, "x")    >=     getentityproperty(self , "x") -120)){
        void self = getlocalvar("self");
        changeentityproperty(self, "velocity", 0, 0, 0);
              killentity(e);   
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
        }
                if    ((getentityproperty(self, "direction")==1)&&(    getentityproperty(opp, "x")    <=     getentityproperty(self , "x") +120)){
        void self = getlocalvar("self");
        changeentityproperty(self, "velocity", 0, 0, 0);
          killentity(e);
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
        }
    @end_script 
  
  
    delay  7
        offset    104 243
     frame      data/chars/gob/p_pain_4.gif
             offset    100 243
     frame      data/chars/gob/p_pain_4.gif
             offset    104 243
     frame      data/chars/gob/p_pain_4.gif
             offset    100 243
     frame      data/chars/gob/p_pain_4.gif
             offset    104 243
     frame      data/chars/gob/p_pain_4.gif
             offset    100 243
     frame      data/chars/gob/p_pain_4.gif
             offset    104 243
     frame      data/chars/gob/p_pain_4.gif
                  offset    100 243
     frame      data/chars/gob/p_pain_4.gif
             offset    104 243
     frame      data/chars/gob/p_pain_4.gif
             offset    93 252
     frame      data/chars/gob/harpain.gif
     frame      data/chars/gob/harpain.gif
      frame      data/chars/gob/harpain.gif
       frame      data/chars/gob/harpain.gif
        frame      data/chars/gob/harpain.gif
         frame      data/chars/gob/harpain.gif
          frame      data/chars/gob/harpain.gif
           frame      data/chars/gob/harpain.gif
            frame      data/chars/gob/harpain.gif
                 frame      data/chars/gob/harpain.gif
      frame      data/chars/gob/harpain.gif
       frame      data/chars/gob/harpain.gif
        frame      data/chars/gob/harpain.gif
         frame      data/chars/gob/harpain.gif
          frame      data/chars/gob/harpain.gif
           frame      data/chars/gob/harpain.gif
            frame      data/chars/gob/harpain.gif
          
        
                    delay  7
        offset    104 243
             bbox    66 39 76 204
             @cmd changeentityproperty getlocalvar("self") "velocity"  0 0 0
     frame      data/chars/gob/p_pain_4.gif


Code:
anim    follow1
  loop  0
    offset    100 243
    bbox    66 39 76 204
  
   delay  7
       offset    100 243
     frame      data/chars/gob/p_pain_1.gif
     offset    104 243
     frame      data/chars/gob/p_pain_1.gif
     offset    100 243
     frame      data/chars/gob/p_pain_1.gif
     offset    104 243
     frame      data/chars/gob/p_pain_1.gif
     offset    100 243
     frame      data/chars/gob/p_pain_1.gif
     offset    104 243
     frame      data/chars/gob/p_pain_1.gif
     offset    100 243
     frame      data/chars/gob/p_pain_1.gif
     offset    104 243
     frame      data/chars/gob/p_pain_1.gif
 
Ok i think an issue is acquiring opponent, cause when opponent gets hit from another entity when its getting acquired the it does not exist and acquiring entity gets sent to infinite loop, this sucks imo, i wish it was more foolproof instead of getting stuck randomlyu breaking entire game.

How would you try to acquire enemy thats pulling acquiring entity to himself and prevent those weird bugs , cauyse yeah i dont think not getting Z cause of missing oppontnt is a reason to suddenly get stuck in idle for eternity ... so you did not get z ? great , move on with everything else just dont get stuck.

So i need to alight their Z axes , so i alignt acquring entity to opponent which is player, how would you make this foolprof no matter what happens to opponent and entity thats aquiring opponent ?

Damn i really dread this issue and i remember during he-man i had issues with it as well, had to leave some moves on the table because of it , but i really want to work around it and never let enemies stuck in idle , this is serious issue IMO.

Code:
                @script
                void self = getlocalvar("self");
                 void opp = getentityproperty(self, "opponent");
                void    e;
        if   ( getentityproperty(self, "opponent" !=NULL()) ){
         setidle(self);
        }
        if ((getentityproperty(self, "direction")==0)&&(frame == 1)){
            changeentityproperty(self, "a", 0 );
            changeentityproperty(self, "z",  getentityproperty(opp, "z" ) -2 );
        changeentityproperty(self, "velocity", 5, 0, 0);
        clearspawnentry();
    setspawnentry("name", "harpon");
    e = spawn();
           bindentity(e, self, -55, 0, 210, -1, 4,1);
        }
         if ((getentityproperty(self, "direction")==1)&&(frame ==  1)){
        changeentityproperty(self, "a", 0 );
          changeentityproperty(self, "z",  getentityproperty(opp, "z" ) -2 );
        clearspawnentry();
    setspawnentry("name", "harpon");
    e = spawn();
           bindentity(e, self, -55,0, 210, -1, 4-1);
        }

        if(frame == 3){
        changeentityproperty(self, "velocity", 0, 0, 0);
        }
                if ((getentityproperty(self, "direction")==0)&&(frame == 9)){
        changeentityproperty(self, "velocity", -12, 0, 0);
        bindentity(e, self, 8, 0, 210, -1, 4,1);
        }
         if ((getentityproperty(self, "direction")==1)&&(frame == 9)){
        changeentityproperty(self, "velocity", 12, 0, 0);
        bindentity(e, self, 8, 0, 210, -1, 4,-1);
        }
        if    ((getentityproperty(self, "direction")==0)&&(    getentityproperty(opp, "x")    >=     getentityproperty(self , "x") -120)){
        void self = getlocalvar("self");
        changeentityproperty(self, "velocity", 0, 0, 0);
              killentity(e);  
  performattack(self, openborconstant("ANI_FOLLOW1"));
        }
                if    ((getentityproperty(self, "direction")==1)&&(    getentityproperty(opp, "x")    <=     getentityproperty(self , "x") +120)){
        void self = getlocalvar("self");
        changeentityproperty(self, "velocity", 0, 0, 0);
          killentity(e);
         performattack(self, openborconstant("ANI_FOLLOW1"));
 
        }
    @end_script
 
Back
Top Bottom