Making a Flashbang - Solved -
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!)
Making a Flashbang - Solved -
I found a easier way to make a flashbang based on Radius and damagetype
Last edited by Niphura on Sat Dec 15, 2018 12:19 pm, edited 1 time in total.
- Caligari87
- Admin
- Posts: 6174
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Making a Flashbang (questions)
For the first: You could spawn a camera at the player's position, angle, and pitch, and put a cameratexture HUDmessage over the screen that slowly fades out. THIS WOULD NOT BE PERFECT, as the camera would still be a "live feed" and you could even potentially see yourself, but it's the only way we have of accomplishing that "afterimage" effect. Something better might be using a postprocess shader to blur or otherwise distort the player's screen while the effect is active.
For the second: You can use [wiki]A_JumpIfInTargetLOS[/wiki] to jump to a state in the grenade only if the player is looking toward it (note this can't use the player's actual FOV because that could cause desyncs, but a generic value like 90 should be fine in most cases). You may need to do some pointer-rearrangement hackery to make sure the grenade's target pointer is actually referring to the player.
Note that this would probably be a lot easier in ZScript instead of DECORATE + ACS as more robust scripting options are available.
For the second: You can use [wiki]A_JumpIfInTargetLOS[/wiki] to jump to a state in the grenade only if the player is looking toward it (note this can't use the player's actual FOV because that could cause desyncs, but a generic value like 90 should be fine in most cases). You may need to do some pointer-rearrangement hackery to make sure the grenade's target pointer is actually referring to the player.
Note that this would probably be a lot easier in ZScript instead of DECORATE + ACS as more robust scripting options are available.
Re: Making a Flashbang (questions)
Caligari87 wrote:For the first: You could spawn a camera at the player's position, angle, and pitch, and put a cameratexture HUDmessage over the screen that slowly fades out. THIS WOULD NOT BE PERFECT, as the camera would still be a "live feed" and you could even potentially see yourself, but it's the only way we have of accomplishing that "afterimage" effect. Something better might be using a postprocess shader to blur or otherwise distort the player's screen while the effect is active.
For the second: You can use [wiki]A_JumpIfInTargetLOS[/wiki] to jump to a state in the grenade only if the player is looking toward it (note this can't use the player's actual FOV because that could cause desyncs, but a generic value like 90 should be fine in most cases). You may need to do some pointer-rearrangement hackery to make sure the grenade's target pointer is actually referring to the player.
Note that this would probably be a lot easier in ZScript instead of DECORATE + ACS as more robust scripting options are available.
Can A_CheckSight help? i don't quite understand his function