Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
K_Doom

Trouble with infighting (hitscan)

Recommended Posts

Hi guys, I believe you've seen this little guy here 👇
           MAUDA1C1.png.cfab4f73bb877995b18b9ab3b0738a71.png ᴹᵃᵘˡᵉʳ ᴰᵉᵐᵒⁿ

 

Well, he has an interesting way of attacking: jumps on opponents using the A_SkullAttack function. The problem is that this function causes infighting both between the other Mauler Demons and the normal Demons. And so they fight more with each other than with the player haha

 

I've tried, but no flag that prevents infighting solves this problem, because they only work with projectiles.
I wanted to know what would be the best way around this.

 

Any suggestion?

Share this post


Link to post

By default, infighting is something where missile attacks do not harm members of the same species, but melee attacks are considered universal. Two Barons can't harm each other with their shots, but you can definitely make them claw each other to death, via abusing barrels for example.

 

 

Since you mention using A_SkullAttack for those custom demons, I'm going to presume you're using some form of DECORATE or ZScript for them. But that's also what makes it tricky:

  • DONTHARMSPECIES and DONTHARMCLASS only applies to missiles.
  • NORADIUSDAMAGE is useless because this isn't an explosion.
  • NOINFIGHTING will prevent the infighting, but the monster will still suffer damage if it's hit by a charging Mauler Demon. (And defining it on the Mauler Demon would only mean the Mauler Demon wouldn't retaliate - other monsters could/would retaliate if hit by it.)

Basically, the system is way less flexible for melee attacks as opposed to projectile ones, and a lost soul is, technically, doing a charging melee attack. This would be easy to make work as a projectile, but melee is way, way harder.

Edited by Dark Pulse

Share this post


Link to post

I'd suggest you to try giving them a DamageType and then giving them immunity to that type with DamageFactor.

This way they shouldn't be able to harm each other, since A_SkullAttack use the damage property set on the monster itself and (hopefully) this way they won't infight.

Share this post


Link to post

I myself tried in the past to deal with this issue the same way, but even a paired DamageType and DamageFactor didn't work, unfortunately. When hitting

each other with A_SkullAttack they seemed to harm each other anyway. Ultimately I decided to simply lower the range of that it would lunge at, so there's

less chance another monster is between the it and the player.

Share this post


Link to post
20 hours ago, Dark Pulse said:

By default, infighting is something where missile attacks do not harm members of the same species, but melee attacks are considered universal. Two Barons can't harm each other with their shots, but you can definitely make them claw each other to death, via abusing barrels for example.

 

 

Since you mention using A_SkullAttack for those custom demons, I'm going to presume you're using some form of DECORATE or ZScript for them. But that's also what makes it tricky:

  • DONTHARMSPECIES and DONTHARMCLASS only applies to missiles.
  • NORADIUSDAMAGE is useless because this isn't an explosion.
  • NOINFIGHTING will prevent the infighting, but the monster will still suffer damage if it's hit by a charging Mauler Demon. (And defining it on the Mauler Demon would only mean the Mauler Demon wouldn't retaliate - other monsters could/would retaliate if hit by it.)

Basically, the system is way less flexible for melee attacks as opposed to projectile ones, and a lost soul is, technically, doing a charging melee attack. This would be easy to make work as a projectile, but melee is way, way harder.

 

@Dark Pulse Yes, I noticed this issue when the A_SkullAttack (Lost Souls) class monsters themselves got hurt. But I thought if knew what causes this infighting factor in Lost Souls, could solve the same problem with Mauler Demons. But when accessing this function on the ZDoom wiki I didn't come to any conclusion, basically A_SkullAttack is A_SkullAttack and that's all (???).
Capturar.PNG.c751af6cbcff1c4eb5010671d67faaf8.PNG
It's not like this function is like A_PosAttack, where it's equivalent to A_CustomBullets with parameters (22.5, 0, 1, random(1,5)*3, "BulletPuff", 0, CBAF_NORANDOM), it was something like this I expected to find.

 

