Post tutorial RSS Palii Tutorials for everything Dow part 2

Palii Tutorials for everything Dow part 2 continues from the last one with "Add Simple FX to Motions"

Posted by on - Basic Starting a mod

Add Simple FX to Motions


What you need for this tutorial:
I assume you are now in object editor in front of you new entity. It already has an animation exported from 3dsmax and this animation is linked to a motion. You want to add an fx lua file you created to this motion. Let's see how it goes.

1. Markers:
Fx has to be linked to markers, that are packed with the entity when exported from 3dsmax. Note that the Y axis of the marker is the direction the fx will be pointing. If you want a marker to move with bones, then link it. First open up the Model Properties panel on the left and look if your markers are present.

If it is there then let's go on.

2. Creating Events:
Open the Event List panel on the left, create a new event and name it.

You will have to create a separate event for each different fx lua file. But the same event can be used in any motions and can be linked more then once. Make sure your new event is selected and open up the Event Properties panel on the right.
Add a parameter by selecting the add paramater entry and setting Param to fx in the first frop down list, then Value to your fx lua file name, in, the second. Make sure your fx file is within your default mod directory. If you've put it into the root of the data/art/fx directory, then simply type in the lua file name.

Now add another parameter with Param set to marker and Value set to your marker.

The event for your fx is fully set up now. Time to link it to a motion. Note that in the bottom field (Motion Attachments) of the Event properties panel the different motions will appear if this event is linked to them.

3. Attaching Events to Motions:
Select your motion from the Anims/Motions/Actions panel on the left and open up the motion properties panel on the right.
In the Events box you can select your event from the drop down list and add it.

The event has to be told when to appear withing the duration of the motion. Select your event in the field and then you can set it's Time under Selected Event.

3 choices: A numeric value, enter or exit. The last two are quite obvious. Enter is recommended for looping fx that is playing all the time. If you enter a number it will be recognised as seconds.
There are two ways of setting the start time for an event.
Easy way: Play your animation in the object editor, and find the exact frame where you want the event to enter. Now add your event in the motion properites panel, its start time will be automatically calculated according to the frame you paused the motion on.
Hard way: The default fps is 30, you divide the starting frame of the event by 30 and you will get the vaule in seconds. This value can be entered as time parameter for the attached event.
With both methods you can delay fx, but if you want the fx to be faded out or to be finished, you have to set up a fading out effect in the fx lua file.

4. Testing the FX in Object Editor
Such fx MUST show up in object editor if you play the motion or an action that has this motion attached. If purple square appears with "Bad FX", then the fx cannot be found. Footfall events don't show up in OE at all, that will be another tutorial.
If you can see your fx properly, then it will work just as well in-game.

Divine spark, corrupted light.

Palii

Idle and Move Water Ripple FX


What you need for this tutorial:
I assume you got an entity in object editor with move and idle motions and default action set up and working. If not then check the Idle and Move tutorial. If you want to add water ripple to your water object then read the Add Simple FX to Motions tutorial and use the water ripple FX made by relic. Here we make footfall fx for an ingame unit.


What is this exactly?
When the game is set to maximum FX quality, units make water ripple when standing still in water and make waves behind them if moving. Here are some screenshots.

Idle Water Ripple:

Moving Water Waves:

This tutorial replicates the exact effect relic used for his entities.

1. Waist Marker:
There should be a marker linked to a mesh or bone at waist height of the entity. Some times water will be higher, sometimes lower, nothing can be done about it, and don't worry about it. The marker should point upwards with its y-axis.

2. Ripple FX and Dynamic Terrain-based FX:
We will use the fx already in the game made by relic. They are called waist_still_move and waist_start_move. And can be found under data/art/fx/environment/terrain. If you check the fx lua files, you will see that there are actually 4 lua files: waist_start_move_dirtsand.lua, waist_start_move_grass.lua, waist_start_move_rock.lua and waist_start_move_water.lua. When we link the fx file to the event, it will be made dynamically: environment/terrain/waist_start_move_%terrain%
Also only the waist_start_move_water.lua and the waist_still_move_water.lua has ACTUAL fx in it. The other 3 fx files for both are empty. So nothing will appear unless the units is moving in water. If you make such terrain-based fx, all 4 terrain type fx files have to be there otherwise it will show "purple box, bad fx".

3. Creating Events for the Ripple FX:
Fx has to be linked to event. Create two new events on the Event List panel: waist_start_move and waist_still move.

Setting Up Waist_Start_Move:
Select waist_start_move and open up the Event Properties panel on the right side. Add a parameter: Param is footfall_fx, Value is environment\terrain\waist_start_move_%terrain%

Now add the second parameter: Param is marker, Vaule is your waist marker.

Setting Up Waist_Start_Move:
Setup waist_still_move as above.
- Parameter1: Param is footfall_fx, Value is environment\terrain\waist_still_move_%terrain%
- Parameter2: Param is marker, Value is your waist marker.

Ok both fx events are set now.

4. Attaching Events to Idle and Move Motions:
Now the events have to be attacehed properly to your motions.
Setting Up Waist_Start_Move:
Select your move motion in the Anims/Motions/Actions panel on the left and open the motion properties panel on the right. Add the waist_start_move event two times from the dropdown list in the Events box.

Set the time of the first to 0.00 and the second one to 0.50. This is a relic default value and I've found it pleasing. Although this may depend on the lenght of your animation. If your anim is really long you can add 3 or more times the same event and delay them.

Setting Up Waist_Still_Move:
Select your idle motion in the Anims/Motions/Actions panel. Add the waist_still_move event two times to your idle motion on the motion properties panel.

The first stays at 0.00 the second should be set to 1.50. This is relic's interval for water ripples. Same here, if the anim is long then add more than two events.

