• 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.

About getting enemies to OTG players.

afhc2x17

Member
Hi again, I'm now working on my old mod (personal one, can't share it here due to being +18, and not for violence) and I'm in a roadblock with an OTG script by @msmalik681 for use in a stomping OTG move. But I want to give that ability to enemies too, so I can't put it in keyscript.c. I need to know where it should be for the player to be affected by an enemy OTG move. Here's @msmalik681's code without player input:.
Code:
#define OBC openborconstant
#define GEP getentityproperty
#define CEP changeentityproperty
#define SLV setlocalvar
#define GLV getlocalvar

void self = GLV("self"); //Get calling entity
void exists = GEP(self, "health")>1?1:NULL(); // Is caller alive
 if (OBV("in_level") && exists)
 {
 //Stomp attack
    void target = findtarget(self, OBC("ani_freespecial15"));
   
        if( target &&     GEP(target,"aiflag","drop") &&     // check if target valid and has been knocked down
                        !GEP(target,"aiflag","falling") &&     // check if no longer falling
                         GEP(target,"health")                 // check if still alive
        ){  // otg stomp attack
CEP(self, "velocity", 0, 0, 0);
performattack (self, OBC("ani_freespecial15"));
}
       
    target = NULL();
    }
}
Thanks in advance!
 
guess this could be used to make a enemy attack a player on the floor, you could use it in a ondrawscript or make a animation script and call on each walk animation frame and idle.

I am not sure if enemies need a otg script think you can just give them a otg attack and if its in range they will do it, just guessing. maybe someone can suggest a game that has enemy otg attacks, I am guessing world heroes might have some maybe.
 
Hi, thanks for the answer! I saw an attack like this in a Double Dragon Alternate Mod with Kunio-type enemies, but it's a follow from a jumping attack. I will try to find some way to do it in the new engine. Thanks again!
 
I've tried this and enemies with otg 1 can hurt fallen players, even when they are not specifically targetting fallen players. So the real question is: do you want enemies to do that (attacking player regardless if player is fallen or not with otg 1 set)
OR do you want enemies to perform special attack which targets only fallen players?
 
Hi again, what I want is when an enemy is near a player in the end of the fall animation (or beginning of rise animation, anyone is fine by me), performs an otg attack. But for some reason, attack.ground.mode 2 (previously otg 2) doesn't connect with the bbox of the player during either fall or rise animations. But strangely, attack.ground.mode 1 or otg 1 does work, but it does have the effect of the enemy performing the attack even when the player is not in the fall or rise animations. I want the attack.ground.mode 2 to hit the player's bbox but it can't connect even when the enemy's attackbox is clearly in contact with the fall/rise bbox (and only in the middle of the fall/rise bbox) of the player. I hope this explains what I want to do here. Thanks for your answer.
 
I've tried otg 2 and it works as intended so I'm confused to why.

attack.ground.mode 1 or otg 1 does work, but it does have the effect of the enemy performing the attack even when the player is not in the fall or rise animations

Eh? what do you mean by that? are you using some kind of followup system which uses attackbox with otg set to trigger the follow?
 
Yes, it is:
Code:
anim attack9
    loop    0
    offset    66 128
    range    -50 50
    bbox    40 103 53 32
    delay    15
    followanim    6
    followcond    2
    grabfinish    1
    attackone    1
    attack27  56 78 60 50 0 0 1 1 0 0
    forcedirection  1
    attack.ground.mode 2
    frame    data/chars/burglar/rise02.png

anim follow6
@include data/chars/burglar/grab3.txt

And this is the follow:
Code:
anim follow6
    loop    0
    offset  66 128
    range    -50 50
    delay    20
    bbox    40 103 53 32
    frame    data/chars/burglar/rise02.png
    delay    35
    @cmd    slamstart
    @cmd    bind 1 -11 1 3 1
    @cmd    forceanim "ANI_PAIN27" 0
    frame     data/chars/burglar/rise02.png
    @cmd    bind 1 1 1 3 1

    delay    75
    @cmd    forceanim "ANI_PAIN28" 0
    frame    data/chars/burglar/grab04_01.png
    delay    25
    @cmd    forceanim "ANI_PAIN28" 1
    @cmd    hurt 5
    frame    data/chars/burglar/grab04_02.png
    delay    75
    @cmd    forceanim "ANI_PAIN28" 0
    frame    data/chars/burglar/grab04_01.png
    delay    25
    @cmd    forceanim "ANI_PAIN28" 1
    @cmd    hurt 5
    frame    data/chars/burglar/grab04_02.png
    delay    75
    @cmd    forceanim "ANI_PAIN28" 0
    frame    data/chars/burglar/grab04_01.png
    delay    25
    @cmd    forceanim "ANI_PAIN28" 1
    @cmd    hurt 5
    frame    data/chars/burglar/grab04_02.png

    delay    40
    @cmd    bind 0 0 0 0 0
    @cmd    finish 0 0 -2 0 0
    @cmd    forceanim "ANI_FALL" 4
    delay    18
    @cmd    clearL
    frame    data/chars/burglar/rise02.png
    move    -5
    delay    9  
    frame    data/chars/burglar/walk01.png
    delay    9  
    frame    data/chars/burglar/walk02.png
    delay    9  
    frame    data/chars/burglar/walk03.png
    delay    9  
    frame    data/chars/burglar/walk04.png
    delay    9  
    frame    data/chars/burglar/walk05.png
    delay    9  
    frame    data/chars/burglar/walk06.png
    move    0
    frame    data/chars/burglar/walk06.png

Thanks for your answer!
 
I've tried making attack with otg 2 for enemy and player and both of them work. Even with followup mechanic, they still work. So I don't know why your enemy couldn't hit player with otg 2.
Can you record a video showing the issue?
 
Sorry for not answering or sharing a video, due to the nature of my mod, I can't share it because of the content.

Well then, I don't know what is wrong with the mod, I think I will redownload the OpenBOR executable (currently using 4.0.7555) and try again. Thanks for your answer!
 
Back
Top Bottom