12 hours ago, Kan3 said:

I'd suggest you to try giving them a DamageType and then giving them immunity to that type with DamageFactor.

This way they shouldn't be able to harm each other, since A_SkullAttack use the damage property set on the monster itself and (hopefully) this way they won't infight.

 

@Kan3 I thought about solving it like that too, but since the attack is about the Mauler Demon advancing on the player, i.e. changing from location P1 to P2 (old position, current position) while dealing damage, I find it much more complicated to define this than it would be with a projectile. So I don't know how to do it now.

 

2 hours ago, horselessheadsman said:

I myself tried in the past to deal with this issue the same way, but even a paired DamageType and DamageFactor didn't work, unfortunately. When hitting

each other with A_SkullAttack they seemed to harm each other anyway. Ultimately I decided to simply lower the range of that it would lunge at, so there's

less chance another monster is between the it and the player.

 

@horselessheadsman I didn't want to have to shorten the jump distance. If I do that, for balance reasons I will have to increase the Mauler Demon's speed a lot (Turbo Mauler hehe). And since I don't want to do that, I'll still try to solve this problem. The demon from Brutal Doom v21 also jumps, and in an even more plastic way than simply using A_SkullAttack on a ground monster. However, when opening his code I realized that there is a proportion there beyond my understanding of complex code, this confused me a lot because I still consider myself a beginner haha

Edited by K_Doom : edit

Share this post


Link to post
4 hours ago, K_Doom said:

 

@Dark Pulse Yes, I noticed this issue when the A_SkullAttack (Lost Souls) class monsters themselves got hurt. But I thought if knew what causes this infighting factor in Lost Souls, could solve the same problem with Mauler Demons. But when accessing this function on the ZDoom wiki I didn't come to any conclusion, basically A_SkullAttack is A_SkullAttack and that's all (???).
Capturar.PNG.c751af6cbcff1c4eb5010671d67faaf8.PNG
It's not like this function is like A_PosAttack, where it's equivalent to A_CustomBullets with parameters (22.5, 0, 1, random(1,5)*3, "BulletPuff", 0, CBAF_NORANDOM), it was something like this I expected to find.

Essentially, A_SkullAttack thrusts the actor forward at a fixed velocity (20 units per tic). That's literally all it does.

 

Lost Souls are actually tricky, because unlike any other monster, when it bumps into anything (a player, a monster, an item...), that's when it deals 3*(1-8) damage. In this sense, it behaves more like a projectile where the damage is "inherent" to it. Obviously if the Thing can be damaged, it's damaged; if it can't, then it doesn't take it, but it will stop the Lost Soul charge.

 

What "causes" the infighting is that generally speaking, a monster will retaliate against whatever damaged it, assuming that the monster does not have code to prevent the infighting (i.e; the Arch-vile). Barrels are a special case: The monster will instead target whoever destroyed the barrel. This is why the two Barons above fought, and also why in earlier versions of Doom it was possible to get a monster to kill itself if you got it to hurt a barrel but not kill it, then got it to blow up the barrel to hurt it. (A special check was added in later versions of the game to fix this.) Lost Souls are an extra complication: If they are hurt by a monster, they have a guaranteed pain chance, so they will retaliate, but then they resume going after the player (unless hurt by a monster again) due to a quirk in the code.

 

It should also be noted the Lost Soul's damage is actually less than the regular Demon can do - that's 4*(1-10) damage.

Edited by Dark Pulse

Share this post


Link to post
22 hours ago, Dark Pulse said:

Essentially, A_SkullAttack thrusts the actor forward at a fixed velocity (20 units per tic). That's literally all it does.

 

Lost Souls are actually tricky, because unlike any other monster, when it bumps into anything (a player, a monster, an item...), that's when it deals 3*(1-8) damage. In this sense, it behaves more like a projectile where the damage is "inherent" to it. Obviously if the Thing can be damaged, it's damaged; if it can't, then it doesn't take it, but it will stop the Lost Soul charge.

 