4. Testing the Ripple FX:
Well the setup is finished. Unfortunately you can only see footfall_fx in the game, the object editor doesn't show it. Make sure you have fx quality set to maximum in the dow video options. If you make other events that have terrain-based fx in them, and NOT footfall_fx, BUT simple fx, it will show up nicely in object editor. Set a variable in the bottom of the variable bar to terrain, and the value to water. Now if you play your motion it won't show bad fx.

Like a leaf on the ocean of life!

Palii

Create Sound Events


What you need for this tutorial:
First you need a wav file. You also need a motion to link this sound to, in OE. Please read the Idle and Move tutorial to create motions.

1. Placing Wav File:
The audio file has to be copied to the right directory so that the audio tool finds it.
DOW\Modtools\DataGeneric\Default_Mod\Sound\test3.wav
Actually within the Sound directory you can place it in any directory structure. Default_Mod is your default mod directory.

2. Burning Wav files:
There are two purposes for what you can burn sounds. To hear it in object editor when you play your motion, or to hear it in the game. This is not an Audio Tool tutorial, but you will definitely hear your sound in OE and the game by the end of it. Both for OE and the game the audio tool is used.
Launch the Audio Tool and find your wav file in the tree view in the middle.


From here you can go two ways, read on.

2a. Burning Wav files to hear in the Object Editor:
This is a funny thing that I found out after some testing. You select your wav as shown above. Then hit the play button in the bottom left.


When you press the play button the audio tool burns an fda of your wav file in the background. Fda is the dow audio file format. So now if you check the place you've got your wav, it has an fda with it.
DOW\Modtools\DataGeneric\Default_Mod\Sound\test3.fda
This fda will be used only by the object editor and the audio tool when you playtest your files. If this file doesn't exist the object editor will play a "beep" only.

2b. Burning Wav files to hear In-Game:
This is the regular burning process with the audio tool. Explaining all the options and settings is out of the scope of this tutorial.
Select your wav file in the audio editor as before. Then click the "Burn..." button.

A window pops up, this is the burn log panel. You can either burn all the wav files or only the selected one. Hit burn.

Read through the log and check if all files are created properly. Normally 3 different resolutions are created for each wav file.
DOW\Default_Mod\Data_Sound\Full\Sound\test3.fda
DOW\Default_Mod\Data_Sound\Med\Sound\test3.fda
DOW\Default_Mod\Data_Sound\Low\Sound\test3.fda

3. Creating Sound Event:
The event will call the fda file, and a motion will call the event. Open your entity in object editor and create a new event. Name it sound_something or whatever you like.

Make sure your event is selected and open the event properties panel on the right.
Select "<add parameter>"

Select "sound" from the first dropdown list.

Type in the value, don't use the browse button!!!!

Value targets the fda file. If you placed your audio into the root Sound dir, then simply type the name of your file.
so if: DOW\Modtools\DataGeneric\Default_Mod\Sound\test3.wav
then: test3
or, if: DOW\Modtools\DataGeneric\Default_Mod\Sound\races\tyranids\carnifex\roar12.wav
then: races\tyranids\carnifex\roar12

4. Add the Event to a Motion:
Please read the Add Simple FX to Motions tutorial to learn how to do this.

5. Testing:
Now if you select your motion and hit play it should work properly. If you hear a beep then the OE cannot find the fda file, next to the wav. It should work just as well in the game if you've burned the sound. Good work!

Palii

Research Dependent Anims


Ever wanted that your research actually changes something on your entity?
Examples:
- Armour research unlocks better amour on your model
- Weapon Damage research enables different muzzle fx
- Speed research enables different move animation

Overview:
- Add a dummy hardpoint and set it's options for OE to recieve.
- Add dummy weapons that do zero damage and have zero range.
- Make a research that pushes the default weapon slot up for your entity.
- Add the research variable and its values to the OE option luas.
- Make a clause in OE that determines the status of the research.
- Make a suitable icon if needed.

!! WARNING !!
Sad Fact: Requirements work for weapons, but not "is_display_requirement".
This means the effect of the research on the dummy hardpoint will have to be shown as a weapon upgrade icon. (you can disable it though) To completely make it dissapear, the unit cannot have any upgrades at all. Still, there are many ways to advertise to the player what the icon is about or make it stand out less than the others. The possibilities will be explained below.

Dummy Hardpoint:
You need a spare hardpoint. Please check the Hardpoints tutorial if you aren't famailar with hardpoints.
GameData["combat_ext"] = Reference("combat_ext")
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["hardpoint_weapon_variant_motion_name"] = "Research_Dummy"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_01"]["name_for_this_weapon_choice"] = "space_marines_research_none"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_01"]["weapon"] = "dummy_ranged"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_02"]["name_for_this_weapon_choice"] = "space_marines_research_speed"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_02"]["weapon"] = "dummy_ranged"
In object editor a clause will ask if "Research_Dummy" is equal to "space_marines_research_speed" or not. You can use the same weapon for both slots, it won't make much difference.

Dummy Weapon:
You can create you own dummy weapon, but watch out:
- For a melee dummy weapon make it inherit melee_weapons.nil
- For a ranged one: shooting_weapons.nil
- Make it do zero damage
- Give it zero range
- Place it in Data/Attrib/Weapon
- Make a requirement for the weapon that will never be achieved. (like a non-existing research)
Here is a ranged dummy weapon to save you the work:
Download Ranged Dummy Weapon

The Icon. Decide For Your Entity:
There are three ways to solve the icon problem, depending on the upgrades of your unit.

1. Can_Upgrade = False
If your squad has no weapon upgrades at all, then make sure you add this to your sbps:
[ GameData["squad_reinforce_ext"] = Reference("squad_reinforce_ext") ]
GameData["squad_reinforce_ext"]["can_upgrade"] = false
This is the best case since all upgrade icons are disabled, the research trigger can work unnoticed in the backgound.

