Solved Projectile that does not interrupt

Question that is answered or resolved.

Aerisetta

Active member
Hi

I would like to create a projectile (bullet) that can hit enemies and cause damage but does not interrupt them at all (does not cause pain animation)

Any example of how to approach this?
 
Solution
For projectile specific setting, it's best to add noreflect command after attackbox like this:
Code:
    attack  0 0 10 10 15 1
    noreflect 1

With this command, this attack won't interrupt attacked entity while still inflicting damage.
er... solved

name the attack of the bullet something else i.e. attack4

then assign to enemy headers
defense attack4 1 2

the attack does 1 damage, less than defense value of 2, therefore no pain

couldnt delete thread, but i guess it's solved unless there is an easier way out there
 
For projectile specific setting, it's best to add noreflect command after attackbox like this:
Code:
    attack  0 0 10 10 15 1
    noreflect 1

With this command, this attack won't interrupt attacked entity while still inflicting damage.
 
Solution
Sorry to necro this thread but I would like to add something else to the projectile.

Is it possible to add a script to make make the projectile
5% chance to cause pain animation (noreflect 0)
95% does not cause pain animation (noreflect 1)

Code:
name    bullene2
type    none
health  1
speed    200
noquake 1
remove    1
nolife  1

lifespan  3
candamage    enemy obstacle
offscreenkill     50
ondoattackscript data/scripts/variable_damage.c


anim    idle
    forcedirection -1
    fastattack 1
    loop    1
    delay    3
    offset    39 55
    bbox    0 0 0 0
    hitfx    data/sounds/hitmarker2.wav
    hitflash    flash1
    attack20 22 23 35 50 10 0 0 0 0 25
    noreflect 1
    frame    data/chars/misc/bullets/bullet01.gif

anim    follow1
    fastattack 1
    loop    1
    delay    3
    offset    39 55
    bbox    0 0 0 0
    hitfx    data/sounds/hitmarker2.wav
    hitflash    flash1
    attack20 22 23 35 50 10 0 0 0 0 25
    noreflect 1
    frame    data/chars/misc/bullets/bullet04.gif
 
Is it possible to add a script to make make the projectile
5% chance to cause pain animation (noreflect 0)
95% does not cause pain animation (noreflect 1)
Question, is that some kind of "super armor" behaviour? And will the noreflect accept the damage or will it simply nullify it?
 
I want the damage to always apply

But I want it to only interrupt the enemy 5% of the time (this is a machine gun)
Maybe the simplest way is by randomly changing the bullet entity animation, one with noreflect 1 and other without it:

C:
anim    idle
    forcedirection -1
    fastattack 1
    loop    1
    delay    3
    offset    39 55
    bbox    0 0 0 0
    hitfx    data/sounds/hitmarker2.wav
    hitflash    flash1
    attack20 22 23 35 50 10 0 0 0 0 25
    @cmd aniRandom openborconstant("ANI_FOLLOW1")
    frame    data/chars/misc/bullets/bullet01.gif

anim    follow1
    fastattack 1
    loop    1
    delay    3
    offset    39 55
    bbox    0 0 0 0
    hitfx    data/sounds/hitmarker2.wav
    hitflash    flash1
    attack20 22 23 35 50 10 0 0 0 0 25
    noreflect 1
    frame    data/chars/misc/bullets/bullet04.gif

C:
void aniRandom(void ani)
{//Random animation changer (SOR3 LAMPS)
    void self    = getlocalvar("self");
    float iR    = rand()%50+50;
    
    if(iR >= 0 && iR < 5){changeentityproperty(self, "animation", ani);} //5% CHANCE
}
 
Back
Top Bottom