Scenario: Player shoots and takes cover behind a corner.
Zombiemen/imps occasionally fire where the player was last seen
........(P).(x)
========..........=
..........=..........=
..........=..........=
..........=..........=
.......=..............=
.............(E)..(E).....
Remember the last seen location of target and fire near it. Occasional firing strifes in anticipation of the player.
Supressive fire
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!)
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Supressive fire
A rough framework:
Define a vector3 that can store the target's position (plus half to 60% of its height)
In its see and attack states, have it check if the target is in sight, and:
1. if the target is in sight, update that vector3 and continue to the rest of its see/attack state
2. if NOT in sight, randomly continue to the rest of its see/attack state OR go to its suppressive fire state
In its suppressive fire state, face towards that stored vector3 and make an attack (making sure the appropriate flags are set so it doesn't autoaim the target).
Once that attack sequence is finished, check if the target is in sight, as above.
Define a vector3 that can store the target's position (plus half to 60% of its height)
In its see and attack states, have it check if the target is in sight, and:
1. if the target is in sight, update that vector3 and continue to the rest of its see/attack state
2. if NOT in sight, randomly continue to the rest of its see/attack state OR go to its suppressive fire state
In its suppressive fire state, face towards that stored vector3 and make an attack (making sure the appropriate flags are set so it doesn't autoaim the target).
Once that attack sequence is finished, check if the target is in sight, as above.