Page 1 of 1
					
				Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 8:30 am
				by Curunir
				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.
			 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 9:05 am
				by MFG38
				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.
			 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 9:40 am
				by Enjay
				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.
			 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 9:43 am
				by Curunir
				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?
			 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 10:02 am
				by Void Weaver
				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.
			 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 10:21 am
				by Curunir
				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
				Posted: Sun Dec 01, 2019 10:29 am
				by Jarewill
				Have you tried putting 
DamageType property on the puff?
 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 11:00 am
				by Curunir
				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.
			 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 11:12 am
				by Void Weaver
				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.
 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 11:33 am
				by Curunir
				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.
			 
			
					
				Re: Help with infighting / friendly fire
				Posted: Sun Dec 01, 2019 3:58 pm
				by Curunir
				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.