https://www.urbanterror.info/support/151-breakable-windows/
 Login | Register 
Advertisement


Level design

Breakable Windows

This tutorial will show you how to add breakable objects into your Urban Terror maps. To make a breakable object follow the steps below. For this tutorial we will create a glass window, but there are other material types that you can use: wood, ceramic, plastic, metal & stone.

Framing Up

In this tutorial we will just make a regular window with breakable glass. I'll assume you know how to make a hole in a wall for a window. I'll be using this example from Bohemia.

Adding a brush

Now for the window, create a brush to exactly fill the hole left for the window. Texture this brush with common/weapclip on all sides except the front and back. Texture the front and back with a glass shader; ut_turnpike/glass_clear will work well. Now we've got a wall, and a window, but it still won't break when you shoot it.

Making it Breakable

Now we'll apply the breakable function. This is done by selecting the window brush, and then right clicking in the 2D window. This should bring up a pop-up menu with all the available entities. Go into the sub-menu func and then select func_breakable. When you've done this successfully, check that you still have the window selected and bring up the Entity properties by pressing N. You need to enter two keys for the breakable to work properly, health and type. First enter type into the 'key' textbox. And then enter 0 into the 'value' textbox. When you've done this, press Enter to add the new key. This will tell Urban Terror that it's supposed to show glass breaking and not wood or plastic. If you want to change the material type just replace the 0 with:

1 for wood
2 for ceramic
3 for plastic.
4 for metal.
5 for metal that breaks only by explosions.
6 for metal that breaks only by a HK69 explosion.
7 for stone that breaks only by explosions.
8 for stone that breaks only by a HK69 explosion.
9 for wood that breaks only by explosions.
10 for wood that breaks only by a HK69 explosion.

Health

OK, now we have a breakable window, but we still need to add some health to it. The health key controls how strong the breakable is. This health value should be between 1 and 11. If you give a breakable a high amount of health it will be harder to break. Enter health into the 'key' textbox and the amount of health into the 'value' textbox. Setting a low health value means that players don't have to waste ammo to break it.

Shards

You can control the amount of fragments you want by setting the shards key, a value between 1 and 32 is accepted.

When you've done this, the only thing left is to compile and start up your map to break the glass! Note however that glass never can face the void since it generates leaks.

Notes

The default material type is glass, so if you don't set a type key, the breakable will be glass.
For glass windows that break easily, set health to 1.
Any func_breakable with a health of less than 10 will slowly weaken if a player is in contact with it. You can make a roof that collapses in after a period of time by setting the health to a value like 5. This will mean that a player standing on such a surface for around 5 seconds will fall through. The effect is cumulative: if you stand there for 3 seconds and then come back you can only stand on it for another 2 seconds.
The type parameter selects the shader that is used for fragments and sets the sound the object makes when it breaks.
If the brush you are making is on an angle (for example, a skylight in a sloping roof) then you will need to set the break axis to "4" if you want it to break when people stand on it.
Set shards as high as you want (it maxes out at 32 anyway).
Bombable key is to be used for things that can only be broken by the Bomb Mode bomb explosion. For example a large propane tank near a bomb target. The key's value will determine the size of the explosion graphics from this entity when broken, with a value of 1 being no explosion and a value of 255 being a large secondary blast.
Type values info for 1,2,3,4 - The game will attenuate the damage caused by each hit to a value of 1-3. Health values above 10 will choose a random health between 6 and 10. Specifics are as follows: 0: is for glass/windows 1: is for all woods 2: is for ceramics and pottery 3: is for various plastics 4: is for metal that can be broken by normal means
Type values info for 5,6,7,8,9,10 - The game will use the literal health value compared to the weapon damages. They should be set quite high (metals and stone at 50+). Specifics are as follows: 5: is for metal that requires explosives to break (HE grenade or hk69) 6: is for metal that requires the hk69 to break 7: is for stone that requires explosives to break (HE grenade or hk69) 8: is for stone that requires the hk69 to break 9: is for wood that requires explosives to break (HE grenade or hk69) 10: is for wood that requires the hk69 to break
You can even use models as breakable objects, see the Model Binding Tutorial for more information.
By NulL  -  Sunday, 29 May 2011  -  viewed by 1522 members and 31780 visitors

Advertisement

Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942