Page 1 of 1
[Question] Monster Killed By Friendly Does Not Add to Count
Posted: Wed Jul 25, 2018 4:00 pm
by That Blind Guy
The subject line says it all.
-Attack certain monsters until their health reaches a certain point where they effectively switch sides.
-Said monster starts shooting other monsters.
-This does not contribute toward 100% kills
This is kind of important, because my mod rewards completion of maps, including a health upgrade for 100% kills. How do I go about fixing this?
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Thu Jul 26, 2018 12:31 am
by Blue Shadow
As far as I know, a hostile monster should count towards the map's kills as long as it has the COUNTKILL flag, regardless of the means it was killed by.
How are you setting all this up (code-wise, I mean)?
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Thu Jul 26, 2018 3:29 am
by That Blind Guy
Blue Shadow wrote:As far as I know, a hostile monster should count towards the map's kills as long as it has the COUNTKILL flag, regardless of the means it was killed by.
How are you setting all this up (code-wise, I mean)?
It's all handled in the Missile state and a custom one. It acts more like confusion, since they'll re-acquire targets after every shot. It applies to Mancubi and Revenants, so here's the DECORATE code from the Mancubus.
Code: Select all
Missile:
FATT G 20 A_FatRaise
FATT H 10 bright A_FatAttack1
FATT IG 5 A_FaceTarget
FATT H 10 bright A_FatAttack2
FATT IG 5 A_FaceTarget
FATT H 10 bright A_FatAttack3
FATT IG 5 A_FaceTarget
FATT G 0 A_JumpIfHealthLower(300, "ClearTarget")
goto See
ClearTarget:
DAED G 0 A_ChangeFlag("FRIENDLY", true)
FATT G 1 A_ClearTarget
Goto See
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Fri Jul 27, 2018 1:28 am
by Blue Shadow
I couldn't produce the issue you describe, I'm afraid. The monster kill count was always correct during my testing.
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Fri Jul 27, 2018 1:39 am
by Graf Zahl
Posting code fragments is never going to help.
But this one may contain a hint: Your code changes the FRIENDLY flag during gameplay and this affects how a monster affects kill %. When killed while friendly the kill won't register on the counter.
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Fri Jul 27, 2018 2:16 am
by Blue Shadow
That shouldn't affect the ability to get 100% kills in the end, since the monster is completely excluded from the total monster count when it turns friendly.
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Fri Jul 27, 2018 5:44 am
by That Blind Guy
Blue Shadow wrote:That shouldn't affect the ability to get 100% kills in the end, since the monster is completely excluded from the total monster count when it turns friendly.
The monster total does decrement when they turn friendly, but anything they kill won't add to the kill counter.
I'll just try a different effect for Mancubi and Revenants if there's nothing that can be done about this.
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Fri Jul 27, 2018 9:47 am
by Blue Shadow
My tests were done using that piece of code. All the monsters the friendly-turned monster killed counted as kills.
You might want to upload your mod for debugging.
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Fri Jul 27, 2018 1:12 pm
by That Blind Guy
Blue Shadow wrote:My tests were done using that piece of code. All the monsters the friendly-turned monster killed counted as kills.
You might want to upload your mod for debugging.
Don';t know why I didn't think of this earlier. I would be willing to bet it has something to do with the spawners. They're not RandomSpawner derivatives (an artifact of previous incarnations of the mod, QuakeStyle and QuakeStyle ZX), and they have produced strange issues before.
I'm gonna give this one last shot at fixing, then put it up for debugging.
Re: [Question] Monster Killed By Friendly Does Not Add to Co
Posted: Sun Jul 29, 2018 9:07 am
by That Blind Guy
I am a complete idiot...
I was looking at the wrong counter the whole time (my handle is actually true; I can barely see 3 feet in front of me

). The missing monsters were ones that failed to go through trap teleporters. I got frustrated and gave up on turning monsters friendly, changed it for something else, then noticed I was looking at the item counter just now. Oh well, I'm not putting it back in.
Nine years as a programmer, one of the top coders at my university, and I still do stuff like this.