Reduce the amount of bullet holes - help

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
User avatar
Niphura
Posts: 192
Joined: Fri Jun 16, 2017 3:07 pm
Location: Argentina

Reduce the amount of bullet holes - help

Post by Niphura »

Is there any way to spawn less bullet holes when shooting weapon?

and also, is there any way to spawn 3d bulletholes like this?:

https://www.ixbt.com/video2/images/tech ... _pm_03.jpg
User avatar
Caligari87
Admin
Posts: 6191
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Reduce the amount of bullet holes - help

Post by Caligari87 »

Niphura wrote:Is there any way to spawn less bullet holes when shooting weapon?
Yes. You can set cl_maxdecals to however many or few decals you want at one time.
Niphura wrote:and also, is there any way to spawn 3d bulletholes like this?:
No. That's parallax/depth mapping and it's not supported by GZDoom.

8-)
User avatar
Niphura
Posts: 192
Joined: Fri Jun 16, 2017 3:07 pm
Location: Argentina

Re: Reduce the amount of bullet holes - help

Post by Niphura »

Caligari87 wrote:
Niphura wrote:Is there any way to spawn less bullet holes when shooting weapon?
Yes. You can set cl_maxdecals to however many or few decals you want at one time.
Niphura wrote:and also, is there any way to spawn 3d bulletholes like this?:
No. That's parallax/depth mapping and it's not supported by GZDoom.

8-)
What I want to achieve is that when firing a gun the bullet holes appear sometimes and other times no, does the cl_maxdecals line can help me to do this? i must use decorate or acs to apply that line?
User avatar
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

Re: Reduce the amount of bullet holes - help

Post by Matt »

What are the circumstances under which you want them to appear or not appear?

How much is this going to be replacing? (are you doing a whole new weapon, or trying to see if this can be done without resorting to a new weapon?)
User avatar
Niphura
Posts: 192
Joined: Fri Jun 16, 2017 3:07 pm
Location: Argentina

Re: Reduce the amount of bullet holes - help

Post by Niphura »

Matt wrote:What are the circumstances under which you want them to appear or not appear?

How much is this going to be replacing? (are you doing a whole new weapon, or trying to see if this can be done without resorting to a new weapon?)
For example when shooting at the walls the bulletholes sometimes appear and sometimes not. This will happen in the following way: the gun fires at the wall and the bullet hole appears, the gun fires again at the wall, but this time the bullet hole does not appear. Is this possible to do?
User avatar
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

Re: Reduce the amount of bullet holes - help

Post by Matt »

Best to just replace the puff and randomly call [wiki]A_SprayDecal[/wiki] directly from it.

(make sure you set the angle first)
User avatar
Niphura
Posts: 192
Joined: Fri Jun 16, 2017 3:07 pm
Location: Argentina

Re: Reduce the amount of bullet holes - help

Post by Niphura »

Matt wrote:Best to just replace the puff and randomly call [wiki]A_SprayDecal[/wiki] directly from it.

(make sure you set the angle first)
The line "A_SprayDecal" can be used in decorate? in the line of "fire:" right? I am a beginner
User avatar
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

Re: Reduce the amount of bullet holes - help

Post by Matt »

Yes. Just like any other DECORATE function. I would suggest a range of at least 8 to make sure the decal gets sprayed (or you could even try "randompick(8,0)" for the length as a way of randomizing it)

And to make it face the right way it should call A_FaceTarget then change its angle to its current angle plus 180.

Return to “Scripting”