Help with infighting / friendly fire
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- Curunir
- Posts: 1041
- Joined: Sun Nov 02, 2003 11:24 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Help with infighting / friendly fire
I am in a bit of a pickle.
I have a bunch of pre-existing monsters that have relatively low HP and tend to kill each other on the first instance of friendly fire. I looked into ways to stop that but it seems neither +NOTARGET for the actors, nor "NoInfighting" in MAPINFO will get the job done. The hitscanners fire A_CustomBulletAttacks and the ranged things use A_CustomMissileAttack, if it makes any difference.
Ideally, I want nobody to be able to harm anybody else. JUST hitscanners never damaging anything, even if the missile-firing actors do cause damage and / or infighting is also ok.
Do I use "species" actor properties to set this up and just add every enemy to the same species? The enemies currently have no species property defined.
I have a bunch of pre-existing monsters that have relatively low HP and tend to kill each other on the first instance of friendly fire. I looked into ways to stop that but it seems neither +NOTARGET for the actors, nor "NoInfighting" in MAPINFO will get the job done. The hitscanners fire A_CustomBulletAttacks and the ranged things use A_CustomMissileAttack, if it makes any difference.
Ideally, I want nobody to be able to harm anybody else. JUST hitscanners never damaging anything, even if the missile-firing actors do cause damage and / or infighting is also ok.
Do I use "species" actor properties to set this up and just add every enemy to the same species? The enemies currently have no species property defined.
- MFG38
- Posts: 414
- Joined: Sun Apr 14, 2019 8:26 am
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Finland
- Contact:
Re: Help with infighting / friendly fire
How about the +NOINFIGHTING flag?
EDIT: Now that I fully understood what you're looking for, I think a combination of the Species actor property with the same species name for each monster type and the +DONTHARMSPECIES flag should do the trick.
EDIT: Now that I fully understood what you're looking for, I think a combination of the Species actor property with the same species name for each monster type and the +DONTHARMSPECIES flag should do the trick.
Re: Help with infighting / friendly fire
Another approach is to make the enemies do damage of a particular custom type and then make them immune to that damage type. That allows monsters of different species to be immune to each other. Depends on exactly what's needed really I guess.
- Curunir
- Posts: 1041
- Joined: Sun Nov 02, 2003 11:24 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Help with infighting / friendly fire
Wiki says DONTHARMSPECIES only affects "receiving explosive damage by a projectile fired by a monster of the exact same kind", so it definitely wouldn't work on hitscanners.
Seems like Species won't do it either - "This determines infighting behavior, since a monster's missile do not inflict harm (except through splash damage) to other monsters belonging to the same species by default."
Edit: Posted as Enjay was typing. How would I set the damage type of the hitscanners I need to change as a baseline goal?
Seems like Species won't do it either - "This determines infighting behavior, since a monster's missile do not inflict harm (except through splash damage) to other monsters belonging to the same species by default."
Edit: Posted as Enjay was typing. How would I set the damage type of the hitscanners I need to change as a baseline goal?
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Help with infighting / friendly fire
Sir Enjay absolutelly right. Only one (or a few) custom damagetype for all monsters with zero damagefactor to that damage type(s) can prevent from getting friendly fire damage.
For hitscan attacks (bullet\rail) its damage type should be declared directly in puff.
Other hacky way is setting of +(M)THRUSPECIES flag to puffs and projectiles, while all monsters should be united via shared species. But this solution will extremely unfair for player since all missiles and hitscans wouldn't blocked by other bodies of other monsters, so way with custom damagetype is better.
For hitscan attacks (bullet\rail) its damage type should be declared directly in puff.
Other hacky way is setting of +(M)THRUSPECIES flag to puffs and projectiles, while all monsters should be united via shared species. But this solution will extremely unfair for player since all missiles and hitscans wouldn't blocked by other bodies of other monsters, so way with custom damagetype is better.
- Curunir
- Posts: 1041
- Joined: Sun Nov 02, 2003 11:24 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Help with infighting / friendly fire
I really can't figure out how to do this. I looked at the bulletpuff page and the actor properties page on the wiki but I still have no idea how to set the damage type for the puff actor.
Re: Help with infighting / friendly fire
Have you tried putting DamageType property on the puff?
- Curunir
- Posts: 1041
- Joined: Sun Nov 02, 2003 11:24 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Help with infighting / friendly fire
Well, that wasn't great... Now I can't damage the hitscanners that I gave immunity with my own weapons...
Can't really be bothered to rework so much of the mod for that effect, to be honest. I will just settle with MAPINFO noinfighting, which should reduce cheesing possibilities at least a little.
Can't really be bothered to rework so much of the mod for that effect, to be honest. I will just settle with MAPINFO noinfighting, which should reduce cheesing possibilities at least a little.
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Help with infighting / friendly fire
Obviously you should create a custom puff (look into Using inheritance article) for monsters (harmless for them self), while default BulletPuff (player's) will inflict regular damage to monsters.
- Curunir
- Posts: 1041
- Joined: Sun Nov 02, 2003 11:24 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Help with infighting / friendly fire
It's how the mod is set up, I think - its custom puff replaces the game's default BulletPuff and it's also used by the monsters. Again, I just don't want to twat about so much with that, I can live with just no retaliation and infighting, even if enemies do damage each other.
Curious that a global toggle for this has not yet been implemented.
Curious that a global toggle for this has not yet been implemented.
- Curunir
- Posts: 1041
- Joined: Sun Nov 02, 2003 11:24 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Help with infighting / friendly fire
So, I did this, gave both the hitscan humans "Species Humans" and "+NOINFIGHTSPECIES".
Even with that, when one tags the other with a bullet, they aggro on each other. What am I doing wrong here?
I am doing it per-species because there are more creatures that I want to put in a different species and have them not fight each other as well, but the hitscanners are turning on each other when they take damage, so...
Edit: The mod and Deco monsters author - @Vostyok helped me out and wrote the new puff for me. The solution was indeed a custom puff, I just couldn't figure out how to set it up without breaking anything.
Actor VulturePuff: Hitpuff
{
Damagetype Raiders
}
Then the hitscanning enemies were given the new puff in their firing frames, as well as a "DamageFactor "Raiders", 0" in their definition and it works now. They still produce blood when they shoot each other but don't lose health and don't aggro on each other.
I'm leaving this here for future reference, as I myself have found the answers to a bunch of questions by digging through old posts.
Even with that, when one tags the other with a bullet, they aggro on each other. What am I doing wrong here?
I am doing it per-species because there are more creatures that I want to put in a different species and have them not fight each other as well, but the hitscanners are turning on each other when they take damage, so...
Edit: The mod and Deco monsters author - @Vostyok helped me out and wrote the new puff for me. The solution was indeed a custom puff, I just couldn't figure out how to set it up without breaking anything.
Actor VulturePuff: Hitpuff
{
Damagetype Raiders
}
Then the hitscanning enemies were given the new puff in their firing frames, as well as a "DamageFactor "Raiders", 0" in their definition and it works now. They still produce blood when they shoot each other but don't lose health and don't aggro on each other.
I'm leaving this here for future reference, as I myself have found the answers to a bunch of questions by digging through old posts.