What "causes" the infighting is that generally speaking, a monster will retaliate against whatever damaged it, assuming that the monster does not have code to prevent the infighting (i.e; the Arch-vile). Barrels are a special case: The monster will instead target whoever destroyed the barrel. This is why the two Barons above fought, and also why in earlier versions of Doom it was possible to get a monster to kill itself if you got it to hurt a barrel but not kill it, then got it to blow up the barrel to hurt it. (A special check was added in later versions of the game to fix this.) Lost Souls are an extra complication: If they are hurt by a monster, they have a guaranteed pain chance, so they will retaliate, but then they resume going after the player (unless hurt by a monster again) due to a quirk in the code.

 

It should also be noted the Lost Soul's damage is actually less than the regular Demon can do - that's 4*(1-10) damage.

Yes, in the end, I imagine I'll only be able to solve this the way I want if I turn this jump attack into an A_CustomMissile. The problem is how...

Share this post


Link to post

Well guys, it looks like now I've really encountered a challenge. I'll post it here if I get it resolved. Thanks for listening.

Share this post


Link to post
34 minutes ago, Vermil said:

Maybe you could have the charge itself do no damage ala Heretic's Gargoyle?

Wow, that sounds interesting, I don't know anything about this game. Does this work in Doom's decorate?

Share this post


Link to post

I'm not familiar with ZDoom modding, but it should just be a matter of setting the Mauler demons damage field to 0?

Share this post


Link to post
12 hours ago, Vermil said:

I'm not familiar with ZDoom modding, but it should just be a matter of setting the Mauler demons damage field to 0?

Gargoyle's attack form (hereticimp) implies the same A_SkullAttack function, so it's no use. It is impossible to define the damage in this function, which is the same function used in Mauler's attack.

Share this post


Link to post

With A_SkullAttack I believe you define the damage in the mobj definition itself. Zero it and A_SkullAttack should deal no damage, but will also cause the demon not to infight.

 

  Default
  {
    Health 150;
    PainChance 180;
    Speed 10;
    Radius 30;
    Height 56;
    Mass 400;
    Damage 2; //Horns = pain. I say no more
    SeeSound "demon/sight";
    AttackSound "demon/melee";
    PainSound "demon/pain";
    DeathSound "demon/death";
    ActiveSound "demon/active";
    Obituary "%o was gored by a Mauler Demon.";
    HitObituary "%o was mauled by a Mauler Demon";
    Monster;
    +FLOORCLIP
  }

 

 

Share this post


Link to post
22 hours ago, Vermil said:

With A_SkullAttack I believe you define the damage in the mobj definition itself. Zero it and A_SkullAttack should deal no damage, but will also cause the demon not to infight.

 

  Default
  {
    Health 150;
    PainChance 180;
    Speed 10;
    Radius 30;
    Height 56;
    Mass 400;
    Damage 2; //Horns = pain. I say no more
    SeeSound "demon/sight";
    AttackSound "demon/melee";
    PainSound "demon/pain";
    DeathSound "demon/death";
    ActiveSound "demon/active";
    Obituary "%o was gored by a Mauler Demon.";
    HitObituary "%o was mauled by a Mauler Demon";
    Monster;
    +FLOORCLIP
  }

 

 

 

Yes, I'm aware of that. I created a custom melee attack (A_CustomMeleeAttack) and set a specific damage on it, also made a new Pinky and set the damage factor to 0 in reference to the new damage created [bite]. But it still didn't work. But you gave me an idea, I'll let you know if it works.

Share this post


Link to post
4 hours ago, K_Doom said:

 

Yes, I'm aware of that.

But you just said:

On 2/25/2022 at 9:40 PM, K_Doom said:

It is impossible to define the damage in this function

x)

 

Anyhow, it was easier than I thought (I actually use this in 2 of my monsters, dumb brain).

