A_SpawnItemEx ceiling problem

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Melvinflynt
Posts: 184
Joined: Wed Aug 29, 2007 4:47 pm
Location: Texas

A_SpawnItemEx ceiling problem

Post by Melvinflynt »

I have some actors that use the A_SpawnItemEx whenever they die to turn into another actor. For example I started using this for actor's freeze death so that I could do some custom stuff when they shatter or for an actor to resurrect themselves.

The problem I've just noticed is that whenever the actor is at height 72 in a sector with the height of 96. Whenever the actor goes into A_SpawnItemEx, they disappear. So I did a little test and reduced the height of the actor that was spawned from 72 to 56 and it solved the problem. Then I was thinking what's going to happen when the actor is in a sector where the height is as low as 56 or 64 so I need a different solution. I was thinking maybe somehow giving the actor that is spawned a flag where it's like a ghost and can go through ceilings and then change the flag back as soon as it's on it's feet.

Also I've been doing research and I think if I have it set with noblocking flag this would work, but is there a way to clear that flag after?

Below is the actor that does the A_SpawnItemEx
Spoiler:
and the actor that is spawned
Spoiler:
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: A_SpawnItemEx ceiling problem

Post by FDARI »

If you don't need the spawned actor to be in a valid position, you could use "SXF_NOCHECKPOSITION" in [wiki]A_SpawnItemEx[/wiki]. If it still dies, disappears or fails to spawn without fulfilling its purpose you can give the spawned actor +NOINTERACTION (no regular physics apply, if the actor has a speed it moves straight ahead every tic) or possibly +NOCLIP (might help on height checks, might not; makes actor go through stuff). Does any of that work for you?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: A_SpawnItemEx ceiling problem

Post by NeuralStunner »

So, you spawn a 72-unit tall actor in a sector 96 units tall. 96 - 72 = 24. You spawn it at a Z height of 28 units, which is 4 units too high for the actor to successfully spawn. Making the spawned actor 56 units tall gives you a 40 unit leeway.

So you can either:
  • Reduce the spawned actor's height by a few units.
  • Spawn it a few units lower.
  • Spawn it at 0 and use sprite offsets to line it up how you need it. (The less desirable option, as it results in screwy hitboxes.)
User avatar
Melvinflynt
Posts: 184
Joined: Wed Aug 29, 2007 4:47 pm
Location: Texas

Re: A_SpawnItemEx ceiling problem

Post by Melvinflynt »

FDARI wrote:If you don't need the spawned actor to be in a valid position, you could use "SXF_NOCHECKPOSITION" in [wiki]A_SpawnItemEx[/wiki]. If it still dies, disappears or fails to spawn without fulfilling its purpose you can give the spawned actor +NOINTERACTION (no regular physics apply, if the actor has a speed it moves straight ahead every tic) or possibly +NOCLIP (might help on height checks, might not; makes actor go through stuff). Does any of that work for you?
SXF_NOCHECKPOSITION worked like a charm. I even tested it to see if it would work if the ceiling was so low that the enemy was stuck like 48 height and it still worked. I was thinking the noclip flag would work but that didn't do it. Thanks a bunch!
Locked

Return to “Editing (Archive)”