2. Complex_Upgrades = False
Meaning you have weapon upgrades and the squad has more than one members. In this case I recommend adding a disabled icon for the dummy_weapon. Maybe with a different frame, or no frame at all. By changing the alpha channel of the tga it could look like a symbol in the background, not like a clickable icon.
Here, it isn't possible to change the icon if the research is completed. Add this line to link an icon to the dummy weapon:
GameData["ui_info"]["icon_name"] = "chaos_icons/upgrade_flamer"

3. Complex_Upgrades = True
With this setup two icons can be used, one before, and one after the research.
First you should duplicate your dummy weapon lua. Name them 1 and 2. Then reedit your entity's ebps, something like this:
GameData["combat_ext"] = Reference("combat_ext")
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["hardpoint_weapon_variant_motion_name"] = "Research_Dummy"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_01"]["name_for_this_weapon_choice"] = "space_marines_research_none"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_01"]["weapon"] = "dummy_ranged1"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_02"]["name_for_this_weapon_choice"] = "space_marines_research_speed"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_02"]["weapon"] = "dummy_ranged1"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_03"]["name_for_this_weapon_choice"] = "space_marines_research_speed"
GameData["combat_ext"]["hardpoints"]["hardpoint_03"]["weapon_table"]["weapon_03"]["weapon"] = "dummy_ranged2"
Now add the "before research" icon's line to dummy_ranged1.lua:
GameData["ui_info"]["icon_name"] = "my_icon1"
"After research" to dummy_ranged2.lua:
GameData["ui_info"]["icon_name"] = "my_icon2"

- Note that you have to copy all your icon files to the disabled folder.

The Research:
Nothing miraculous, just set it to your harpoint number:
GameData["modifiers"]["modifier_01"] = Reference("default_weapon_modifier_hardpoint3")
GameData["modifiers"]["modifier_01"]["target_type_name"] = "Nazdreg"

Create New Variables:
Object editor works with some luas, that can easily be reedited. (notepad :P)
First we add a new condition variable which is equal to "hardpoint_weapon_variant_motion_name" from earlier. Open ModTools\Data\ConditionVariables.lua and add anywhere:
"Research_Dummy",
Then the condition values, which are "name_for_this_weapon_choice". Open up ModTools\Data\ConditionStringPresets.lua and add anywhere:
"space_marines_research_none",
"space_marines_research_speed",
Just make sure these are the same as your "name_for_this_weapon_choice"-s in the ebps.

Create the Clause and Condition:
Open up your entity in Object Editor. Create a new String Clause under Clause List on the left:

Make sure your new clause is seleced and open the clause properties panel on the right and...:

Create a New Condition (left)

Select it and add the new clause to it on the right:

Now you have your condition and make crazy things if the research is done! The variable can be displayed on the variable bar and tested real-time in OE.
Good job!

The beginning never ends!

Palii

Hide Everything for Screenshots


Overview
The tutorial explains how hide and unhide the whole interface and fx icons to make clean screenshots. There are other methods to hide the interface too, this method was designed to work outside developper mode, with standard DOW launch.

Contents:
1: Hideable Features
2: Hide/Unhide Interface
3: Hide/Unhide Icons
4: Multiplayer Compatibility


1: Hideable Features

- Full Interface: Using a shortcut key, the whole interface, cursor and ui hints can be hidden/unhidden during the game.
- Cover Icons: Both cover icons can be hidden, before launching the game.
- Eye Icon: This Night Shift feature can also be switched off before the game.
- Buider Icon: The rotating yellow wrench as well.
- Moral Break: Red circles around units removed.


2: Hide/Unhide Interface

This can be done thanks to an autoexec.lua in your Dawn of War folder. If you already have such a file with interface hiding features, then you can skip this part. You can edit the file to change the shortcut key on your keyboard. It is set to F9 by default. After hiding the interface, pressing the shortcut again will unhide it.

Install:
Save the autoexec.lua into your Dawn of War folder.
- Save: Autoexec.lua

Uninstall:
Delete the autoexec.lua from your Dawn of War folder.


3: Hide/Unhide Icons

Cover icons, the eye icon and the builder's wrench icon are fx files. They can be overwritten easily with blank ones to hide them during the game. The hiding and unhiding is not done during the game with a shortcut, the fx files have to be loaded when loading the map. So you can overwrite the icons anytime, but not during the match itself.

Install: (hide)
Extract this archive into your Dawn of War folder. Overwrite all files.
- Save: HideIcons.rar

Uninstall: (unhide)
Extract this archive into your Dawn of War folder. Overwrite all files.
- Save: UnHideIcons.rar
Then delete the following:
../Dawn of War/Night_Shift/Data/Art/Fx/aura_fx/ (folder)
../Dawn of War/Night_Shift/Data/Art/Fx/space_marines/ (folder)
../Dawn of War/Night_Shift/Data/Art/Fx/morale_break.lua
../Dawn of War/Night_Shift/Data/Art/Fx/morale_break_combo.lua

Note that only the Night_Shift folder must stay in your Fx folder.


4: Multiplayer Compatibility

Two different fx files on two different machines in the same game, never result in a game crash. If one player hides his icons, then the other will still have visible icons. Compatibility is not a problem in this case. Since this method doesn't need developper mode, online play is undisturbed.

Define Night Hotkeys


Overview
The tutorial explains how to assign custom keyboard shortcuts to night features.

Contents:
1: About the Installer
2: Changing Hotkeys


1: About the Installer

Creating new hotkey entries for mods isn't so simple, so a custom script is included in the installer.

The installer works automatically like this:
1. Searches for user profiles.
2. Recopies the keydefaults.lua from WXP to Night_Shift and Midnight_Shift under every profile.
3. Adds the new hotkey entries into the keydefaults.lua, under Night_Shift and Midnight_Shift in every profile.
4. Also recopies all custom army painter schemes for both mods in every profile.

