• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Omni Lights Disappear

Status
Not open for further replies.
Level 13
Joined
Jun 1, 2008
Messages
360
Hi there.
I converted this .mdl to .mdx with Magos Model Editor and used it in my map alot for street laterns.
Code:
Version {
    FormatVersion 800,
}
Model "" {
    NumLights 1,
    BlendTime 150,
}
Sequences 1 {
    Anim "Stand" {
        Interval { 0, 3333 },
    }
}
Light "Omni01" {
    Omnidirectional,
    static AttenuationStart 1,
    static AttenuationEnd 2,
    static Intensity 500,
    static Color { 0.1, 0.1, 0.1 },
    static AmbIntensity 1100,
    static AmbColor { 0.1, 0.1, 0.1 },
}
PivotPoints 1 {
    { -2.59302, 0.194191, 17.3677 },
}

Then I created another doodad, giving it the exact same model as above but with Intensity 100 and AmbIntensity 200. (It also has the same settings in the object editor)
Problem: As soon as some specific street laterns get into the camera view the light from the second doodad disappears (for ever!).
(Renaming the Light to "Omni02" in the .mdl file didn't help)
Now if I use a new model with the same intensity the light will never disappear and work just like it should, even if i change for example the Attenuation.
So the lights with the higher intensity shut out the 'smaller' lights for ever.
Even using dummy units and recreating them every 0.05sec won't work.
How can I fix this?
Or is there another way to make the light smaller without modifying the intensity?

I put this line in the Map Init trigger:
Code:
call SetDayNightModels("","")
All street latern lights work properly.

Thanks
kl

//E: Btw, this also happens in the world editor, and standard light models such as the torch disappear also.

//E2: Sorry for using a prefix, I didn't see the blinking announcement :D
 
Last edited:
Level 22
Joined
Jan 10, 2005
Messages
3,426
Yeah, I do have bigger light sources in my map. They are custom glowing models, one for each color. It seems like these are the cause of the other glowing objects not working.

Even weirder is, whenever I start the map all is working fine. But the second I scroll over one of those custom glowing models, all the other light sources immediately stop glowing (in WE as well).

I guess there's nothing you can do to prevent this. :I
 
Level 13
Joined
Jun 1, 2008
Messages
360
It seems I found a solution, after creating and comparing dozens of lights :)

This is what I found out:
1. Changing the Attenuation has no visible effect at all.
2. Creating lights with different Intensities/AmbIntensities leads to bugs. (Lights won't be displayed, udgly edges...)
3. The intensity of a light can also be changed by modifying the color!
As long as the relative values stay the same (e.g. instead of 1 0.1 0.3 -> 0.1 0.01 0.03), the color ingame stays the same. Reducing the values (factor 5-10) leads to less intensity only! (Which is what we need)
4. You can change the Intensity (but not the AmbIntensity!!!, and the AmbIntensity limits the Intensity!) by attaching the light to a Bone and using the Scaling Value of the Object Editor.

This is how to attach a light to a bone.
You can use this light as basis for all your lights.
Remember only to change the color not the intensity!
Code:
Version {
    FormatVersion 800,
}
Model "BaseLight" {
    NumBones 1,
    NumLights 1,
    BlendTime 150,
}
Sequences 1 {
    Anim "Stand" {
        Interval { 0, 3333 },
    }
}
Bone "DummyBone" {
    ObjectId 0,
}
Light "Omni01" {
    ObjectId 1,
    Parent 0,
    Omnidirectional,
    static AttenuationStart 1,
    static AttenuationEnd 2,
    static Intensity 500,
    static Color { 0.1, 0.1, 0.1 },
    static AmbIntensity 1100,
    static AmbColor { 0.1, 0.1, 0.1 },
}
PivotPoints 1 {
    { -2.59302, 0.194191, 17.3677 },
}

Have fun with it!
 
Status
Not open for further replies.
Top