How to: Create Day and Night Models with Omnilight

NullCurrent

( ゚ε ゚)
Reaction score
110
Day and Night Models with Omnilight​

Introduction:
What is this tutorial?

This tutorial teaches you to use and create "DayandNight" Models and "Omnilight".​

What are "DayandNight" models?
"DayandNight" models are what make the lighting in Warcraft look like day and night.​

What are "Omnilights"?
Omnilight is the spread of light in Warcraft, an example is the "glowing" torch.​

Tools Required:

Creating Day and Night Models:
  1. Open the War3 Model Editor I will call it just "Model Editor" from now on.
  2. Go to "Windows".
  3. Click "MPQ Browser"
  4. Open one of the Day and Night models. In "Enviroment/DNC/..."
    DropDown.jpg
  5. When you have opened one of the models, go to "Windows" and click "Node Manager".
  6. You will see a screen like this:
    EmptyNode.jpg
    • Color: The color of the light.
    • Intensity: The amount or "brightness" of the light.
    • Ambient Color: The color that surrounds the doodads in-game.
    • Ambient Intencity: The amount or "brightness" of the ambient light.
    • Attenuation Start: The point where the light begins to loose intensity.
    • Attenuation End: The point where light ends.
  7. Edit these fields to your liking. Here, I will make one that looks like night vision.
  8. This is what I set my light node as:
    GreenNode.jpg
  9. And this is what it looks like, in-game:
    DarkGreenLight.jpg
  10. Ta-Da! You made a "DayandNight" model! Now, how do you use it?
    NOTE: When you use Ambient Color and Intensity, doodads that are "unrevealed" show as that color It makes it look strange..

    Such as:
    UnfoundGreenLight.jpg

Using Day and Night Models:
  1. Open the World Editor
  2. Import the DayandNight model.
  3. Rename it If you want by double clicking and checking "use custom path"
  4. Save map and close the World Editor.
  5. Reopen the map.
  6. Go to the trigger editor.
  7. Create a new trigger Or add on from an older trigger.
  8. Add a new "Action".
  9. Select "Custom Script" in the drop-down menu.
  10. Type in:
    Code:
    call SetDayNightModels("...","...")
  11. Where the ...'s are, type the name of your dayandnight model. Keep the quotations.
  12. If you want to only make one person see the light...
    • Add in this code:
      Code:
      Custom script:   if GetLocalPlayer() == [COLOR="Blue"]PLAYER[/COLOR] then
      Custom script:   call SetDayNightModels("...","...")
      Custom script:   endif
    • For PLAYER use the jass code for the certain player, such as:
      Code:
      Custom script:   if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
    • This will get the owning player of the triggering unit.

Creating Omnilights:
  1. Open the model editor.
  2. Browse the MPQ Browser for the model you want to create an omnilight on.
    Or you can create a torch or something from my other tutorial How To: Model Weapon Attachments with Particle Emitters Just make a stick with a fire looking particle emitter at the top. Then add omnilight.
  3. Once you have your model that you want to add the omnilight to, go to the Node Manager.
  4. Right-click the window and click "Create Light".
  5. Right-click the Light node and select "Edit Node".
  6. A screen like this will pop up:
    EditNode.jpg
  7. The Pivot Points, X, Y, and Z, are where the omnilight comes from. So you want this to be where the lantern or whatever is making the light is.
  8. I do not recommend changing any of the checks.
  9. Next, double click the node.
  10. Change all of the variables to what you want. But, I will show you a basic "torch" like light:
    OmnilightNode.jpg
  11. This is what it looks like, in-game:
    Omnilighttorches.jpg
  12. Done!

Neat Idea:
If you want a really dark cave or something, do this:
  1. Add this code:
    Code:
    Custom script:   call SetDayNightModels("","")
  2. Put nothing in the quotations.
  3. Then add some omnilights to make it look like this:
    DarkOmniLight.jpg
That's it!
If you need help, please don't hesitate to ask.
Check out my other tutorials!
How To: Model Weapon Attachments with Particle Emitters & Voting With Dialog Boxes
If this helped you and you enjoyed it, tell me.
Constructive Criticism Appreciated!
 

Ghostwind

o________o
Reaction score
172
One problem, though, it seems in the image that when you make day/night models, they don't affect objects you place.
 

NullCurrent