To erase the damage dealt by A_SkullAttack you just have to delete the damage property from the demon code (like they already told you, but don't set it to 0, delete the line directly).

So, the "dash attack" won't deal anymore damage to anyone and, so, no infighting (I just tested it, it works).

 

Anyhow, if you want to have these demons to deal damage with their "dash" anyway, the only way is to add a new state with a A_CustomMeleeAttack.

You set a Goto  "YourNewState" after the Missile state and you're done (you could add a A_JumpIfCloser before attacking, so that they won't attack the air if they miss you, even if it's hard they're going to miss, I see that they're quite hard to avoid).

The issue with this approach though is the timing, cause if you set the ticks a bit off, they won't probably be able to get you with their attack.

You could try adding multiple A_CustomMeleeAttack in succession and with very low damage to increase the chance, but possibly you won't have any issue at all cause of the low distance they need to dash to you and their speed.

You could even try with a A_SpawnProjectile, instead of a melee attack: an invisible projectile that the demon will shoot immediately after the dash and that will have the same speed of the demon dashing (probably the best solution).

Share this post


Link to post
10 hours ago, Kan3 said:

But you just said:

x)

 

Anyhow, it was easier than I thought (I actually use this in 2 of my monsters, dumb brain).

To erase the damage dealt by A_SkullAttack you just have to delete the damage property from the demon code (like they already told you, but don't set it to 0, delete the line directly).

So, the "dash attack" won't deal anymore damage to anyone and, so, no infighting (I just tested it, it works).

 

Anyhow, if you want to have these demons to deal damage with their "dash" anyway, the only way is to add a new state with a A_CustomMeleeAttack.

You set a Goto  "YourNewState" after the Missile state and you're done (you could add a A_JumpIfCloser before attacking, so that they won't attack the air if they miss you, even if it's hard they're going to miss, I see that they're quite hard to avoid).

The issue with this approach though is the timing, cause if you set the ticks a bit off, they won't probably be able to get you with their attack.

You could try adding multiple A_CustomMeleeAttack in succession and with very low damage to increase the chance, but possibly you won't have any issue at all cause of the low distance they need to dash to you and their speed.

You could even try with a A_SpawnProjectile, instead of a melee attack: an invisible projectile that the demon will shoot immediately after the dash and that will have the same speed of the demon dashing (probably the best solution).

I'll try to see which shape fits best the way I envision it. I will reply here if I have any questions. Thanks a lot for the tips.

 

Share this post


Link to post
19 hours ago, Kan3 said:

But you just said:

x)

 

Anyhow, it was easier than I thought (I actually use this in 2 of my monsters, dumb brain).