This means that if you have set your custom hotkeys for Winter Assault, then those hotkey will be avalaible under Night Shift and Midnight Shift. You don't need to recopy your keydefaults.lua for the two night mods!


2: Changing Hotkeys

A very easy job. You need to edit the hotkeys in the following two files, if both night mods are installed. If you have more than one profile then locate the proper one.
../Dawn of War/Profiles/Profile1/night_shift/keydefaults.lua
../Dawn of War/Profiles/Profile1/midnight_shift/keydefaults.lua

The installer have placed all the hotkey entries to the beginning of keydefaults.lua.
Have fun!

Create
Night Maps


Overview
Making a night map is easy on all levels. The important points are proper placement, night environment settings and night dummies.

Contents:
1: Place Your Map
2: Terrain Properties
3: Night Dummy Objects
4: Naming Conventions
5: The Scar File
6: Custom Map Icon
7: About the Night Shift Installer
8: Releasing Double Maps


1: Place Your Map

- Create New Map
You need to save your map under Night Shift project. Night wargear is only activated under the Night Shift Mod. If you are starting a new map the simply select the project from the drop down list.

- Change Existing Maps
If you want to alter an existing map, then copy the sgb (and all the files that belong to it) to this diretory:
..\Dawn of War\Night_Shift\Data\scenarios\mp\
Make sure you rename the recopied map files, otherwise there will be overlapping between the day and the night version of the map.

Important Note!
You can name your map anything, just make sure you DON'T start your filenames with "night_internal_". If you do then the Night Shift uninstaller will remove your maps. This will be detailed later. If you recopied an existing map, then you can simply add "night_" or "night_custom_" in the beginning of the filenames.


2: Terrain Properties

When we changed all the Dow and Wa maps to night, we altered 3 things.

- Lighting:
Sunlight Colour: Full Black
Shadow Colour: In most cases this was lowered a little bit, on winter maps (with snow) it was lowered much more. If you are altering an existing map, you can keep the colour tint, just make it darker.
Shadow Opacity: Unchanged, can be set to anything
Time of Day: Unchanged, can be set to anything

- Fog:
Fog Colour: Full Black
Start Distance: Unchanged, can be set to anything
End Distance: Unchanged, can be set to anything

- Sky:
Sky Model: A night version of every skymap is avalaible for your choice.
Sky Radius: Unchanged, can be set to anything


3: Night Dummy Objects

Without these objects placed on your map, none of the night rules and night wargear will work. Note that you don't need any scar coding for your map to have night, only to place night dummy objects.

The dummy objects are available on the objects panel, here:

A dummy object is small and completely invisible. It has a round selector to make it stand out more from group selections. Dummies can be placed anywhere on the map, they won't interfere with anything.

Selecting already placed dummies is the easiest from the Entity List under the Scenario menu.

The Important Part!
You are needed to place 3 night dummies (one of each dummy) for every player, belonging to the players. 2 player map = 6 dummies, 8 Player map means 24 night dummy objects. No dummy should belong to the world. Please recheck the Entity List before you exit Mission Editor and make sure that the dummies are created properly. This is extremely important!

Example: Entity List from a 6 Player Night Map (18 dummies)


4: Naming Conventions

Two simple recommendations to separate night maps.

Map File Name: night_custom_?p_your_map.sgb
Map Name: [Night] Your Map (?)


5: The Scar File

Although the map would work without its Scar, this must be included too. The scar will tell the Skirmish AI that a night map is being played. The Scar file will also perform the Message Intro.
All you need to do is to recopy and then rename the scar file that belong to Battle Marshes. Some of the scar files are larger in size, those were already present (made by Relic), since such files have been reedited, so don't recopy them.

Notes:
- You can use Notepad to look at or edit the scar.
- If you want to disable the message intro for your map, then you'll need to edit your map's recopied scar file.
- Just remove the line that imports night_introduction.scar.
- Note that importing the introduction must happen after the warning import. So the two default imports come first, then the warning, then the introduction.

Imprtant!
Never include the following files with your map, when you release it to the public: night_warnings.scar, night_introduction.scar, night_indroduction.nis !!!


6: Custom Map Icon

We altered the custom map icon that is visible when you select maps before a skirmish game. We layed "Night Shift" over the image. This makes the fact that it's a night map more obvious. Examples:

Please understand that we do not want to stick our logo on your work! We provide you this source file to create custom map icons exactly as we did. The rest is up to you! If you like it then you can add it, if not then you can add something else or nothing at all.

- Save: MapIcon.psd


7: About the Night Shift Installer

The Night Shift installer and uninstaller was created to detect custom maps. Night map files that belong to Night Shift begin with "night_internal_". This is a warning to you, please don't name your files like that.
Both the installer and the uninstaller will isolate your maps and keep them safe. Both will also show how many custom maps have been preserved.
Another important thing: Never place you custom decals or scenery objects in the Night Shift folder. Put them in either Dow or Wa. You can only place files in the mp folder under Night Shift, all other files will be deleted when night Shift is uninstalled.


8: Releasing Double Maps

It would be wise to release both the day and the night versions of your map together. Supposing that you are making an archive (rar, zip) here are hints about creating your folder structure inside your archive.

- Day Version for DOW: (if you only use DOW elements)
your_archive:\\W40k\Data\scenarios\mp\

- Day Version for WA: (if you use WA elements as well)
your_archive:\\Wxp\Data\scenarios\mp\

