Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Breakable Light with Dynamic Props

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Creating a Breakable Light With Dynamic Props

An Introduction to inputs/outputs and dynamic props

So you want to create a breakable light right? Why else would you be in here? You will find this is a very simple process, but key things to remember are:

  • When making multiple breakable lights, name each light something different, you don't want all your lights going out when just one is shot.
  • While breakable lights can add immersion, it can be down right annoying stumbling in the darkness of an underground bunker because some n00b shot out all the lights.
  • Lighting has to be calculated for when the light is on, and off, increasing the file size. (I haven't actually tested this, but I'm pretty sure it's correct.)

With that said, lets get started!

Contents

Part one

Create two prop_dynamics that look like lights. I'm using the light_cagelight models found in the props_c17 directory. Make one of the props be an off model and one be an on model. Give each light a name, I'm using "lightmodel_off" and "lightmodel_on."

Then create a light entity right below and name it. I'm using "light."

Hopefully you see where I am going with this.

Part two

Create a func_breakable brush textured with the "toolsnodraw" texture, shape it fit just outside one of the actual light models. There is no need to name this entity, but go ahead if you want. Set the material type to glass for a cool shattering effect and appropriate sound when shot at.

Part three

Create a logic_auto entity somewhere in your map. This entity will hide the off model of the light at the start of the round.

Go into the output tab of this entity, click the add button and enter this in:

My output named 
OnMapSpawn
Target entities named 
light_off
Via this input 
TurnOff

And you are set.

This entity hides the off model at the map start.

Part four

Place both of the prop_dynamic entities and the fun_breakable entity on top of one another so it looks like this:

Image:CaekExample.gif

This is the 'hard' part.

Open up the func_breakable's properties and go to the output tab.

Add all of the following lines:

My output named 
OnBreak
Target entities named 
light_on
Via this input 
TurnOff
My output named 
OnBreak
Target entities named 
light_off
Via this input 
TurnOn
My output named 
OnBreak
Target entities named 
light
Via this input 
TurnOff

Thats it. Your done. Finished. Completed. Don't take my word for it though. Compile it and try it out :D

--caek 21:47, 1 Mar 2005 (EST)

Optionally

If you're making a Half-life 2: Deathmatch map (which you probably are :)), you should make a func_button instead of a func_breakable, since it doesn't get "killed" when shot, so you can reuse it by making the light "respawn" after an amount of time (using outputs :-)).

Part one

Give the func_button a name.

Part two

Under flags, uncheck Use Activates, and check Damage Activates and Don't move.

Image:MathewBreakLightFlags.jpg

Part three

And under Outputs, remove the old, and use these instead:

Image:MathewBreakLightOutputs.jpg

Happy mapping :-)

--That Mortal Guy 13:41, 27 Jul 2005 (EDT)

Personal tools