To erase the damage dealt by A_SkullAttack you just have to delete the damage property from the demon code (like they already told you, but don't set it to 0, delete the line directly).

So, the "dash attack" won't deal anymore damage to anyone and, so, no infighting (I just tested it, it works).

 

Anyhow, if you want to have these demons to deal damage with their "dash" anyway, the only way is to add a new state with a A_CustomMeleeAttack.

You set a Goto  "YourNewState" after the Missile state and you're done (you could add a A_JumpIfCloser before attacking, so that they won't attack the air if they miss you, even if it's hard they're going to miss, I see that they're quite hard to avoid).

The issue with this approach though is the timing, cause if you set the ticks a bit off, they won't probably be able to get you with their attack.

You could try adding multiple A_CustomMeleeAttack in succession and with very low damage to increase the chance, but possibly you won't have any issue at all cause of the low distance they need to dash to you and their speed.

You could even try with a A_SpawnProjectile, instead of a melee attack: an invisible projectile that the demon will shoot immediately after the dash and that will have the same speed of the demon dashing (probably the best solution).

Hi, I did as recommended in the last tip (create an invisible projectile) and it really solved the infighting problem, but for some reason it was an inconsistent way for Mauler Demon to deal damage as it sometimes hit and sometimes it didn't. Even when I [player] was in front of the attack.

So I decided to decrease A_SkullAttack's tics so that it would run the dash faster and so the invisible projectile could be more effective. But he turned into a killing machine lol
 

As the A_JumpIfCloser line works every time he's close, when he gets close to the player he executes it thousands of times looking like a machine gun, killing the player very fast even with little damage.
 

Now I would like him to make this jump with a certain time interval, like the demons of brutal destruction projects (more specifically v21), I don't know if you've played it.

Could you show me your monster codes so I can get a better idea? I can send mine too if you want to take a look.

Share this post


Link to post
1 hour ago, K_Doom said:

So I decided to decrease A_SkullAttack's tics 

My bad, the projectile should be shoot right before the A_SkullAttack, something like this:

Spoiler

Missile: 
      MAUD E 0 A_Jumpifcloser(224, 2)
      Goto See
      MAUD E 4 A_FaceTarget 
      TNT1 A 0 A_SpawnProjectile("youmissile", 24.0)
      MAUD F 10 A_SkullAttack 
      MAUD G 5 A_Gravity
      Goto See 

 

or like this:

Spoiler

Missile: 
      MAUD E 0 A_Jumpifcloser(224, 2)
      Goto See
      MAUD E 4 A_FaceTarget 
      MAUD F 10 {
	  A_SpawnProjectile("youmissile", 24.0);
	  A_SkullAttack; 
      }
      MAUD G 5 A_Gravity
      Goto See 

 

(remember to give the projectile a low lifespan or it will travel indefinitely forward with the chance of hitting something).

 

1 hour ago, K_Doom said:

As the A_JumpIfCloser line works every time he's close, when he gets close to the player he executes it thousands of times looking like a machine gun, killing the player very fast even with little damage.

Weird, in close quarter they should use their Melee state. What return state did you set after the Dash?

 

2 hours ago, K_Doom said:

Now I would like him to make this jump with a certain time interval, like the demons of brutal destruction projects (more specifically v21), I don't know if you've played it.

Unfortunately not, but, if I've understood correctly, you just have to add some frame after the dash, to make it not jump at you continuously (with a A_JumpIfCloser pointing to the melee state right before the "wait", or it won't try to bite you after it jumped at you).

 

2 hours ago, K_Doom said:

Could you show me your monster codes so I can get a better idea? I can send mine too if you want to take a look.

Yeah sure, but mine is a bit different cause I made use of its normal melee state directly after the dash, cause it doesn't have a default melee state.

Spoiler

Dash:
		TNT1 A 0 A_Jump(96, 4)
		DKEL C 2 A_FaceTarget
		DKEL G 6 Bright A_SkullAttack(28)
		Goto Melee
Missile:
		TNT1 A 0 A_JumpIfCloser(400, "Dash")
		TNT1 A 0 A_Jump(156, "MinionSpawn", "MinionRaise")	
		DKEL C 5 A_FaceTarget
		DKEL J 5 Bright A_FaceTarget
		DKEL J 10 Bright A_CustomMissile("DeathTracer", 136, -56 ,0,0,0)
		Goto See
Melee:
		DKEL GH A_FaceTarget
		DKEL I 4 A_CustomMeleeAttack(random(1, 10) * 12, "death/slash", "death/miss", "Ice")
		DKEL C 8 {
			A_FaceTarget;
			A_Stop;
		}
		TNT1 A 0 A_Jump(96, "DashBack")
		Goto See

 

 (it can be polished, but it does the job.

 

Yeah I'd like to see that code

Share this post


Link to post
15 hours ago, Kan3 said:

My bad, the projectile should be shoot right before the A_SkullAttack, something like this:

  Reveal hidden contents


Missile: 
      MAUD E 0 A_Jumpifcloser(224, 2)
      Goto See
      MAUD E 4 A_FaceTarget 
      TNT1 A 0 A_SpawnProjectile("youmissile", 24.0)
      MAUD F 10 A_SkullAttack 
      MAUD G 5 A_Gravity
      Goto See 

 

or like this:

  Reveal hidden contents


Missile: 
      MAUD E 0 A_Jumpifcloser(224, 2)
      Goto See
      MAUD E 4 A_FaceTarget 
      MAUD F 10 {
	  A_SpawnProjectile("youmissile", 24.0);
	  A_SkullAttack; 
      }
      MAUD G 5 A_Gravity
      Goto See 

 

(remember to give the projectile a low lifespan or it will travel indefinitely forward with the chance of hitting something).

 

Weird, in close quarter they should use their Melee state. What return state did you set after the Dash?

 

Unfortunately not, but, if I've understood correctly, you just have to add some frame after the dash, to make it not jump at you continuously (with a A_JumpIfCloser pointing to the melee state right before the "wait", or it won't try to bite you after it jumped at you).

 