- Night Version for Night Shift: (Night Shift inherits both WA and DOW, so it doesn't matter what elements are present on the map)
your_archive:\\Night_Shift\Data\scenarios\mp\

So if the user extracts your archive directly into his Dawn of War folder, all files will be in the right place. The day version will be available as usual, the night version will be only selectable if the user is running Night Shift. (the day version is selectable in Night Shift too)

Mod Support
Whitepaper


Overview
This document explains about night compatibiliy and support for your mod.

Contents:
1: Midnight Shift
2: Level of Support
3: Night Modding
4: Unofficial Support
5: Official Support


1: Midnight Shift

Midnight Shift is a secondary mod shipped with Night Shift. After installing Night Shift, Midnight Shift can be installed from the same installer. The installer automatically detects all required mods and checks their version. It creates reports and provides download sites, if a specific mod is not present or outdated. After Midnight Shift is installed succesfully all night-compatible races will be playable at the same time.


2: Level of Support

Treating every mod that requests night support equally is impossible. There are so many factors to consider. To keep things fair, two levels of support have been established, this way all mods on the same level are treated equally. First you need to determine the level of support for your mod.

What kind of mod?
Your mod should fit into one of two categories. Race Mods. Race mods only add new content, they do NOT alter anything in the game. Conversion Mods. Such mods alter any race content in the game. If they just add new units to an existing race, they will still break the standard balance and count as a conversion mod.
Official Support: Race Mod
Unofficial Support: Conversion Mod

State of the mod?
Any mod that wishes to have official night support must be finished. As finished as the Steel Legion. Version 1.0, with even those units finished that don't need any alteration for night-compatibility. Even if your mod is not finished, you can already start creating night content and test it with night shift.
Official Support: Finished Mod
Unofficial Support: Unfinished Mod


3: Night Modding

Just to be clear, this is your mod and you need to create your night features yourself. We just provide you with new tools to make your mod even better. Do not hesitate to ask for help from the night team or other night-compatible mods, if you are stuck.


4: Unofficial Support

Mods that cannot be supported by Midnight Shift can still have all same the night features. They can even alter existing night content. Teams with unfinished mods can start working on their night features, but their mod won't be supported by Midnight Shift until it is finished.

Steps to Night:
#1. Install Night Shift.
#2. Download the Full Open Source.
#3. Follow the tutorials to add night content.
#4. Add Night Shift as a required mod.
#5. Override Night Shift files that need to be changed to run your mod.


5: Official Support

Your mod will be supported by the next release of Night Shift. Each release increases in version, this ensure multiplayer compatibility since always the same mods are present in the same version.

Support Features:
- The Midnight Shift installer will look for your mod and check its version.
- An error page is returned if your mod is not present or outdated.
- Any number of download locations can be provided on your error page.
- Your mod will be launched as a required mod under Midnight Shift.
- A new version of Night Shift will be released after your night compatible build goes public.

Steps to Night:
#1. Install Night Shift.
#2. Download the Full Open Source.
#3. Follow the tutorials to add night content.
#4. Contact the night team and provide them the files needed to include your mod.
#5. Release your night compatible build

Night Shift
Public Source


Overview
Hpw to set up the Night Shift public source into your Dawn of War install. This is a most needed step before you can start adding night fetaures to your mod.

Contents:
1: Install Source
2: Source Contents


1: Install Source


[ Install Source Part #1 ] Download and Extract

Make sure you that you have both night shift and midnight shift properly installed. The full Night Shift and Midnight Shift source is avalaible for anyone. Remember that you agreed when you installed the mod, that you won't replicate any content from the mod. This applies for the public source as well, by downloading the public source, you accept not to copy any content without the team's permission. Since the public source is over 200 Megs (more than 1 Gig unpacked) the download locations may change often. Below is a link to a page, on which all the current mirrors are available.

Night Shift Public Source Download:
Ageofsquat.com

[ Install Source Part #2 ] Pipeline.ini

Add the following lines to the end of your pipeline.ini
[project:Night_Shift]
Description = Night Shift
DataSource = ModTools\DataSrc\Night_Shift
DataIntermediate = ModTools\DataInt\Night_Shift
DataGeneric = ModTools\DataGeneric\Night_Shift
DataBurn = Night_Shift
DataFinal = Night_Shift\Data
DataExtra =
LocaleFolder = Night_Shift\Locale\English
Parent = WXP
DataSourceShared = ModTools\DataSrc\Night_Shift
DataPreview =
AttrLoc =

[project:Midnight_Shift]
Description = Midnight Shift
DataSource = ModTools\DataSrc\Midnight_Shift
DataIntermediate = ModTools\DataInt\Midnight_Shift
DataGeneric = ModTools\DataGeneric\Midnight_Shift
DataBurn = Midnight_Shift
DataFinal = Midnight_Shift\Data
DataExtra =
LocaleFolder = Midnight_Shift\Locale\English
Parent = night_shift
DataSourceShared = ModTools\DataSrc\Midnight_Shift
DataPreview =
AttrLoc =


[ Install Source Part #3 ] Object Editor Settings

Add the code below to the beginning of the files below.

..\DOW\Modtools\Data\ConditionStringPresets.lua
"SearchLight_true",
"SearchLight_false",

..\DOW\Modtools\Data\ConditionVariables.lua
"Weapon_Range_Upgrade_Light",
"Weapon_Range_Tracking_Light",
"Weapon_Range_Firing_Light",

..\DOW\Modtools\Data\ModifierVariables.lua
"Aim_Horizontal_Light",
"Aim_Vertical_Light",

The above 3 files need to edited so that the night parameters can be selected in Object Editor.


2: Source Contents


The open source doesn't include the mod itself, only the source files.

Under Modtools:
- DataSrc: All max files for all units using night features. Textures also included.
- DataGeneric: All ebp and sgm files.

Night Races: Coding Night Rules


Overview
Learn how night rules are applied and find out how to add the rules needed for your race to work.

Contents:
1: Player Night Dummy
2: Rules of Darkness
3: Race-Specific Rules


1: Player Night Dummy

This is a dummy building that contains all the abilities that unlock the night features.

Parameters:
- Unbuildable structure
- Invisible
- Indestructibe
- Unselectable
- Belongs to the players
- Has the rule of darkness ability
- Has all the race-secific night rule abilities

Relevant Source Files:
..\Attrib\EBPs\environment\night_shift\night_shift_dummy.nil
..\Attrib\EBPs\environment\night_shift\player_night_dummy_1.lua
..\Attrib\EBPs\environment\night_shift\player_night_dummy_2.lua
..\Attrib\EBPs\environment\night_shift\player_night_dummy_3.lua

The lua files inherit the nil file. Each night dummy can only have 10 abilities and one ability is needed for each race. 3 night dummies have been created to maximise the number of race ability slots for the long run. This means that there are 23 race slots avalaible for hosting mods in Midnight Shift. If we run out of slots we can use child abilities to merge races into a single slot, but I would rather not do this before then. So there are 3 night dummies, on night maps one of each dummy is added to every player. The dummy acts like a building that is part of the race, the dummy can be required and can contain abilities that work properly. The Create Night Maps tutorial contains more information on this.

ToDo:
You only need to include the player_night_dummy_2.rgd OR player_night_dummy_3.rgd inside your mod. Mod teams will start filling up the dummy 2 and if we run out of ability slots, then we pass to the dummy 3.
You have to reference your race-specific night ability in the next empty ability slot. Please contant the night team for confirmation about your slot.


2: Rules of Darkness

This is a general rule that applies itself to all races, all units.

Parameters:
- Reduces sight radius to 50%
- Automatic
- Affects everything that belongs to the player: Units, vehicles, buildings.
- This ability belongs to the player_night_dummy_1

Relevant Source Files:
..\Attrib\Abilities\night_dummy.nil
..\Attrib\Abilities\night_dummy_darkness.lua

The lua inherits the nil. Note that this ability is only applied once to each player by the player's own player_night_dummy_1 building.

ToDo:
Nothing. You don't need to include this file in your mod, this part just explains how darkness works.


3: Race-Specific Rules

This is your own rule. This ability will unlock searchlights for your race automatically on night maps.

Parameters:
- Automatic
- Affects every unit belonging to the player that has a searchlight. Also units with nightvision, who need extra model parts to be unlocked on night maps.
- Switches the weapon up on the searchlight's hardpoint, thus unlocking the searchlight.
- One modifier slot for each affected unit
- There is a maximum of 7 modifier slots in abilities. Create a child ability if you run out of slots.

Relevant Source Files:
..\Attrib\Abilities\night_dummy.nil
..\Attrib\Abilities\night_dummy_space_marine.lua
..\Attrib\Abilities\night_dummy_chaos.lua
..\Attrib\Abilities\night_dummy_guard.lua
..\Attrib\Abilities\night_dummy_ork.lua

The luas inherit the nil.

ToDo:
Create you own race's ability and set it up to affect the right units. Then reference this ability in the appropriate player_night_dummy. You need to include this ability as well in your mod to prevent crashing. You MUST send this file to the night team, so that we can make an updated release that supports your mod.

Night Races: Give Units Searchlight


Overview
Complete tutorial about coding, fx and OE, everything related to searchlights.

Contents:
1: Coding Searchlights
2: Searchlight Entity Setup
3: Searchlight FX Setup


1: Coding Searchlights


Searchlights also need coding in 3 places: abilities, ebps, weapons.

[ Coding Part #1 ] Searchlight Ability

Parameters:
- Toggle or Timed, only orks have a timed searchlight.
- When activated it restores the unit's sight radius to 100%.
- Also makes the unit more vulnerable while the searchlight is active.
- The hit events of this ability will make a the illumination icon appear above the unit.
- Applies an event modifier to the unit that triggers the searchlight fx.
- Unlocks the hardpoint that controls the searchlight, making it an aiming weapon.
- It has one of the player_night_dummy-s (the one that contains your race specific night rule) for requirement.

Relevant Source Files: (DataGeneric)
..\Attrib\Abilities\chaos_searchlight.nil
..\Attrib\Abilities\chaos_searchlight_predator.lua
..\Attrib\Abilities\ork_searchlight.nil
..\Attrib\Abilities\ork_searchlight_lemanruss.lua
..and more

Note that the squiggoth has a different kind of ability as the other searchlights. It doesn't use a searchlight weapon, but illuminates everyone, friend or foe, all around the squiggoth.


[ Coding Part #2 ] Unit EBPS

Parameters:
- Reference the searchlight ability.
- Create an event manager entry, you can use whichever event modifier you want, just make sure the unit doesn't use it already. This entry will link the searchlight ability to the searchlight event (referenced here), through an event modifier.
- Create a new hardpoint for the searchlight. You need to use a hardpoint between 1 and 4. Default weapon modifers only work on the first 4 harpoints.
- Two weapons will be on the searchlight's hardpoint. The first is a dummy weapon, the second is the searchlight.
- Add the modifier_apply_ext and disable the searchlight's hardpoint by default.

Relevant Source Files: (DataGeneric)
..\Attrib\EBPs\races\space_marines\troops\predator.lua
..\Attrib\EBPs\races\chaos\troops\chaos_predator.lua
..\Attrib\EBPs\races\orks\troops\ork_looted_tank.lua
..\Attrib\EBPs\races\guard\troops\guard_vehicles_chimera.lua
..more

Note: If your all hardpoints from 1 to 4 are already used, then you can move one of them above 4. (one that has no upgrades with visible button) If you can't liberate any of your hardpoints then it can be done another way, but not recommended. Explaining that is out of the scope of this tutorial, check out how the Heretic is done and contact the night team to help you, if you are stuck. (hint: Mesh Fx in a secondary event modifier, applied by a secondary ability, the searchlight's hardpoint will be above 4, with only 1 weapon on it)


[ Coding Part #3 ] Searchlight Weapon

Parameters:
- Max accuracy, no accuracy reduction while moving.
- Doesn't do any damage to the target.
- Makes the target more vulnerable.
- The illumination icon will appear on the target thanks to the hit events, reference our hit event for all your searchlights. ("Night_Shift\\icon_light")
- Find out the specifics in the nils.

Relevant Source Files: (DataGeneric)
..\Attrib\weapon\chaos_searchlight.nil
..\Attrib\weapon\chaos_searchlight_predator.lua
..\Attrib\weapon\guard_searchlight.nil
..\Attrib\weapon\guard_searchlight_chimera.lua
..more

Note: There is a nil for each race that has searchlights, then each unit has its own lua that inherits the nil. The nils contain all the essential parameters, the luas only define the aim angles and traverse speed, since those may change, depending on the model.


2: Searchlight Entity Setup


[ Entity Setup Part #1 ] Work in 3DSMax

Your searchlight should be animated using one of two methods. 2-Bone method or 3-Bone method. You always use the 2-Bone method, unless the searchlight is on top of a turret that aims. (like pintle-mounted weapons on tanks)

2-Bone Method
You need two bones for your searchlight: one for horizontal aiming (searchlight_neck), one for vertical aiming (searchlight_head).
Anims Needed:
- searchlight_aim_horizontal: All bones except searcchlight_neck are set to Stale.
- searchlight_aim_vertical: All, but searchlight_head are on Stale.

3-Bone Method
Three bones for your searchlight: one for correcting the turret aim (searchlight_corrector), then horizontal aiming (searchlight_neck) and vertical aiming (searchlight_head).
Anims Needed:
- searchlight_aim_horizontal: All bones except searchlight_neck are set to Stale.
- searchlight_aim_vertical: All, but searchlight_head are on Stale.
- TURRET Horizontal Aiming: Everything set to stale, but the searchlight_corrector and the turret horizontal aim bone. You can either create a new one, or merge the searchlight_corrector bone into your existing max file. Animate the corrector bone so that the searchlight ALWAYS looks foward while the turret under it is aiming. Make sure that the searchlight mesh objects are not present in this max file, so that the searchlight only appears on night maps.

Note
- searchlight_vis: This is needed if you have disabled the mesh objects in the searchlight aim anims. Everything set to stale, contains the searchlight mesh objects.
- searchlight_nurnie: If you want the searchlight to replace an existing object on the model, in such case the object is visible on day maps, and the searchlight on night maps. Create an additional max anim file, searchlight_nurnie or else. Everything is set to Stale, none of the searchlight mesh objects are present, only the replacement object. (nurnie means thingie in 3d jargon)

Relevant Source Files: (DataSrc)
..\EBPs\Races\Space_Marines\Troops\rhino (2-Bone)
..\EBPs\Races\Space_Marines\Troops\predator (3-Bone, nurnie)
..\EBPs\Races\Guard\Troops\basilisk (2-Bone)
..\EBPs\Races\Guard\Troops\leman_russ_battle_tank (3-Bone)
..\EBPs\Races\Guard\Troops\sentinel (3-Bone, nurnie)
..more

Example:

The image above shows the 3-Bone Method, for the 2-Bone Method just loose the red bone in the bottom.


[ Entity Setup Part #2 ] Object Editor Setup

You must add custom settings to Object Editor before starting to work there. You need to fully set the night shift source up for this. Read the tutorial about installing the source files.

Parameters:
- is_searchlight_true: Clause. String type , checks if weapon_upgrade_light is equal to searchlight_true, default is searchlight_false.
- searchlight_true: Condition. Contains the is_searchlight_true clause.
- aim_horizontal_light: Modifier. Absolute time. for the aim_horizontal_light lua variable.
- aim_vertical_light: Modifier. For the aim_vertical_light variable.
- searchlight_aim_horizontal: Motion. Uses the aim_horizontal_light modifier.
- searchlight_aim_vertical: Motion. Uses the aim_vertical_light modifier.
- searchlight_vis: Motion. If you use a vis file.
- searchlight_nurnie: Motion. For the daytime replacement object if the unit has one.
- searchlight_true: Action. Contains the following motions: searchlight_aim_horizontal, searchlight_aim_vertical and searchlight_vis. (vis is optional)
- searchlight_false: Action. Only if you use a daytime replacement object. Contains the searchlight_nurnie motion.
- searchlight: Action. Has the searchlight_true action, but only if search_true (condition). You can add the searchlight_false action after. (else)

After you finished the steps above, you must add the searchlight action to every action under the Action tree.

Example:

Note that the above unit has a daytime replacement object, if your unit doesn't, then you don't need the seachlight_false action.


3: Searchlight FX Setup


[ FX Setup Part #1 ] FX Creation

Well this isn't an FX tutorial either. You'd better be familiar with FX creation. Look around the night shift FX folder to find a compatible fx to yours. If not then you can make one from scratch.

Please recopy all fx files that you use into your own folder. Recopy the used luas, tgas, and dds. If you reference any fx directly from night shift, then I can't gurantee that the fx will stay the same in our future releases. Please ensure that there is NO Night _Shift folder in your mod's fx folder!

Important: The searchlight fx only appears when the searchlight ability is active. You don't need to add any FX in OE. Basically your searchlight ability activates an event manager entry (unit ebps) with an event modifier, then this entry invokes an events file that opens multiple fx lua files. All FX activated by the searchlight ability is looping fx.

[ FX Setup Part #2 ] The Events File

Assuming you finished all the searchlight FX, you should create the appropriate events for every FX in Object Editor. Then export all the events together into a single events file. This events file will be referenced in your unit's ebps lua/rgd in its event manager. Note once more, that all FX activated by the searchlight should originate from the events file, not from OE.
If you have trouble creating the events and exporting the events file, go to Ageofsquat.com to find tutorials about these subjects. Please ensure that there is NO Night _Shift folder in your mod's events folder!

Night Races: Give Units Nightvision


Overview
All about coding, fx and OE for units with nightvision.

Contents:
1: Coding Nightvision
2: Nightvision Entity Setup
3: Nightvision FX Setup


1: Coding Nightvision


Nightvision needs coding in 3 places: abilities, ebps, sbps

[ Coding Part #1 ] Nightvision Ability

Parameters:
- Automatic.
- Restores the units sight radius to 100%.
- Applies an event modifier to the unit that triggers the nightvision fx.
- It has one of the player_night_dummy-s (the one that contains your race specific night rule) for requirement.

Relevant Source Files: (DataGeneric)
..\Attrib\Abilities\eldar_nightvision.nil
..\Attrib\Abilities\eldar_nightvision_firedragon.lua
..\Attrib\Abilities\chaos_daemonlight.nil
..\Attrib\Abilities\chaos_daemonlight_bloodthirster.lua
..and more

Note that nightvision comes in many forms, it stands for everything that makes a unit see at night. You can and should be creative.

[ Coding Part #2 ] Unit EBPS

Parameters:
- Reference the nightvision ability.
- Create an event manager entry, you can use whichever event modifier you want, just make sure the unit doesn't use it already.
- Create a new UI hint entry with info about nightvision.
Below is only for unlockable new model parts...
- Only create the hardpoint if you want to unlock extra model parts and not only fx. In this case set the hardpoint parameters as done for the Grot. You need to use a hardpoint between 1 and 4. Default weapon modifers only work on the first 4 harpoints.
- Add the modifier_apply_ext and disable the hardpoint by default.
- Two dummy weapons will be on such hardpoint. These dummy weapons do nothing, only serve to unlock new model parts. You can recopy the grot's dummy weapon for this.
- The process of unlocking model parts for nightvision is very similar to searchlights, read through the searchlight tutorial if something is unclear.

Relevant Source Files: (DataGeneric)
..\Attrib\EBPs\races\eldar\troops\eldar_fire_dragon.lua
..\Attrib\EBPs\races\orks\troops\ork_grot.lua
..more

Note: If you want to unlock extra model parts, but your unit has no hardpoint by default, then things become complicated. Explaining that is out of the scope of this tutorial, check out how the Heretic is done and contact the night team to help you, if you are stuck. (hint: Mesh Fx in a secondary event modifier, applied by a secondary ability)

[ Coding Part #3 ] Unit SBPS

Parameters:
- Create a new UI hint entry
Here are example hints:
- [Night Maps Only] Daemons see just as well at night as by day.
- [Night Maps Only] Eldar armour has built-in functions allowing nightvision.
- [Night Maps Only] There is no difference between day and night for the Avatar.
- [Night Maps Only] Grots use headlamps when working at night.
- [Night Maps Only] The Servitor is equipped to perform tasks at night.
- You can find more hints in the night shift locale folder.

Relevant Source Files: (DataGeneric)
..\Attrib\SBPs\Races\eldar\eldar_squad_fire_dragon.lua
..\Attrib\SBPs\Races\orks\ork_squad_grot.lua
..more


2: Nightvision Entity Setup


[ Entity Setup Part #1 ] Work in 3DSMax

No New Model Parts: If you don't want to unlock extra model parts on night maps for your unit, then you only need to add the new markers for the night fx.

New Model Parts: Create a single vis anim file, that has the new object(s) that will be unlocked on night maps.

[ Entity Setup Part #2 ] Object Editor Setup

No New Model Parts: No changes are needed to your ebp, but you should test and export your fx events file eventually from here.

New Model Parts: Create a motion for your nightvision vis anim, then two actions: nightvision and nightvision_true. Add the the newly created motion to the nightvision_true action. Add the nightvision_true action to the nightvision action. Create a clause (is_searchlight_true) and a condition (searchlight_true). The clause is string type and checks if weapon_upgrade_light is equal to searchlight_true. Default is searchlight_false. Add the clause to the condition. Use the condition with the searchlight_true action, inside the searchlight action. Now to finish, add the searchlight action to every action under your action tree.
You have to add custom settings to Object Editor before the above. You need to fully set the night shift source up for this. Read the tutorial about installing the source files.

Example:

Note that nighvision is called nightgear in the example and the new model parts are randomized.


3: Nightvision FX Setup


[ FX Setup Part #1 ] FX Creation

This is a broad subject, this tutorial is not an FX tutorial. You should be familiar with FX creation. Look around the night shift FX folder to find a compatible fx to yours. If not then you can make one from scratch. Recopy all fx files that you use in your mod, into a different folder structure to ensure compatibility. Please make sure that there is NO Night _Shift folder in your mod's fx folder!

Important: The night fx will only appear on night maps and it appears using an automatic ability. You don't need to add any "night only" FX in OE. So your nightvision ability uses a hit event that references an events file that targets your fx files. Refresh time is 7 seconds. So all your nightvision fx must be non-looping and 8 seconds long. It should fade in and fade out in one second to ensure a smooth transition during refresh. Study the nigvision fx files in night shift.

[ FX Setup Part #2 ] The Events File

Assuming you finished all the nightvision FX for this unit, you should create the appropriate events for every FX in Object Editor. Then export all the events together into an events file. This events file will be referenced four times in your unit's nightvision ability lua/rgd. Note once more, that all night-specific FX should originate from the events file not from OE.
If you have trouble creating the events and exporting the events file, go to Ageofsquat.com to find tutorials about these subjects. Please ensure that there is NO Night _Shift folder in your mod's events folder!

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.