|
|
|
|
# 1
|
|
Ouroboros-in-training
Join Date: Jul 2006
|
Theory: LUAs & RGDs – The Foundations
Rating: Rookie Friendly
Just a note: even though I’ve laid it all out here it will still take some brain power and some experimentation to figure what it going on. Please don’t just post on the forums straight away as soon as you don’t understand something. Have a crack at it. Keep working at it. Sleep on it. Have some more attempts. Then think about asking for help. Learning how to problem solve on your own will serve you much greater in the long run and feel much more rewarding for you. Modding can take lots of head scratching, so get yourself ready to do some. Get a drink, get some brain food, get some decent music on and get modding. Some definitions Mod = Module, Modification or Modified Version Game Manager = an option on the Dawn of War Main Menu that lets you switch between mods. Version Number = the number you have used to represent the state of development for your mod. This is in the same style as patch numbers. Players must be on the same version number of the same mod to play each other. Check the top left corner of the screen when on the main menu to see what mod and what version number you're playing. Distinct Mod = a modified version of the game which will require switching to in the Game Manager. A distinct mod will not be playable in multiplayer unless the other player has exactly the same version as you. There are many ways to mod. None of the new file types you’ll see are essential/the most important; it all depends on what kind of modding you are doing. This primer will revolve around the Relic Attribute Editor and creating a Distinct Mod. Modding can make little or no sense at first. I will try to make sense of some of it for you here. .lua ---> .rgd Although there are many areas in which to mod almost all modders will have at least a basic knowledge of the Attribute Editor. It is the most powerful and key tool for changing the gameplay and yet most of its results are unseen and "under the hood". Start your journey here and Dawn of War will open right up in front of you. One Way Street The Attribute Editor (AE from here on in) edits .lua files. It also "burns" .lua files into their counterpart binary form: .rgd. The .lua -> .rgd transition is, for all intents and purposes at this point, a one way change. .lua files cannot be converted to .rgd and then back to .lua without any loss (currently). Relic does not give us a tool for converting .rgd to .lua; any tools for this are not officially supported and will incur information loss (but potentially an acceptably small amount - it depends on your tastes). What’s The Difference? The .luas are there for the purpose of our modding. If we do not mod then we do not need the .lua files. The .luas are what the AE reads and they are also readable by a text editor and sometimes require being edited by hand. The fact that they are intelligible to humans is their main purpose. The .rgd files are binary and cannot be read by a text editor, they are only read by the game engine. There are various modder-made tools out there that edit the .rgd files directly; these have certain benefits and disadvantage over .lua editing. I will not be covering those Tools here in any of these tutorials as I strongly prefer .lua editing over .rgd editing. (However, it must be noted that .rgd files are not simply .lua files in binary: they are slightly different, but the difference is subtle and will not make much sense until you understand Inheritance.) It is important to understand that .lua files as read by the Attribute Editor DO NOT affect the game in anyway. Read that sentence again. You can edit/delete/create .lua files till the sun expires and your mod/copy of DC will not alter one bit. The files that affect the mods are the binary .rgd files. If you forget to burn the .rgds ("Save" will not burn them, but "Save Binary" will) in the AE then no changes will appear when you play your mod. Where Are They? So where do these .lua files come from then? Answer: Relic. Relic provide the .lua files for Dark Crusade in their DC Mod Tools pack. Where? THQ/Dawn of War – Dark Crusade/ModTools/DataGeneric/DXP2/Attrib or W40K/Attrib. Go take a look. Okay, so you’ve had a look at them and they make NO sense to you. That’s fine; they don’t make that much sense to anyone at first. Now you might be wondering: "okay, so where are the .rgd files?" Nowhere. You haven’t got any yet. .rgd files are not used in the unmodded Dark Crusade and you don’t have a modded version of Dark Crusade yet so therefore you don’t have any .rgd files. You will probably make some very soon though. The Altered Files .lua Files How it all works (assuming you’ve set up your first mod correctly): you will open the AE and it will read the .lua files for your mod. At first the folder full of .luas for your mod (from here on I will call it DataGeneric/YourMod) will be empty, but your mod will be based on a certain specified version of the game (in almost all cases this will be Dark Crusade) and the AE will read the pipeline.ini file to find out which this is. It will then load up the .lua files for the game it is based on from that games’ DataGeneric folder. For Dark Crusade this is ModTools/DataGeneric/DXP2/Attrib. These will be the files that there when you first open the AE. Let’s say you change a few stats and alter a few .luas. When you then "Save" in the AE all the altered .luas (marked with an asterisk*) will be saved in their altered form in DataGeneric/YourMod. The .luas from the game it is based on (Dark Crusade) will not be touched at all. They remain unchanged in the DataGeneric/DXP2/Attrib folder. This is what you want. They need to remain the same so that when you start a fresh mod you have the default information again. When you load up the AE again next time the AE will read for any .luas in DataGeneric/YourMod first and then it will fill in the rest that are missing from the DataGeneric/DXP2 folder; any .luas in DataGeneric/YourMod will override the originals in DataGeneric/DXP2, but they will not overwrite them. So that’s how the .lua files work. Weird huh? Or if you’re lucky: not so weird. .rgd Files Now onto .rgd files. These work in a similar way. Instead of ModTools/DataGeneric/DXP2 you have Dawn of War – Dark Crusade/DXP2/data.sga. Instead of ModTools/DataGeneric/YourMod you have Dawn of War – Dark Crusade/YourMod/Data. Instead of pipeline.ini you have YourMod.module. When the game loads up Relic DC it will read YourMod.module and find out what game it is based on. This will be Dark Crusade. The data for this is stored in DXP2/data.sga (among other things) which is an archive and cannot be read by us until extracted. This archive is includes all the .rgds for the game but they’ve been converted and compressed into this archive. When you extract the archive you will get a load of .rgd files among other things. When DC is loading up your mod it will look at Dawn of War – Dark Crusade/YourMod for any .rgd files first. If any are present these will override the corresponding part of the data.sga and it will then fill in all the rest of the files from the archive. EG – you have taken the hard cap off Terminators. The game will load up all the usual DC data from the data.sga, but the Terminators.rgd file will override the bit about Terminators in data.sga. So your mod will be identical to Relic DC and will be loaded from the same place as well, apart from your Terminator file which will override it and take priority. Enjoy your unlimited Termies. To recap: DC reads the Dawn of War – Dark Crusade/YourMod folder when it loads your mod up. This means that any and all information regarding changes to gameplay, art work, textures, scar coding that you want for (and only for) your Distinct Mod must be in this folder. The only file outside of this folder that will affect your Distinct Mod is YourMod.module. (Yeah, okay, apart from any .dll edits you’ve done. :P). If you put changes into the DXP2 folder then you will see these changes in game, but you will see these changes in Relic DC and every other mod as well and it will break multiplayer for you. Yay! This is what I mean by for, and only for, your mod. Leave DXP2 well alone as far as changing attributes is concerned! Overall: -.lua to .rgd is a one way change. -.lua files are for modding, .rgd files actually change the game: no .rgd = no change. -DataGeneric/YourMod will contain altered .lua files (inside Attrib folder). -Any .rgds in Dawn of war – Dark Crusade/YourMod will override the corresponding part of the game when you load up YourMod. -pipeline.ini tells the Attribute Editor which .lua files to load from after DataGeneric/YourMod. -YourMod.module tells the game which game files to load from after DoW – DC/YourMod. -Any files in the wrong folder place will have no effect. -The original game should remain intact and unchanged. Please keep me informed of any technical and grammtical errors. Last edited by Octopus Rex : 21st Aug 07 at 1:34 PM. |
|
|
|
|
# 2 | |
|
Guest
|
Great tutorials Rex, It is your 5 tutorials that have given me enough knowledge to have a go myself.
Anyway, I have a question for you, Quote:
I am trying to edit/add to an existing mod which is all RGD's, but I would really like to continue using AE as appose to Corsix's editor. So how much loses are we talking here? Would I end up re-making half the file? or would it jumble things up and basically destroy the file? And would you know what RGD>Lua converter would be best for these files? Thanks for any info you can impart Rex ![]() |
|
|
|
# 3
|
|
Ouroboros-in-training
Join Date: Jul 2006
|
The loss is acceptable, there's no actual game data loss and you won't need to edit them to be used. You can use Corsix's tool to dump the whole set to LUA but you will lose inheritance trees. This is not too bad really as after WA patches we were using CorsixBrand LUAs all the time. To get a feel for it - open the AE, go to View and use Folder View. This is what it will look like and be used like. The files will be organised as they are in the DataGeneric folders.
Rumours says that Corsix is going to work in inheritance into his tools at some point, but until then you'll find that the LUAs that get burnt contain all the information each, rather than just the changes from the partent. Glad my tutorials helped someone! Good luck. |
|
|
|
|
# 7 |
|
Guest
|
ye I've added all the closer to codex models and they all work so i think my mod setup is good. it says there are problems with illegal inheritance. i used corsix mod tools to dump the rgd to lua and am using atribb editor for 1.41 patch an i have winter assault but not dark crusade.
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|