How do i make breakable windows kinda like this?

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!)
Post Reply
User avatar
JetteboyTV
Posts: 53
Joined: Mon Sep 04, 2023 9:17 am

How do i make breakable windows kinda like this?

Post by JetteboyTV »

Screenshot 2023-09-06 222104(1).png
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How do i make breakable windows kinda like this?

Post by ramon.dexter »

You need two textures, one for intact window, the second for broken. Then assemble these two textures as a swicth in ANIMDEFS. later assign this texture to a midtex and flag it "impassable" "block everything", activation by projectile or non projectile on impact and give it action 49 Breakable glass.
User avatar
AshHouswares
Posts: 145
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

Re: How do i make breakable windows kinda like this?

Post by AshHouswares »

JetteboyTV wrote: Wed Sep 06, 2023 9:23 pm Screenshot 2023-09-06 222104(1).png
Make two seperate textures. One normal one broken. For example, call the normal one WINDOW01 and the broken one WINDOW02. You can make them a switchable decoration in a script, using SetLineTexture. For example:

Code: Select all

    SetLineTexture(72,SIDE_FRONT,TEXTURE_MIDDLE,"WINDOW02")
   
Post Reply

Return to “Scripting”