RDNWiki : DOWTutorials/SpliffUnofficialModGuide

Unofficial Mod Guide by Spliff

For version 1.0 of the Mod Tools
This was recovered from a user wiki dedicated to Dawn of War which was closed after inactivity. Hopefully, the information sans pictures (for now) is a good starting point for some information. (Page source from Googlecache).

NOTE: This was made for version 1.0 of the mod tools. Apart from formatting, it may be inaccurate. Updates may happen to this document, when it has been updated, this message will be removed.

See also: Corsixs Guide For Newbie Modders

Contents

DISCLAIMER


DON'T BLAME ME.

[AGREE] (Yep, I'm a reasonable person and I take responsibility for my own actions)

[DISAGREE] (No, I always blame others for my stupidity and carelessness)

I'm sharing this with the modding community on that basis because I'd like Dawn Of War to reach its full potential. Warhammer 40k has been around forever, despite the fact GW had a consistent run of crappy computers titles. GWI picked the right team this time. Dawn of War is not only the best game GW ever franchised, it's also the most elegant and flexible RTS engine i've ever seen. Like a piece of art wrapped around a million volts – it's potential is huge.

WARNING: This is a reference, not a step-by-step tutorial, but it will still help you solve a few common problems. If you are new to modding, please read the following condescending tripe first, it will save you and others much trouble, thanks.

NEWBIE GUIDE TO MODDING


Modding is not easy. It requires time, energy and patience. You will need to learn new things. Sometimes you will break things and the game will stop working. Be prepared to spend at least an hour just setting up the tools you need and learning the overall data structure. Another 5 hours might be required to learn basic lua programming. Want to model 3D characters? Then add another day – minimum.

Every step you take will require testing. Soon you will know the 'Loading...' screen right down to the last pixel. Still reading? Good, you may have the patience required to be a modder, but do you have the right attitude. Many people come here expecting other people to instantly solve their problems before taking any meaningful steps to solve it themselves. Modders' despise people like that. 'n00b wants this', 'help! newbie want's help!'. Bah!! We all want help, that's the whole point of coming here! By asking questions already answered here, on Google, in Readmes or elsewhere in the Relic forums you contribute NOTHING to the community and take time away from others.

Use your OWN TIME to do your research, use the 'Search' feature on forums (Currently disabled due to traffic overload), or just do tests until it works! Share your *original* findings with others. If you do that people will will notice, respect you, and your questions will start to get answered. Remember what I said about patience? Finally are you here for the right reasons? Do you like a challenge? I hope so because if you're here for wealth and fame I think you took a wrong turn somewhere. Very few mods ever find commercial success. In fact only about 1 mod in 100 is ever even finished! It isn't wealth, it's the *challenge* that drives us. Good work is it's own reward.

Still here? I like you already! Take a deep breath and continue onto the good stuff...

THE BASICS


Firstly, If you can't find any of the files described here make sure:

1. You've extracted them or downloaded and installed them correctly
2. You're using the correct version of DOW.
3. You're replaced %IDENTIFIERS% with correct values.
4. You're looking in the right directory.

Conventions


Any time I write %THIS% in a description of code it means I want you to insert a value there before using it. ie:

Data:%YOUR_MOD%\%MOD_VERSION%\Data

becomes:

Data:MyTauMod\v0.5\Data

Obviously this requires some intelligence on your part, since I'll often require you to come up these values yourself.

If I use the form %POP_CAP(0–9)% it means the value must fall within the supplied range. You may also see %TARGET_LOCKED(0,1,4)% meaning 0 or 1 or 4. If an identifier ends with a ? (question mark) it means I'm not really sure. ie. %RANGE (0–100?)%. You'll just have to experiment.

Accessing Game Data


You need to extract the files. (See: Mod Packager Documentation)

Editing Game Files


Writing Scripts


You need to understand Lua syntax (which isn't hard) and the concept of tables. You should also note that lua can reach deep into the game and tweak C variables so it isn't a sandbox you can modify at will. Certain values will crash the game. This is mostly made up of strings found in the core exe and dlls. In other words it's mostly guesswork as to which functions do what. Some functions may not be implemented. Some may only work in certain files, at certain times, or only in the console. Some may not even be functions at all! Nonetheless is is still a valuable resource at this point in time – until an official SDK is available.

NB: Used to mention: «I am compiling a list of commands, variables and functions used by DOW at The Epic Legions Site (http://epiclegions.warriorhut.net).". This, obviously, in the author isn't contributing here, has stalled. See instead: SCAR functions and Attribute Editor info.

Creating Mods


Advanced: (Everyone else wait for mod manager tool). According to Sv K:

W40K.exe -modname %MODNAME%

Create your mod files in Dawn of War\%MODNAME%\Data instead of Dawn of War\w40k\Data\ Copy Dawn of War\w40k.module and name it Dawn of War\mod.module

Edit two things in Dawn of War\%MODNAME%.module
  1. Change "Name=w40k" to "Name=%MODNAME%
  2. Add new new DataFolder line, like this: "DataFolder.5 = %MODNAME%"

Create a shortcut to Dawn of War\w40k.exe Add -modname %MODNAME% at the end, like so. Target: "C:\Games\Dawn of War\W40k.exe" -modname %MODNAME%

Access the Console


Use CTRL-SHIFT-~ (tilde). Some computers use different combinations (CTRL-SHIFT-Something). Some commands may require you to run DOW as Path\to\DOW\w40k.exe -dev You can do this from Start Menu->"Run...", from a shortcut, or via the command prompt. For more advanced information, see the Dawn of War Console page.

RACES


Once the files are extracted (see above) you'll find most race statistics in:

W40k\Data\attrib\racebps\%RACE NAME%.lua

Adding a Race


Creating a new race: in depth (Editors note: not in wiki)

Orks: In W40k\Data\attrib\racebps\ork_race.lua
GameData["race_details"]["playable"] = true

Example new race: Imperial Guard: Download Cadian Inquistion (http://forums.relicnews.com/showthread.php?t=38239)

Changing Population Cap and Squad Limits


In W40k\Data\attrib\racebps\.lua:
GameData["modifiers"]["modifier_%X%"] = Reference("support_cap_player_modifier")
GameData["modifiers"]["modifier_%X%"]["value"] = %(1.0-100.0?)%

X: Choose a number not already used. Add a 0 if under 10. ie: “modifier_05”

SQUADS


Once the files are extracted (see above) you'll find most squad statistics in:

Cost


These attributes control the cost of squads. The values are set PER TROOPER in the unit EPBS file and then automatically multiplied by the number of troopers in the squad.

GameData["cost_ext"]["time_cost"]["cost"]["power"] = = %( 0-1000? )%
GameData["cost_ext"]["time_cost"]["cost"]["requisition"] = %( 0-1000? )%
GameData["cost_ext"]["time_cost"]["time_seconds"] = %( 0-1000? )%

WARNING: The following are obsolete but Relic left them in. They do nothing:
GameData["cost_ext"]["cost_power"] --OBSOLETE
GameData["cost_ext"]["cost_req"]   --OBSOLETE
GameData["cost_ext"]["cost_time"]  --OBSOLETE

The cost of reinforcements is set in:

Spawning


There's a discussion on scripted spawning and upgrading of squads here (http://forums.relicnews.com/showthread.php?t=40804).

TROOPS


Once the files are extracted (see above) you'll find most unit statistics in: Data\attrib\ebps\races\%RACE%\troops\%UNIT%.lua

And some additional rendering properties in: Data\art\ebps\races\%RACE%\troops\%UNIT%.lua

Resizing units


In Data\art\ebps\races\%RACE%\troops\%UNIT%.lua add:
vis_scale_min = x.xx, -- where x.xx is a scaling factor. eg. 1.50 = %150
vis_scale_max = x.xx,

If min and max are different then the size will be random (between the two values).

You should also change the shadow_scale (or even the shadow_type) for each unit you scale. As a rule of thumb large and complex units (dreadnoughts and above) should have level 3 or 4 shadows and small units use the lower values. Using level 4 for everything probably looks cool but I doubt the game would run very fast. Level 0 turns the shadow off.

You also need to change the size of the unit blueprint. This is an invisible box that surrounds the unit. It is mostly used for collision detection. It also affects how close units will get to other units (ie. a smaller value gives you tighter formations.) If this value gets too low you will see models intersecting and overlapping other models. I'm not sure if this value can be changed during play but if so it could be used to implement a "spread out" order for a squad.

In Data\attrib\ebps\races\%RACE%\troops\.lua add/modify:
GameData["entity_blueprint_ext"]["scale_x"] = x.xx -- length 
GameData["entity_blueprint_ext"]["scale_y"] = x.xx -- width  
GameData["entity_blueprint_ext"]["scale_z"] = x.xx -- height

Dead Body Decay Time


Check for these in attrib\ebps\races\%RACE%\troops death_event_delay look at the eldar Avatar and the Chaos Bloodthirster

Line of Sight Distance

GameData["sight_ext"]["sight_radius"] = metres

BUILDINGS

Change the Type of Squads a Building Produces

GameData["spawner_ext"] = Reference("spawner_ext")
GameData["spawner_ext"]["squad_table"]["squad_0%X%"] = "guard_squad_soldier"

Change the X above to the highest number available (but less than 9) so it doesn't conflict with another squad type. Make sure a research option hasn't taken it's spot on the taskbar.

WEAPONS

Range of Weapon

GameData["max_range"] = metres

Damage and Armour


SvK posted an excellent explanation of this in “Working on an armour explanation”. (specific post)

MOVIES

Adding Movies


These are DivX format in an AVI container with the FourCC code changed. According to Greeboo:
"You encode the video with divx 5.11, resulting in an AVI file and then change the FourCC-Code (which identifies the Codec used for compression in the Avi file) to "DXGM" by using any kind of FourCC changer (like nic's FourCC changer, included in the xvid installer). Then you change the information in the .lua file to play back your video, and it should work.

Skipping the Intro Movies


Add the parameter “-nomovies” to your shortcut (just like -modname and -dev), or delete or rename the AVI files in Engine\Movies (but then you can't get them back of course!)

Adding Scripted Movies


These, the cutscenes in the singleplayer campaign, are done using Non-Interactive Sequences (NISlets)

CAMERA


(See also: Console Commands)

Camera Height


Extract Engine\Engine.sga In Engine\Data\camera_high.lua: lower DistMin or increase DistMax. You may also want to increase the maximum view distance.

Increasing Maximum View Distance


This changes how far you can see. It is not the same as changing the camera height. At the console type:
simvis_camerafarclip( %DISTANCE IN METERS% )

Rendering Mode


Various aspects of the rendering engine (terrain,shadows,water etc..) can be toggled. Type simvis_list in the console to see which 'channels' can be changed, then simvis_toggle( "%NameOfTheChannel%" )

Hiding the Fog


This is the brown fog that obscures distant objects, NOT the Fog of War (See: Unit LOS). Turning it off will cause pop-up artifacts on distant objects. This can be reduced by setting the camera_farclip distance at the cost of reduced framerates. Type ##fog_toggle## at the console.

Hiding the User Interface


Useful for screenshots. These is a good list of commands to hide the different parts of the user interface, but taskbar_hide then taskbar_show are the most common to use. See also: Capturing Screenshots.

taskbar_hide
Hides the large map, menu buttons and other controls. Use taskbar_show to reverse it.
message_hide
Removes “Pause” “Defeated” and “Replay” messages (the white text centre top of the screen). Call message_show to reverse.
ingame_select_ui_toggle
Removes selection information (the circles and boxes around things) from the screen. Can only be called with -dev on the Dawn of War shortcut (see introduction). Call again to reverse.
ingame_stats_toggle
Removes health bars and other similar icon information from the screen. Can only be called with -dev (see above). Call again to reverse.
ingame_stats_mouseover_toggle
Removes any mouseover things for statistics.
W40k_ShowSystemMessage("")
Makes sure no system messages get in the way.

Edit Building and Squad Command Panel(Taskbar)


This is the chunky panel at the bottom of the screen. Edit W40K\Data\Game\taskbar.lua

CONTROLS

Changing Default Key Bindings


Edit \Profiles\Profile1\W40k\keydefaults.lua It's pretty self-documenting so I won't say much about it.

MISCELLANEOUS

Taking Screenshots


Press Alt+PrintScreen. The files are saved in the screenshots directory. (see also 'Hiding the User Interface').

Game Speed


setsimrate( %number% ) in the console.

Fast Quit


Bring up the console and type quit.

REFERENCES


Complete List of DOW Script Objects

Objects Listed Alphabetically (Editors note: Not in wiki)

Objects Listed By Category (Editors note: Not in wiki)

CREDITS


I've benefitted greatly from tools provided by other members. Spooky's tools come to mind, and the Relic forums (http://forums.relicnews.com/).

CONTACT


epiclegions(at)warriorhut(dot)net – you MUST include 'Dawn of War', 'DOW' or 'Epic' in the subject line. If you don't my spam filter will eat it. This protects me from email scrapers (and people who don't follow instructions).

I am happy to answer any question you have about modding this game provided you are prepared to do me a small favour. Take the time to read this whole document. It explains pretty much everything I know up until now, with few things I don't know thrown in. If you find this information useful, you can repay me by filling in the blanks, correcting my obvious fuckups, or donating something cool to the Epic Legions MOD. It can be anything you like as long as it's cool. If you don't know wether what you have to offer is cool, then it is definately NOT cool. Understand?

Reproduced without permission from http://epiclegions.warriorhut.net/coding/dow_mod_guide.html I hope you don't mind Spliff :) Mandrill

I don't mind at all. I always wanted it to be a wiki anyway. SpliFF

End of Page

Referring pages: DOWAttributeEditor
DOWTutorials
DOWTutorials/SpliffUnofficialModGuide
RDNWikiHome