Yeah sure, but mine is a bit different cause I made use of its normal melee state directly after the dash, cause it doesn't have a default melee state.

  Reveal hidden contents


Dash:
		TNT1 A 0 A_Jump(96, 4)
		DKEL C 2 A_FaceTarget
		DKEL G 6 Bright A_SkullAttack(28)
		Goto Melee
Missile:
		TNT1 A 0 A_JumpIfCloser(400, "Dash")
		TNT1 A 0 A_Jump(156, "MinionSpawn", "MinionRaise")	
		DKEL C 5 A_FaceTarget
		DKEL J 5 Bright A_FaceTarget
		DKEL J 10 Bright A_CustomMissile("DeathTracer", 136, -56 ,0,0,0)
		Goto See
Melee:
		DKEL GH A_FaceTarget
		DKEL I 4 A_CustomMeleeAttack(random(1, 10) * 12, "death/slash", "death/miss", "Ice")
		DKEL C 8 {
			A_FaceTarget;
			A_Stop;
		}
		TNT1 A 0 A_Jump(96, "DashBack")
		Goto See

 

 (it can be polished, but it does the job.

 

Yeah I'd like to see that code

When I referred to the demon from brutal doom v21 it was this one 👇
Well of Souls - Sergeant_Mark_IV's BRUTAL DOOM version 21 2022-02-28 20-37-28.rar

 

The Mauler Demon I edited is here if you want to take a look and understand how it works.

MaulerDemon.rar

 

Meanwhile, I'm trying to balance this killing machine, and following your tips haha

Share this post


Link to post
8 hours ago, K_Doom said:

The Mauler Demon I edited is here if you want to take a look and understand how it works.

MaulerDemon.rar

Ok, I've took a look at it and made a few changes cause there was unnecessary stuff.

Here's the code if you want to take a look at:

Spoiler

ACTOR MaulerDemon : Demon 13000
{              
	//$Category Monsters
   Health 300 
   PainChance 90 
   Speed 15 
   Radius 34 
   Height 56 
   Mass 450
   Monster
   Scale 1.5
   +FLOORCLIP 
   +DONTHURTSPECIES
   Obituary "%o foi atravessado pelos chifres do demonio estraçalhador."
   HitObituary "%o foi brutalizado pelo demonio estraçalhador"
   tag "MaulerDemon"
   Species "Demon"
   Scale 1.20
   States 
   { 
   Spawn: 
      MAUD AB 10 A_Look 
      Loop 
   See: 
      MAUD AABBCCDD 2 A_Chase 
      Loop 
   Melee:
      MAUD EF 4 A_FaceTarget 
	  MAUD G 6 A_CustomMeleeAttack(random (10, 15)*4, "demon/melee", "demon/melee")
      Goto See 
   Missile: 
      MAUD E 0 A_Jumpifcloser(220, 2)
      Goto See
      MAUD E 8 A_FaceTarget 
      TNT1 A 0 A_CustomMissile("DemonAttack",30,0,0)
      MAUD F 10 A_SkullAttack
      MAUD G 5 A_Gravity
      MAUD E 0 A_Jumpifcloser(48, "Melee")
      Goto See 
   Pain: 
      MAUD H 2 
      MAUD H 2 Fast A_Pain 
      Goto See 
   Death: 
      MAUD I 8 
      MAUD J 8 A_Scream 
      MAUD K 4 
      MAUD L 4 A_Fall 
      MAUD M 4 
      MAUD N -1 
      Stop 
   Raise: 
      MAUD N 5 
      MAUD MLKJI 5 
      Goto See 
   } 
}

ACTOR DemonAttack
{
	Radius 24
	Height 8
	Projectile 
    Speed 20
    Damage (random(1,2)*2)
	+ALLOWTHRUFLAGS
	+MTHRUSPECIES
	DontHurtShooter
	+NODAMAGETHRUST
	States
	{
	Spawn:
		TNT1 A 10
		TNT1 A 10 A_ChangeFlag("NOGRAVITY", FALSE)
	Stop
	}
}

Species shouldn't be necessary since you're inheriting from the Demon class, but we never know.

 

I tested it like this and it works, kinda...

I unfortunately found out that the "killing machine" issue is inevitable (?) in DECORATE.

I couldn't figure out if it was cause of my modifications to the original code or not, so I tested the original MaulerDemon and it has the same exact issue.

I took a look to the ZSCRIPT then and found this: 

Spoiler

See:
    MAUD AABBCCDD 2
    { //Thanks to Blue Shadow for this routine
      statelabel st = null; //Default to no missile state
      if (CheckIfCloser(target, 224)) //If we're close enough to charge
        st = "Missile"; //Then set missile state so we can charge
      A_Chase("Melee", st); //And chase
    }
    Loop;

 

And I think this is the solution to the machinegun bites attack issue, but it's only doable in ZSCRIPT, so this is (probably) your only option.

Share this post


Link to post
13 hours ago, Kan3 said:

Ok, I've took a look at it and made a few changes cause there was unnecessary stuff.

Here's the code if you want to take a look at:

  Reveal hidden contents


ACTOR MaulerDemon : Demon 13000
{              
	//$Category Monsters
   Health 300 
   PainChance 90 
   Speed 15 
   Radius 34 
   Height 56 
   Mass 450
   Monster
   Scale 1.5
   +FLOORCLIP 
   +DONTHURTSPECIES
   Obituary "%o foi atravessado pelos chifres do demonio estraçalhador."
   HitObituary "%o foi brutalizado pelo demonio estraçalhador"
   tag "MaulerDemon"
   Species "Demon"
   Scale 1.20
   States 
   { 
   Spawn: 
      MAUD AB 10 A_Look 
      Loop 
   See: 
      MAUD AABBCCDD 2 A_Chase 
      Loop 
   Melee:
      MAUD EF 4 A_FaceTarget 
	  MAUD G 6 A_CustomMeleeAttack(random (10, 15)*4, "demon/melee", "demon/melee")
      Goto See 
   Missile: 
      MAUD E 0 A_Jumpifcloser(220, 2)
      Goto See
      MAUD E 8 A_FaceTarget 
      TNT1 A 0 A_CustomMissile("DemonAttack",30,0,0)
      MAUD F 10 A_SkullAttack
      MAUD G 5 A_Gravity
      MAUD E 0 A_Jumpifcloser(48, "Melee")
      Goto See 
   Pain: 
      MAUD H 2 
      MAUD H 2 Fast A_Pain 
      Goto See 
   Death: 
      MAUD I 8 
      MAUD J 8 A_Scream 
      MAUD K 4 
      MAUD L 4 A_Fall 
      MAUD M 4 
      MAUD N -1 
      Stop 
   Raise: 
      MAUD N 5 
      MAUD MLKJI 5 
      Goto See 
   } 
}

ACTOR DemonAttack
{
	Radius 24
	Height 8
	Projectile 
    Speed 20
    Damage (random(1,2)*2)
	+ALLOWTHRUFLAGS
	+MTHRUSPECIES
	DontHurtShooter
	+NODAMAGETHRUST
	States
	{
	Spawn:
		TNT1 A 10
		TNT1 A 10 A_ChangeFlag("NOGRAVITY", FALSE)
	Stop
	}
}

Species shouldn't be necessary since you're inheriting from the Demon class, but we never know.

 

I tested it like this and it works, kinda...

I unfortunately found out that the "killing machine" issue is inevitable (?) in DECORATE.

I couldn't figure out if it was cause of my modifications to the original code or not, so I tested the original MaulerDemon and it has the same exact issue.

I took a look to the ZSCRIPT then and found this: 

  Reveal hidden contents


See:
    MAUD AABBCCDD 2
    { //Thanks to Blue Shadow for this routine
      statelabel st = null; //Default to no missile state
      if (CheckIfCloser(target, 224)) //If we're close enough to charge
        st = "Missile"; //Then set missile state so we can charge
      A_Chase("Melee", st); //And chase
    }
    Loop;

 

And I think this is the solution to the machinegun bites attack issue, but it's only doable in ZSCRIPT, so this is (probably) your only option.

I managed to solve the A_SkullAttack "bite machine gun" problem, this way 👇

Spoiler

ACTOR MaulerDemon : Demon 13000
{              
	//$Category Monsters
   Health 300 
   PainChance 90 
   Speed 15 
   Radius 34 
   Height 56 
   Mass 450
   DamageType Bite
   Monster
   Scale 1.5
   +FLOORCLIP 
   +DONTHURTSPECIES
   SeeSound "demon/sight" 
   AttackSound "demon/melee" 
   PainSound "demon/pain" 
   DeathSound "demon/death" 
   ActiveSound "demon/active" 
   Obituary "%o was gored by a Mauler Demon."
   HitObituary "%o was mauled by a Mauler Demon."
   tag "MaulerDemon"
   Scale 1.20
   States 
   { 
   Spawn: 
      MAUD AB 10 A_Look 
      Loop 
   See: 
      MAUD AABBCCDD 2 A_Chase 
      Loop 
   Melee:
      MAUD EF 4 A_FaceTarget 
	  MAUD G 6 A_CustomMeleeAttack(random (10, 15)*4, "demon/melee", "demon/melee", Bite)
      Goto See 
   Missile: 
      MAUD E 0 A_Jumpifcloser(200, 2)
	  MAUD E 0 A_Jumpifcloser(10, "Melee")
      Goto See
      MAUD E 4 A_FaceTarget 
      TNT1 A 0 A_CustomMissile(DemonAttack,30,0,0)
	  MAUD F 10 A_SkullAttack(15)
      MAUD G 5 A_Gravity
	  MAUD E 0 A_Jump(256, "Melee")
      Goto See
   Pain: 
      MAUD H 2 
      MAUD H 2 Fast A_Pain 
      Goto See 
   Death: 
      MAUD I 8 
      MAUD J 8 A_Scream 
      MAUD K 4 
      MAUD L 4 A_Fall 
      MAUD M 4 
      MAUD N -1 
      Stop 
   Raise: 
      MAUD N 5 
      MAUD MLKJI 5 
      Goto See 
   } 
}

ACTOR DemonAttack
{
	health 20
	Radius 12
	Height 48
	DamageType Bite
	Projectile 
    Speed 50
    Damage (random(3,5)*2)
	DontHurtShooter
	SeeSound "none"
	DeathSound "none"
	Decal "none"
	+ALLOWTHRUFLAGS
	+MTHRUSPECIES
	+NODAMAGETHRUST
	States
	{
	Spawn:
		TNT1 A 10
		TNT1 A 10 A_ChangeFlag("NOGRAVITY",false)
	Stop
	}
}

 

The first week I started to insert monsters in my wad I tried to use zscript, but I had problems in UBD when I wanted to add other monsters in MAPINFO. In the future maybe I can try again, when I want to use a functionality that doesn't have in decorate but has in zscript.

Thanks for the help, I think I got as close to what I wanted. :')

Edited by K_Doom : edit

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×