Making a Flashbang - Solved -

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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.

Making a Flashbang - Solved -

Postby Niphura » Tue Dec 04, 2018 12:11 pm

I found a easier way to make a flashbang based on Radius and damagetype 8-)
Last edited by Niphura on Sat Dec 15, 2018 1:19 pm, edited 1 time in total.
User avatar
Niphura
 
Joined: 16 Jun 2017
Location: Argentina
Discord: ---

Re: Making a Flashbang (questions)

Postby Caligari87 » Thu Dec 06, 2018 11:24 am

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 A_JumpIfInTargetLOS 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.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Making a Flashbang (questions)

Postby Niphura » Thu Dec 06, 2018 11:41 am

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 A_JumpIfInTargetLOS 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.

8-)


Can A_CheckSight help? i don't quite understand his function
User avatar
Niphura
 
Joined: 16 Jun 2017
Location: Argentina
Discord: ---


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest