Is it possible to have an enemy shoot and run at you at the same time?
I want to try and make a zombieman type enemy that has the ability to shoot and run (complete with actual running+shooting sprites) towards the player at the same time. Would this be possible to make through DECORATE?
Is it possible to make enemies run + shoot you at same time?
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!)
- lizardcommando
- Posts: 1489
- Joined: Thu Sep 07, 2006 12:24 pm
- Location: Boringland, California
Re: Is it possible to make enemies run + shoot you at same t
It is perfectly possible.
One thing you can do is put calls to [wiki]A_Chase[/wiki] in their attack state sequence. Use the melee and missile parameters to prevent these calls from jumping to the attack state.
One thing you can do is put calls to [wiki]A_Chase[/wiki] in their attack state sequence. Use the melee and missile parameters to prevent these calls from jumping to the attack state.
Re: Is it possible to make enemies run + shoot you at same t
You pass null for the states that are entered if the monster attacks, so it only moves. Combine that with an attack at the same time by using 0-duration frames. A_Wander could be used for a more random movement. Note that This will not check if the monster can actually see it's target, so you might want to add some conditions for that, otherwise the monster might shoot at walls betwen itself and it's target while chasing it. The wiki article on A_Chase also lists flags that could be useful for controlling turning behavior.
A_Chase
Code: Select all
POSS A 0 A_Chase(null, null)
POSS A 0 A_FaceTarget
POSS A 3 A_PosAttack
Re: Is it possible to make enemies run + shoot you at same t
In DECORATE, use "" instead of null.
Re: Is it possible to make enemies run + shoot you at same t
Yarp. I've used A_Chase ("","") many times before in DECORATE. Works perfectly.