How to: Create Day and Night Models with Omnilight

NullCurrent

( ゚ε ゚)
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/..."
  5. When you have opened one of the models, go to "Windows" and click "Node Manager".
  6. You will see a screen like this:
    • 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:
  9. And this is what it looks like, in-game:
  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:

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:
  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:
  11. This is what it looks like, in-game:
  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:
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
One problem, though, it seems in the image that when you make day/night models, they don't affect objects you place.
 

NullCurrent

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

NullCurrent

( ゚ε ゚)
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)
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.
 

NullCurrent

( ゚ε ゚)
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
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

( ゚ε ゚)
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
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!
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

( ゚ε ゚)
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
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
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 The Helper:
    My grandmother just passed away, she was 95. I might be going to Florida for a week.
  • The Helper The Helper:
    I have a buddy in Florida who has an extra office space for me with a computer so I can do anything so likely I will be going up there wednesday or thursday
  • Ghan Ghan:
    Let me know if there's anything I can do to help.
  • The Helper The Helper:
    thank you Ghan
  • jonas jonas:
    Sorry for your loss
    +1
  • Varine Varine:
    I'm sorry to hear that bro
  • Varine Varine:
    Not to distract but is anyone aware of any software to help visually impaired people interact with their PC?
  • Varine Varine:
    Also what's the best way to ship a PC? Should I just wrap the fuck out of it in the case or put the components in static bags and wrapped up individually?
  • Ghan Ghan:
    The GPU is the biggest danger typically.
  • Ghan Ghan:
    Some of the pre-built vendors use expanding foam to fill in the case and secure the GPU. Otherwise it might be best to remove it and ship it separately.
  • Ghan Ghan:
    Similar if the machine has a large tower CPU cooler installed. Those can experience huge forces and destroy the socket during shipment if they are heavy.
  • Varine Varine:
    So mainly just the heavier things that jut out? I'm planning on pulling out the SSD's too and anything that I don't have well secured. I'll probably be good leaving the motherboard and PSU screwed in there though if I bundle it up?
  • Ghan Ghan:
    Yeah, I'd expect those to be fine. It's mainly the heavy stuff that is also long/tall where dropping the case would cause it to exert a ton of force on the mount. The motherboard will be fine screwed into the board unless the case itself is somehow severely damaged.
  • Varine Varine:
    I have the original packaging for it, so I was going to just put it back in there
  • Varine Varine:
    I don't think I have the boxes for the components though and so I don't want to have a bunch of loose shit bouncing around
  • The Helper The Helper:
    damn I just read that lol
  • The Helper The Helper:
    when i read up and saw spray in foam I was like oh shit
  • The Helper The Helper:
    going to do the last controller giveaway in the NUON Dome forum because I just cannot sell them since I got them for free from a deceased NUON Legend. It is my last one from that.

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top