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

A_PainAttack spawning projectile monster inside calling monster

Question

I have a monster type calling A_PainAttack in its missile state passing only another actor type as an argument in one case, and passing ("[MonsterName2]", 0,  PAF_NoSkullAttack) in another. Regardless, the spawned monster appears to spawn at the midpoint of the calling monster, and goes into the death animation. The calling and spawning monsters both have a radius of 16, though i have increased the calling monster to 20 and 31 just to see if that was the issue. This is being done in heretic if that is relevant. Seems like it should be simple but the function being called basically as normally as possible is failing to work.

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0

I have no idea if it would help, but I vaguely remember something which may help.

 

 

Archvile fire is replaced with a revenant missile, given negative speed and calls A_Chase (Codep Frame = 176) for several frames which moves backwards because of the negative speed, thus away from the player, then calls SpawnFly (Codep Frame = 788) to spawn an enemy.

 

All right, so what if you have your missile call A_Chase for several frames (experiment with the amount of frames needed) before calling A_PainAttack?

 

 

Share this post


Link to post
  • 0
1 hour ago, Stabbey said:

I have no idea if it would help, but I vaguely remember something which may help.

...

All right, so what if you have your missile call A_Chase for several frames (experiment with the amount of frames needed) before calling A_PainAttack?

This seems more about dehacked, I am using DECORATE (probably should have specified, also yes I am going to learn zscript eventually get off my back) and, by appearances used it exactly like how it's called in the Pain Elemental definition. I'd like to know how it actually works in the future but in the meantime I got equivalent behavior from A_SpawnItemEx

Share this post


Link to post
  • 0

That's an odd thing to have happen -- I've done a similar enemy in Heretic and had no problem just using A_PainAttack.

 

My code has always been a little bit more complex, because it's chosen randomly between a couple different enemy variants, switched to an alternate attack based on range, and now that it's in ZScript it's got some additional complexity and polish to it. But here's what it looked like back when it was in Decorate:
 

 Missile:
    STLI A 0 A_JumpIfCloser (164, "Missile3")
    STLI A 0 A_Jump (128, "Missile2")
    STLI A 5 A_FaceTarget
    STLI B 20 BRIGHT A_PainAttack("HereticImpLeader2", 0)
    Goto See


There's really nothing special about it at all. I wonder if it's actually the "NoSkullAttack" flag that's causing you trouble? The Pain Elemental's attack was kind of designed around that, so if you want simpler enemy spawns that don't throw the spawned minion at the player, you could probably just use something like A_SpawnItemEx, which I think lets you set an offset relative to the spawner and useful stuff like that. (oh, nevermind, you already did that)

Edited by Not Jabba

Share this post


Link to post
  • 0
10 minutes ago, Not Jabba said:

There's really nothing special about it at all. I wonder if it's actually the "NoSkullAttack" flag that's causing you trouble?..

Yeah I am not sure, 3/4 of the time it should be spawning one with it. I did implement it with A_SpawnItemEx but heres the code if you can figure out how I fucked up?

 

ACTOR MetaGargoyle : HereticImpLeader 7108
{
  Health 160
  Radius 16
  PainChance 128
  DeathSound "misc/teleport"
  States
  {
  Missile:
    IMPX D 6 A_FaceTarget
	IMPX E 3 A_FaceTarget
	IMPX E 3 A_Jump(64, "SpawnFireG")
	IMPX F 6 A_SpawnItemEx("GargoyleSpawn", 36, 0, 0, 0, 0, 0, 0, SXF_TransferPointers | SXF_NOCHECKPOSITION)
//	IMPX F 6 A_PainAttack("GargoyleSpawn")
	Goto See
  SpawnFireG:
//	IMPX F 6 A_PainAttack("GargoyleLeaderSpawn", 0, PAF_NOSKULLATTACK)
	IMPX F 6 A_SpawnItemEx("GargoyleLeaderSpawn", 36, 0, 0, 0, 0, 0, 0, SXF_TransferPointers | SXF_NOCHECKPOSITION)
    Goto See
  XDeath:
  XCrash:
  Crash:
  Death:
    IMPX G 0 Bright
	{
	  A_Scream;
	  A_NoBlocking;
	  A_SpawnItemEx("MetaDeathPuff", 0, 0, 8);
	}
	Stop
  }
}

GargoyleSpawn and GargoyleLeaderSpawn are just copies of HereticImp and HereticImpLeader with different death states so they dont leave a corpse

Share this post


Link to post
  • 0

In the original code it looks like the spawned actor was given a pre-step based on both the radius of the calling actor, and the radius of a lost soul specifically. Also, the spawned actor would be immediately given 10k damage if it failed to move (this is how lost souls die in the walls instead of just getting stuck). Is your actor stationary by any chance?

 

Anyway, using the generalized actions is almost always a better practice regardless.

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
×