[SOLVED]Grabcheck question

I'm using DC's dograb script to grab enemies from afar and it works perfect except the player can grab enemies it's not supposed to be able to, to stop this I used grabcheckG and it works for the enemy I was aiming for but I don't know why. It's a regular enemy not a biker or airborne enemy and it's on the ground so my question is how do I set larger enemies or non moving enemies as non grab targets using grabcheckG?
 
grabcheckG and grabcheckA are 2 old and obsolete functions. I created that because there was no way to acquire ungrabbable status aside of name
However, now there's antigrab and grabforce command which can be acquired with script and simplify grabcheck function

So what do you need is set antigrab in ungrabbable enemies text and acquire this value with script
 
there are also these 2 options
witch can be very easy to acquire by script
and add to slamstart, I still haven't made this change thoug... I haven't reached this part yet

cantgrab {bi}
--{bi} determines whether or not an entity can be grabbed and held (or thrown).
--If set to 1, opponent who stand close to this entity will simply pass through.

type {type}
enemy: The entity is a CPU controlled enemy or enemy projectile.

subtype
notgrab: Does the same thing as the cantgrab command: the entity can't be grabbed.

  void target = getlocalvar("Target" + self);
  int gb = getentityproperty(target,"cantgrab");

if(target!=NULL() && gb != 1)
  {
    damageentity(target, self, 0, 1, openborconstant("ATK_NORMAL7")); // Slam Starter
  }
 
Something in my mod I hadn't fixed yet either.  I have vs damage disabled.  BUT players can grab other players for some reason.  Not sure is a bug, or something I did.  I was redoing the moves with slam script so I hadn't worried about it.
 
BeasTie said:
Something in my mod I hadn't fixed yet either.  I have vs damage disabled.  BUT players can grab other players for some reason.  Not sure is a bug, or something I did.  I was redoing the moves with slam script so I hadn't worried about it.

I have this problem too.
Anyway I think it's in the engine.
Again I have no knowledge in this subject
 
As I said in the video, you have to add appropriate checks yourself depending on exactly what you want to do.

The whole point of script is that it bypasses default "easy mode" behaviors and gives you total control. It's not up the engine to decide what can be grabbed and what can't, it's up to you.

It's a simple matter of inserting conditional logic of your choice that decides whether or not to run the dograb function.

DC
 
I'm not sure how your grab mechanics works but let me give you an example:

anim follow1
@script
    if(frame == 0){
      void self = getlocalvar("self");
      void target = getentityproperty(self, "opponent");
      int Anti = getentityproperty(target, "antigrab");

      if(Anti < 20){
        int r = rand()%30;

        if(r > 0){
          changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW3"));
        }
      } else {
        changeentityproperty(self, "animation", openborconstant("ANI_FREESPECIAL"));
      }
    }
@end_script
delay 1
offset  87 155
bbox    0 0 0 0
frame data/chars/golem/39
@cmd slamstart
frame data/chars/golem/39
delay  60
@cmd    position 0 30 50 -1 -1
frame data/chars/golem/39
@cmd    depost 0
sound  data/sounds/beat1.wav
@cmd    finish 40 -5 2 0 0
frame data/chars/golem/40
delay 1
@cmd clearL
frame data/chars/golem/40

This is golem's followup animation (it grabs player/npc with its arm in previous animation). Just when this animation is run, a script is run to check grabbed opponent's antigrab value. If it's below 20 i.e slammable, run a little randomize function to change to alternate slam animation but if it's 20 of more i.e unslammable, change to FREESPECIAL animation, the non slam animation
 
Back
Top Bottom