Exercise 7 - Lighting Things Up

In this exercise we'll add some lights to the model and apply them to various things.

Adding a Light

Open up Objects.skp and find the small pyramid-shaped object. That's a placeholder for a light. Copy it into your model and put it somewhere convenient. It doesn't matter where you put it, because it doesn't represent anything physical in the exported map -- it's just an object to hang some attributes on.



If you look in the Components window now, you'll be able to see that its Description is set to *Light. That's what makes it a light as far as MarathUp is concerned.



Now make sure the light object you just added is selected, and choose Plugins>MarathUp>Object Properties. Give it the name "Dim" and enter an intensity of 0.2 for the Primary Inactive phase.



This is the minimal setup you need to create a constant-intensity light; MarathUp supplies suitable default values for everything else. Note that light intensities range from 0.0 to 1.0 (this is different from Forge).

Now select the floor of the long corridor and, in its Polygon Properties, set the Ceiling Light to "Dim".


There's no need to set the Floor Light as well, because if only one of them is set, MarathUp will automatically use it for both the ceiling and floor, and also for any walls that don't specify lights of their own.

Now export and play the map, and you should have a dimly-lit corridor.

Creating a Light Switch

Let's provide a way of turning on the light in the corridor. Just to be perverse, we'll put it at the other end of the corridor, so the player has to endure some darkness in order to get to it.

Make another switch alcove, put a switch texture in it, and set its Panel Type to "Light switch" and its Permutation to "Dim".






Now select the light object again. Rather than try to find it in the 3D view, there's another way to select it. Choose Windows>Outliner and you will see a list of all the component instances in your model by name. Find the one listed as "Dim <Light>" and select it.



Then choose Plugins>Marathon>Light Properties and update the Primary Active phase intensity to 1.0:



Export and play the map, and you should find that the new switch turns the corridor light on and off.

In Exercise 8, we'll add a liquid to the map.

---