(Solved) Need some help/advise

Number one sounds like you are trying to do the Double KO style or attacking each other simultaneously. It seems ondoattack can handle the attack detections but I'm not entirely sure it can help. I think White Dragon has the Double KO in his TMNT, but I'm not 100% sure because last time, I was testing the detection of each attack trying to see whether the Double KO exists or not. It seems to me that it didn't exist. I should test it again. I think it might be risky to create Double KO. However, I'd like to see this happen in OpenBOR if it looks very fine.

 
Excellent work, magggas! You finally solved the problem! It's amazing how ondoattackscript works for other attack detections especially the Double KO you found out. You changed the ondoattackscript based on WD's? I can tell it was very complicated to make that especially we dunno what functions to come up together for making sense. Did you go with COV (or changeopenborvariant) with lasthit for making them hit each other at the same time?
 
My idea is to use takedamagescript to store how many times an entity has been put in PAIN, with entity variable. If entity has been put in PAIN more than limit, run a script to knock down this entity
Since doing that will rerun takedamagescript and might cause loop, there's a check which checks if received damage is knockdown or not. If it is, then either ignore it OR prevent it from rerunning the knock down script

Haven't tried this myself though
 
Okay, I've just made this takedamagescript:

knocker.c
Code:
void main()
{// Balance script to knock down entity if he/she's been put in pain 4 times
    void self = getlocalvar("self"); //Get calling entity.
    int Drop = getlocalvar("drop"); //Get knockdown power
    int Hits = getentityvar(self, 1);

    if(Hits==NULL()){
      Hits = 0;
      setentityvar(self, 1, 0);
    }

    if(Drop > 0){
      Hits = 0;
      setentityvar(self, 1, 0);
    } else {
      setentityvar(self, 1, Hits+1);
      Hits = Hits+1;
    }

    if(Hits >= 4){
      setentityvar(self, 1, 0);
      damageentity(self, self, 0, 1, openborconstant("ATK_NORMAL"));
    }
}

This script will knock down entity on 4th hit regardless of knockdown power
I've tried it and it works well :)

Though this script doesn't have timer yet so the counter will remain even after 1 minute
 
I can see that you added some lines in the script but I don't know they are for

Anyways, here's the updated knocker.c with time limit:
Code:
void main()
{// Balance script to knock down entity if he/she's been put in pain 4 times
// Counter will reset if last pain is more than 2 seconds ago
    void self = getlocalvar("self"); //Get calling entity.
    int Drop = getlocalvar("drop"); //Get knockdown power
    int Hits = getentityvar(self, 1);
    int TPhase = getentityvar(self, 2);

    if(Hits==NULL() || TPhase <= openborvariant("elapsed_time") - 400){
      Hits = 0;
    }

    if(Drop > 0){
      Hits = 0;
      setentityvar(self, 1, 0);
      setentityvar(self, 2, NULL());
    } else {
      setentityvar(self, 1, Hits+1);
      Hits = Hits+1;
      setentityvar(self, 2, openborvariant("elapsed_time"));
    }

    if(Hits >= 4){
      setentityvar(self, 1, 0);
      setentityvar(self, 2, NULL());
      damageentity(self, self, 0, 1, openborconstant("ATK_NORMAL"));
    }
}

In case you wonder, the time limit is 2 seconds and it's set by 400 value in the script (2 x 200 = 400)
 
Back
Top Bottom