A_SkullAttack behavior
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!)
-
Boondorl
- Posts: 195
- Joined: Wed Jul 11, 2018 10:57 pm
A_SkullAttack behavior
Is it possible to interrupt A_SkullAttack without accidentally breaking it? For instance, let's say I want a Lost Soul to only travel a certain duration with it. I put in a timer that increases every loop in the specific part of the Missile state and, if it reaches the threshold, jumps back to the See state. To my knowledge A_SkullAttack is broken into two parts, the part that sends the enemy flying at its target, and the actual slam when hitting something. Will the second half of this part give any undefined behavior when using this method? E.g. running into the Lost Soul even after the Missile state is cancelled still causing the player to take damage.
-
Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
Re: A_SkullAttack behavior
An actor being treated as a missile for collisions after A_SkullAttack is caused by the SKULLFLY flag. Actually, it's completely independent of A_SkullAttack - if the SKULLFLY flag is set by other means, it'll work perfectly fine.
The SKULLFLY flag is automatically unset after the actor tries to move during a tic but doesn't travel any distance along the XY plane. This means that, typically, just reducing the actor's velocity to 0 is enough to do the trick, but there's a small quirk where this won't happen if the actor is being moved by carrying sector ( since, after all, that means it's traveling some amount of distance in that tic ). Also, having the flag unset this way also forces the actor into its See, Idle, or Spawn state, depending on which ones it has. So if you want the actor to instead cancel the charge into a different state, or you want to make absolute sure that the actor won't charge more than the exact distance you want it to, manually unsetting the flag ( through [wiki]A_ChangeFlag[/wiki] or ZScript's direct flag manipulation, depending on what you're using ) is the way to go.
The SKULLFLY flag is automatically unset after the actor tries to move during a tic but doesn't travel any distance along the XY plane. This means that, typically, just reducing the actor's velocity to 0 is enough to do the trick, but there's a small quirk where this won't happen if the actor is being moved by carrying sector ( since, after all, that means it's traveling some amount of distance in that tic ). Also, having the flag unset this way also forces the actor into its See, Idle, or Spawn state, depending on which ones it has. So if you want the actor to instead cancel the charge into a different state, or you want to make absolute sure that the actor won't charge more than the exact distance you want it to, manually unsetting the flag ( through [wiki]A_ChangeFlag[/wiki] or ZScript's direct flag manipulation, depending on what you're using ) is the way to go.