so I've an actor (monster) that has a death state that randomly occurs that spawns somthing else when it dies. (using it to spawn a different monster with +/- identical appearance but different attributes to create the illusion that it is actually the same monster but in a different state. for reasons.
however I found it would not spawn said actor over liquids due to floor clipping.
so I raised the height of the spawn position to above the floorclip height and that works.
however, now Ive found that if the actor is too close to a ceiling, essentally in a tight alcove or low ceiling area, when entering this state it cannot spawn the new actor. (not enough room I suppose?) making it seem to dissapear entirely in these situatons.
So what I'm asking is, is there a way to get the spawner to check its enviroment to see if its too close to a ceiling, to jump to another state instead of following through and trying to spawn the actor that wont fit there?
DECORATE only please, project requires zdoom compatibility...
[decorate] HELP! get an actor check if close to a ceiling?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 2062
- Joined: Mon Feb 07, 2011 5:02 am
- Player701
-
- Posts: 1710
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: [decorate] HELP! get an actor check if close to a ceilin
You could use A_JumpIf to compare the Z-coordinate of the actor's top with the Z-coordinate of the ceiling. If you don't want to factor in the actor's height, replace the left side of the expression (before the "<" sign) with just CeilingZ - Z.
Code: Select all
A_JumpIf(CeilingZ - (Z + Height) < 32, "TooClose") // <-- Replace 32 with your own value as needed
Do note, however, that although the example code is in DECORATE, it may not work in ZDoom because it hasn't been updated for a long time. If you cannot run GZDoom on your hardware, try LZDoom instead. If you actually meant Zandronum instead of ZDoom, then the example code should probably work fine.osjclatchford wrote:DECORATE only please, project requires zdoom compatibility...
-
- Posts: 2062
- Joined: Mon Feb 07, 2011 5:02 am
Re: [decorate] HELP! get an actor check if close to a ceilin
many thanks for that.
And no, I do mean zdoom.
never used zandronum or Lzdoom. I figured I'd stick to what I know on the project I'm currently on and keep it gzdoom (as most people use this) but with zdoom compatibility so that it should +/- then work with all derivatives of zdoom... thats the plan anyway.
not an easy task these days, as so many of the improvements to code that leave zdoom in the dust make recreating such things quite hacky but for the most part generally doable with a bit of help from nice folks such as yourself!
in truth I'm +/- exclusively using gzdoom these days.
but, that being said, as the project calls for zdoom backwards compatibility, if i find your solution doesn't work with zD 2.8.1 then I'll just do the cheap thing and make the spawning actor ten units shorter. that should make it prevent the failed spawn but not make it too much shorter to affect its interacivity in an obviously negative manner. for most likely situations. a few very odd possibilities for failure to spawn do still tecnically present themselves (elevators and closing doors/ceilings come to mind) but are, as I say highly unlikely in the normal course of things...
if it does work then groovy no harm done.
thanks again man!
And no, I do mean zdoom.


not an easy task these days, as so many of the improvements to code that leave zdoom in the dust make recreating such things quite hacky but for the most part generally doable with a bit of help from nice folks such as yourself!
in truth I'm +/- exclusively using gzdoom these days.
but, that being said, as the project calls for zdoom backwards compatibility, if i find your solution doesn't work with zD 2.8.1 then I'll just do the cheap thing and make the spawning actor ten units shorter. that should make it prevent the failed spawn but not make it too much shorter to affect its interacivity in an obviously negative manner. for most likely situations. a few very odd possibilities for failure to spawn do still tecnically present themselves (elevators and closing doors/ceilings come to mind) but are, as I say highly unlikely in the normal course of things...
if it does work then groovy no harm done.
thanks again man!