( ゚ε ゚)
Reaction score
110
It isn't extremely noticeable, but the objects all have a green tint.
Besides, they're mostly green to begin with.
 

NullCurrent

( ゚ε ゚)
Reaction score
110
That isn't really what this is about. This deals with the light that covers Warcraft, and the light given off of objects (torches).
But, to do that, just make a region of where you want it, then edit the region and make the region have heavy dungeon blue fog.
 

xxxtrickyxxx

(o Y o)
Reaction score
64
is there a way fade filters wont be affected by this? they are black. tried acting as if it were a model and typed in the path but didnt work.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
715
A nicely formatted and written tutorial.

There's never enough of tutorials about model editing, too.

Approved.
 

NullCurrent

( ゚ε ゚)
Reaction score
110
Ohh, cool. I never thought someone would get around to this tutorial.
I'm glad its approved, and I hope it helps. =D

xxxtrickyxxx said:
is there a way fade filters wont be affected by this? they are black. tried acting as if it were a model and typed in the path but didnt work.

Sorry, I didn't even know that fade filters were affected by this. Thus, I have no idea on how to stop it.
 

SanKakU

Member
Reaction score
21
Creating Day and Night Models:

When you have opened one of the models, go to "Windows" and click "Node Manager".
You will see a screen like this:

Spoiler!

Color: The color of the light.
Intensity: The amount or "brightness" of the light.
Ambient Color: The color that surrounds the doodads in-game.
Ambient Intencity: The amount or "brightness" of the ambient light.
Attenuation Start: The point where the light begins to loose intensity.
Attenuation End: The point where light ends.
Edit these fields to your liking. Here, I will make one that looks like night vision.
This is what I set my light node as

ok these steps are VERY unclear they look good at first but when i tried changing the colors and light and all that i got this weird wall of bizzare looking code i couldn't decrypt and i couldn't change the color to green or anything else. could you please explain the process better?

edit: wow, i figured it out!

you have to uncheck the animated box and then you can select your normal color.

ok i got another problem! how do you name the models?

i tried not renaming them and when i went to set the models i just have black terran and units. i'm not sure if i need the .mdx at the end or not...

edit:
working finally!!!! you have to just set it like the path in the model editor. i recommend copying the path to the clipboard. then when you call make that entire path be the name. i guess this might also mean though if your model was war3imported\filename you would need to call for that path and it should be ok, idk, but just doing it the path like the way i found it in the mpq browser in the model editor worked!
 

NullCurrent

( ゚ε ゚)
Reaction score
110
Cool. You figured it out, I think I will edit to say it in the actual tutorial. Thank you for bringing that to my attention.

@black.sheep: Im sure there is a way with triggers, but I don't have my WE open and I am a little busy. I will try to get back to you on that.
 

AsiaPingPong

New Member
Reaction score
0
Has anyone else noticed a problem in wc3 with deleting lights? They linger for some time after the light source, such as a special effect, is removed. Is there any way to make the light disappear immediately.

Also, how do you get animated intensity to work. Everytime I activate it for a light, not only does the light not show in wc3, but the model editor crashes when I try to open the file.

Normal sequences to my understanding are the standard animations. But what do global sequences do?
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
What if you want to make it different for day and night? Normally in w3 when night falls it goes darker and afaik what causes this is the DNC, no? Then how do you make it change for custom ones?
 

NullCurrent

( ゚ε ゚)
Reaction score
110
call SetDayNightModels("...","...")
Check the trigger above... Instead of leaving this part blank (where the ... are), put in what you want to use for your day in ... #1 and what you want to use for night in ...#2.

But, you will have to go into depth making your DayandNight models and edit some more things, that you see in the node manager.
 

kleinerhauck

New Member
Reaction score
3
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 create another doodad, giving it the exact same model as above but with Intensity 100 and AmbIntensity 200. (And also 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 units and recreating them every 0.05sec won't work.
How can I fix this?

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

//E: This also happens in the world editor, and also for standard models like the glowing torch.

//E2: Found the solution! See here: http://www.thehelper.net/forums/showthread.php?p=1292391#post1292391
 

TheLegend

New Member
Reaction score
10
I dont know if anyone will see this but... Whats te code in:
Custom script: call SetDayNightModels("","")
for normal color (i want to make it realistic, night - its hard to see and day - normal)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top