Welcome to Part 9 of our Dying Light Developer Tools tutorial. In this video you will learn how to place dynamic lighting and shadows. Let’s test it on the example of a street lamp. First we need to place it on the map. Find the lamp in the ‘Assets’ window, under the ‘meshes’ section, with the name: lamp_a.msh. Next, place dynamic lighting on the map. You can find it in section ‘object types’ from the ‘Assets’ window. The default dynamic light is omnidirectional so it’s beaming out from all sides of the object. If you want to change its color or intensity, open ‘Attributes’ and go to the ‘Dyn Lights’ tab.

When finished, click ‘Apply’ at the bottom of the window to confirm changes. You can also increase the range of your dynamic light. Just scale it like any other object. Remember that omnidirectional lights don’t cast any dynamic shadows. To make our lamp more realistic, we need directional light of the ‘spot’ type. To change the type of light, go to the ‘Dyn Lights’ tab and choose it from the ‘Type’ list. Just like in the case of omni lights, here you can also change the color, intensity, and range. However, contrary to omni lights, spot-type lights can cast shadows, if you first choose an appropriate shadow type. So let’s choose it right now from the ‘Type’ list. Look for: spot_shadow. If you want a shadow, you also need an object to block the light. A simple barrel will do in this example. For optimal performance, though, by default objects don’t cast shadows. To enable shadows for a specific object, check ‘cast shadows from dynamic lights’ .

You’ll find that option in ‘Attributes’ under the ‘Object’ tab. Finally, let’s make our lamp switch on at night and off when it’s bright. Select the lamp and change its class in the ‘Attributes’ window by clicking the button next to the ‘Class’ field, as you can see on the screen right now. Find the ‘LampDl’ entry on the list and click OK. Our in-game models have several skin versions, meaning sets of different materials and textures. Thanks to them, objects don’t look all identical and can be shown in many different states. Most lamps have skins that show whether they are switched on or off.

You can see them under the ‘Skins’ tab. We’ll now set states of our street lamp to switched on, switched off, and flickering. Next we check the box called m_dayNightCycleDepended and add light to our lamp. To do so, select light in the ‘Attributes’ window, go to the ‘Parent’ field and find the target object on the list. Now we can preview how our light behaves at different times of the day in the Varlist window, which you can find on the toolbar. Finally, let’s see our work in the game. Last one tip: when you’re in the game, you can use keyboard shortcuts SHIFT fullstop or SHIFT quotation marks to go forward or back in time at one-hour intervals. And that’d be all for this episode. Thanks for watching!.

As found on Youtube