Welcome to PlagueFest.com! Log in or Sign up to interact with the Plague Fest community.
  1. Welcome Guest! to interact with the community and gain access to all the site's features.

Tutorial Hammer: Dynamic Lights

Discussion in Resources & Tutorials started by Jenos, Aug 27, 2011

  1. Mar 25, 2011
    It's that time of the week again, which means time for another tutorial. I figured i might as well get this out of the way before Irene hits in case I lose power.

    So, today I will cover Dynamic lights, how to make them work, and how they are useful.

    Difficulty: 1/5

    Words/commands you should know:
    • light_dynamic - An invisible point entity that changes over time.
    • Parent - "The material or source from which something is derived"- Or in other words, the object that controls other objects.
    • Trigger_once/multiple - A brush entity that, when entered by a player or object, sends an output.
    • Child - The opposite of the parent, it is the object being controlled by the parent
    The reason I made this tutorial was because I actually had a lot of trouble making light_dynamic when I started mapping.
    Step one - Setting Up
    The first thing you want to do when making a light_dynamic is place an entity anywhere in your map. Once you've placed down an entity you want to double click it and make it a "light_dynamic". You can mess around with the options as you please, but here are some important things to remember:
    1. By setting the outer and inner fade angle to 0, instead of being a spotlight, it will be like a regular light (it will still be move-able).
    2. The Light color you set in hammer may appear slightly different than it does in game.
    3. "Light Brightness" should be set in between 2-4, going higher will make it appear negative (all the colors will be opposite).
    4. You can still change the appearance of a light_dynamic (ex. flickering, pulsing etc.)
    Once you've set all the options on your light, you want to make an object to parent it to, this can be a prop, or a physbox type entity. When you've made/spawned the "parent" name it, in this case you can name it Parent1. Drag your light_dynamic entity to your prop/physbox and align it so it shines in the right direction. Once this is done, double click the light_dynamic and make it's parent "Parent1".

    Step two - Mobility

    There are a number of ways you can move the light source. For example, the parent prop "Parent1" can be the child of a func_tanktrain, all you have to do is set up the path and let'er rip.
    Another way is doing it in the fashion of a hanging light, by using the entity phys_ballsocket entering "Parent1" into the entity 1 field, you will have created a ballsocket. The light will look as if it were swinging from the ceiling if hit.
    The third and final (simple) way to make it mobile is to parent the object to a weapon, when the weapon is picked up the child object will move with the player. (see example map here).

    FAQ - Will be updated if necessary.

    In Minas Tirith, Gandalf can activate a bright light at any given time, how do i replicate this?
    I have not personally looked into this aspect of minas tirith, but a way to do it is to place a button in front of the player, and have the light_dynamic start deactivated, and be activated once the button is pushed. You can also have a delayed deactivation input to turn off the light.

    In some maps, light's emitted from objects have a sort of glow near the center, how do i do this?
    This is done with a env_sprite, simply place an entity anywhere in your map and make it in env_sprite. Choose the sprite of your choice in the options, and parent it to a weapon, or whatever is making the object mobile. This can also be deactivated and activated in the same/similar way to the light_dynamic.

    Whats are some practical uses for light_dynamics?

    Light_dynamics can be used for a variety of things, more commonly they are used for swinging/hanging light, light on elevators, or effects for special/prop weapons.

    Thanks for reading, hoped this help.

    Feedback is appreciated!