[Latest] Psychic Sigil 1 does not damage Spectres

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

[Latest] Psychic Sigil 1 does not damage Spectres

Post by Xaser »

I've run into a major problem in Psychic. that I can't fix at all mod-side.

The mod redefines the Sigil for Strife, but the new version ("PsySigil") cannot actually inherit from Sigil because it needs to inherit from Psychic's base weapon definition to allow casing of altfires. Everything works as expected except for A_FireSigil1 emulation, which results in a nasty bug in which Spectres are unkillable due to the way the SPECTRAL flag is handled.

The problem is on line 989 of p_interaction.cpp, in the function P_DamageMobj:

Code: Select all

...
else if (target->flags4 & MF4_SPECTRAL)
{
	if (inflictor->FriendPlayer == 0 && !target->IsHostile(inflictor)) // Line 989
		return;
}
...
The problem is that any attempt to A_FireCustomMissile a SpectralLightningSpot results in the projectiles "forgetting" which player shot it (i.e. inflictor->FriendPlayer becomes zero) and causing the check on Line 989 to 'pass' and break out of P_DamageMobj. This results in a SPECTRAL projectile which successfully impacts the monster but deals no damage.

I thought the trouble with SpectralLightningSpot was due to it not actually being a projectile, but I've tried redefining it with +MISSILE (and +FLOORHUGGER and a bunch of A_ScaleVelocity hacks) and using A_SpawnItemEx with SXF_TRANSFERPOINTERS to spawn the SpectralLightningV1/V2 projectiles, but no matter what I do, I can't get the engine to pass the check.

The purpose of this check, if I'm interpreting it correctly, is to not take damage from Spectral projectiles unless a player fired it or the monster who shot it is hostile toward the target, presumably to prevent infighting between Spectres and EntitySecond actors unless Thing_Hate is used. The trouble is that it also cancels damage from this projectile in a way I cannot figure out how to fix, and some way around this or alternative to this hardcoded check would be most welcome. As-is, I cannot figure out how on Earth to emulate Sigil 1's attack without running into this issue, which throws a monkey wrench into Strife modding.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48508
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Latest] Psychic Sigil 1 does not damage Spectres

Post by Graf Zahl »

Try giving the spot a +SEEKERMISSILE flag (but not +MISSILE!)

It uses the 'tracer' field to track its player and that's not set unless you declare your missile to be able to seek.
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: [Latest] Psychic Sigil 1 does not damage Spectres

Post by Xaser »

No dice. I have it set on both of them and it doesn't seem to make a difference. I am using Linetarget to doublecheck if the Spectre has actually lost any health, and it remains the same.
User avatar
randi
Site Admin
Posts: 7731
Joined: Wed Jul 09, 2003 10:30 pm

Re: [Latest] Psychic Sigil 1 does not damage Spectres

Post by randi »

This is because SpectralLightningSpot isn't spectral. It's just a spot displayed for effect. You can add +SPECTRAL to your subclasses, and they'll get their FriendPlayer set when spawned.
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: [Latest] Psychic Sigil 1 does not damage Spectres

Post by Xaser »

Ah, thanks -- that fixed it. Surprised it never had it set, though, even moreso now that the original worked anyway. A_FireSigil1 is doing some wizardry.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48508
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Latest] Psychic Sigil 1 does not damage Spectres

Post by Graf Zahl »

No, it doesn't. The way this function works it just doesn't need that flag on the spot.
However, if you use some of the generic functions it can't do the same assumptions.

Return to “Closed Bugs [GZDoom]”