-
Notifications
You must be signed in to change notification settings - Fork 0
Lights
The game's own light, not Blender's. It carries a two-value falloff band and a pair of cone angles that a Blender light cannot hold, so it is an empty with a panel of its own — and what Blender's own lights do has no bearing on it.
Add ▸ 4DS ▸ Light builds one. It shines along local +Y.
Three of them light geometry:
| Point | shines from its position, fading across the range |
| Spot | shines from its position along the frame's direction, inside the cone, fading across the range |
| Directional | shines along the frame's direction from no particular place. Position and range are unused |
Four set a sector's atmosphere rather than lighting anything, each drawn in the light's own color. Power and the cones are not used by any of them:
| Fog | linear fog. Far is where it is thickest, as a percentage of the view distance; Near is where it starts, as a percentage of that |
| Point Ambient | exponential fog, with Near as the density. Despite the name it lights nothing |
| Point Fog | exponential-squared fog, with Near as the density |
| Layered Fog | draws no fog and lights nothing. The game only counts it, as light from around it, toward how dark a shadow is |
And two more: Ambient, which adds its color times its power evenly to everything in the sectors it lights, and None, which does nothing — the type a light carries before it is given one. A light read from a file with no type set is Directional, which is the engine's own default.
- Color and Power — the power multiplies the color.
- Near and Far — the falloff band. Full strength up to Near, fading to nothing at Far. For the fog kinds these mean what the table above says instead.
- Inner and Outer cone — for a Spot: full inside the inner angle, fading to nothing at the outer one.
- Mode — a word of switches saying what the light is counted for:
| Lights Objects | ordinary objects, billboards and morphs, while the game runs |
| Lights Lit Objects | Lit Object meshes too, on top of the lighting baked into them. Off in the engine's default; the game turns it on for car headlights and fire lights |
| Vertex Bake | taken into account when a lit object's per-vertex lighting is baked |
| Casts Baked Shadow | casts an occlusion ray during a bake, so baked lighting shows what this light cannot reach |
| Affects Shadows | counted when the game picks which way a projected shadow falls and how dark it is |
| Affects Lightness | counts toward the lightness the game measures at a point |
Bits of that word nothing reads are carried back out exactly as they came in.
The viewport draws what the file describes and Blender would not: the cone, the falloff band as rings, and an aim ball you can drag to point the light. Aim At Target points it at another object. Which of those is drawn depends on the kind — an atmosphere light has no cone or range to show.
A light lights the sectors that list it, and that list lives in the mission's
scene2.bin, not in the model. So a light exported in a model does nothing on its
own, however right its settings look: the mission that places the model has to name it as
well. The add-on says the same in the light panel, under Switching It On in
scene2.bin.
Two halves have to agree.
| What | Which kinds |
|---|---|
| Enable on, in the object's Culling flags | all kinds |
Animated Objects 0, or the model's .5ds beside it |
all kinds |
| Power not 0 | the lighting kinds, and Layered Fog |
| Lights Objects on | the lighting kinds, to light ordinary meshes |
| Lights Lit Objects on | the lighting kinds, to light Lit Object meshes |
| Affects Shadows on | Layered Fog |
Warning
Enable off does more than hide the light: it takes the object out of collision,
lighting and sound, and hides its children with it. And a model whose Animated
Objects count is above zero makes the game open a .5ds of the model's own name — if
there is none, the whole model load counts as failed, the mission never records the
model's frame names, and every scene2.bin entry naming them does nothing. That takes
the light with it.
| What | Which kinds |
|---|---|
| Placed after the model's own object | all kinds |
A frame named <model object>.<light name> — no frame type
|
all kinds |
and the light datablock on that frame holds:
| What | Which kinds |
|---|---|
| Sector — the sectors it lights | all kinds |
| Color or Power | the lighting kinds, and Layered Fog |
| Range or Cone | Spot |
| Range | Layered Fog |
| Mode, if the model file is used more than once | the lighting kinds, and Layered Fog |
The lighting kinds are Point, Spot, Directional and Ambient.
Note
The name is the model's object name, a dot, then the light frame's name — so a light
called lamp inside a model placed as streetlamp01 is named streetlamp01.lamp. In
the mission's own scene.4ds, the frame is named without the prefix.
Tip
Give the light a name you can find again before exporting. The scene2.bin entry has
to match it exactly, and renaming the frame afterwards breaks the link silently — the
model still loads, the light simply never comes on.
Mafia Toolkit 1.0.2 · Blender 5.2+ · Releases
Getting Started
Core Concepts
Frame Types
Characters & Animation
Help