nn_skinl
nn_lb1
nn_mobile_lb1

Eber Kain's Attribute Editor

attributeeditor1.7.zip

Description

This tool is designed to edit the attribute files used in Warhammer 40K: Dawn of War. For more information/help visit this site.

nn_lb2

README

Eber Kain's Attribute Viewer

READ THIS WEBPAGE   www.eberkain.com/mods/dow_attributeeditor.html

----------------------------------------------------

Preface 

--------------------------------------------------------

This tool is designed to edit the attribute files used in Warhammer 40K: Dawn of War. At this time the files 
must be editied by hand so I hope this tool is a welcome addition for the mod community.

This tool loads the information found in a bunch of attribute files and allows you to create new files 
based on the information found in the other files. It will be applicable to many situations, but may not 
work for all editing situations. If you find any bugs in this tool, or if you have any suggestions about 
a new feature then please Email Me and I will take a look at it.  ([email protected])

--------------------------------------------------------

Getting Started 

--------------------------------------------------------

Before you can use this tool you need to do a few things first. 

Download the Visual Basic Runtime Libraries if you do not alrealy have them

Extract the data files from the WH40K.sga archive using Spooky's Tool or Corsix's Tool 

--------------------------------------------------------

The Interface 

--------------------------------------------------------

To be able to use this tool you must start by learning the different componentes of the interface. 
The following is a breakdown illustrating just that. 

Title Bar 
The title bar is used to display the name of the program. After a folder is loaded its path will 
appear appended to the end of the program title. 

Menu Bar 
The menu bar is where you can access all the menu options for the program, these options are detailed 
father down the page. 

Tree View Area 
This portion of the main window is used to navigate the data contained in the attribute files as a tree structure. 

Root Nodes 
When the program is launched these two nodes are allways created. The List node is collapsed by 
default and the Tree node is expanded by default. The list node will have a child for each attribute 
name that was identified in the load, it's children will not have children. The Tree node will have 
children, and there children can have children to give you a good view of the data in a tree structure. 

Data View Area 
This part of the program is used as a generic display area. It can, depending on the state of 
the program, contain a file list of whats been processed, contain a list of found data related 
to a specific attribute. 

Attribute Edit Area 
This area of the program is used to input and change values of a created set of data. 

Status Bar 
The status bar displays inportant state information as the program is executing. It also 
lets you see some counters used internally by the program. The nodes number is a count of 
the total number of nodes created for the tree view. The names numbers is a count of the 
total number of unique data names found by the program. The files number is the number of 
files that have been processed by the program. 

Slider Buttons 
Although it is not labeled on the picture to the side, the two buttons between the Tree View Area 
and the Data View Area can be used the adjust the relative size of the areas. 

Browse for Folder 
Use this option to open a folder and process all the .lua files found inside it. If a file 
inherits from another file then it too is processed. In some isolated situations a file that is 
inherited is not contained in the same directory, you will have to browse for the file manually. 

Browse for Base File 
Once you have loaded some base information then you can use this option. This option will create 
a new dataset of the found base tree and assign the values that were found in the specified file as default values.
 
Create New File 
Once you have loaded some base information then you can use this option. This option will create a 
copy of the base tree and you will have to manually edit all the values. 

Save File 
Once you have a dataset created and a value assigned to each node then you may use this option to 
export the data to a file.  

 Clear All 
You may use this option to essentally reset the entire program back to the start. It will blank 
out any datasets and any base data you have loaded. 

Clear Dataset 
Once you have created a set of data for a new attribute file, you can use this option to erase that 
tree. It will not effect the data tree.  

 Default 
Using this option resets the proportions of the windows back to default. 

Tree View 
Using this option makes the Tree Veiw Area wider and the Data View Area smaller. This can also be 
achived by clicking once of the buttons between the two view areas. 

Data View 
Using this options works just the opposite from the previous option, making the Data View Area larger
and the Tree View Area smaller.  

 File List 
Clicking this option puts the compiled file list into the Data View Area. 

View Base Tree 
Whenever you load a dataset then the dataset is automatically shown, you may use this option to go 
back and look at the base tree if you need to. 

View Dataset Tree 
Whenever you you have a dataset loaded then this option lets you view the data tree if it is not in view.  

 Include Subfolders 
If you have this option checked then a folder search will also search the subfolders. (checked by default) 

Save Partial Line 
If this option is checked then the program will only save what a line was equil to after if builds the
 nodes from the lines attributes. (checked by default) 

Save Complete Line 
If this option is checked then the program will save an entire line after it builds the nodes from the lines attributes. 

Save File Name 
If this option is checked then the program will record the name of the file where the data was found along with the data. 

Save Line Number 
If this option is checked then the program will record the line numbers where the data was found along with the data. 

Compile Node Tree 
If this option is checked then the program will build a tree of nodes from the data it finds. (checked by default) 

Compile Node List 
If this option is checked then the program will build a list of all the attribute names it finds. (checked by default)  

--------------------------------------------------------

Viewing a Data Folder 

--------------------------------------------------------

Now that you are fimiliar with the interface lets begin by loading some data into the program and looking at what 
we find.

Typically you will not need this but go to the Options menu and check "Save File Name" so you will be able to see 
exactly what is going on. 

Now click the File - Browse for Folder option, you will be presented with a dialog asking for you to browse for a 
folder. Find you Dawn of War/WH40K/Data/attrib/weapon folder and click OK.

Let the program execute, as the program is running you will see the contents of the file it just finished processing 
in the Data View Area. I do not recommend trying to multitask as the program will probably crash if it looses focus. 
I would also not recommend trying to load the entire /attrib folder.

Once the program is finished, the status bar will say "Finished processing files...", the title bar will contain 
the path of the folder you just processed and the Data View Area will have a list of all the files it has processed.

Now navitage the tree to find the requirements - required_1 - is_displayed_requirement, you should see something 
like this.

Now look at the Data View Area, you should see this. 

What this tells us is that there is an attribute in that file, with the names listed on the node, that equils true. 
Using windows explorer I go to that file and there it is. 

GameData["requirements"]["required_1"]["is_display_requirement"] = true

You can freely click on the nodes and see what things equil in what file if you desire. The Data View Area is also 
editable, while it will not save what you may type, you can select it and copy the text if you so desire.


--------------------------------------------------------

Starting a New Dataset 

--------------------------------------------------------
To create a dataset you either select File - Create New Dataset or File - Browse for Base File. But before we do 
that lets talk a bit about the check marks.

You may be wondering why there are green and blue checks everywhere. Well, the green and blue checks identify nodes 
that will be transerred over whenever you create a new dataset. Blue checks are nodes that were found alot and are 
probably require for whatever kind of data file you are working with.

If these checks mean that a node is going to be used, then there must be a way to say a node should not be used. And 
there is. Left click on a node to be sure you have it selected, then right click it to deselect it. You will see that 
the Check was replaced by a red X. This means that this node will not be used when the dataset is created.

This feature may be usefull, but I wouldn't worry about using it until you know what all these different attributes 
are used for and which one you dont need.

Now click the File - Browse for Base File option and select a weapon file like space_marine_sniper_rifle.lua, 
the program will execute and then you will see a new node tree with a bunch of red, green, and yellow dots.


--------------------------------------------------------

Editing a Dataset 

--------------------------------------------------------
Now that you have a new dataset created, and it has been loaded with all the values that were found in the 
space_marine_sniper_rifle.lua file we can edit all the data attributes and create a new file.

A green dot means that the data in that node is ok and can be used. 

A red dot means that the node has no data or bad data, you will not be able to save files when there are 
red dots on the tree.

A yellow dot is a node that has data, but it dose not match any known acceptable values for that attribute. 
If you enter a custom directory or a value outside the know range of a number then it will be a yellow node.

You can see that there are lots of red dots, this means that those values were not found by searching this 
file and all the files it inherits, so they are not needed for this file. To get rid of them we can use the 
Dataset Speed Menu. Open it by right clicking somewhere on the Tree View Area.

Delete Node 
This option lets us delete the selected node and all of its children from the list. 
Duplicate Node 
This option is only avaliable to nodes that are formatted as "name_01". It creates a copy of everything in 
the sub nodes and increments the suffix number. You could use this to add more requirements to a weapon. 
Removed Unused Nodes 
This option runs through the tree and removes any node that has a red dot beside it.  

Click the Remove Unused Nodes option to do away with all the info we dont need.

There are basically 3 types of data in these files, Numbers, Strings, and String Literals. Each type of data 
has a different Attribute Edit Area layout.

For numbers you have a text entry box and a slider bar. You may type anything in the box, but if its not a 
number then it will do nothing. If you type in a number it will replace the existing value that is saved for that 
node. Move the slider then it will change the existing value for that node.

For strings you have a combo box that you can type into, it drops down to let you quickly pick a selection from 
a list of all the choices that were found in the data files. You will also notice the two buttons called file and path.

If you use the file button it will insert the name of a file without the path or the extension, and it will be 
quoted. This syntax is for icon names, and referenceing other .lua files. 

EX: GameData["squad_loadout_ext"]["trooper_base"]["type"] = "chaos_predator" 

If you use the path button you can browse to a folder and it will insert the entire path into the text 
of the combo box. You will have to edit it to make it exactly what you want, but at least you didn't have 
to type the whole thing.

For string literals you have a simple text box that you can type into. Remember that string literals are 
defined like "$90001" in the packaged files.

Go down to the bottom of the file and find ui_info - help_text_list - text_04 and left click it to select it. 
Right click on the Tree View Area and choose Duplicate Node.

You should now have a text_05 node, select it and change the value from "$98113" to "New and Improved Version". 
This should add a new bit of text to our weapon desctipriton.

Now look up the tree an find cost - time_seconds and change it to 1.5. This should be the time required 
to upgrade a soldier with the weapon.

Now selecte the node ui_info - icon_name and used the drobdown list to change its value to 
"space_marine_icons/upgrade_predator_lascannon_L"


--------------------------------------------------------

Saving a Data File 

--------------------------------------------------------
New we have our new version of our weapon ready to go, lets save it and have a quick look to see that 
the changes are there.

Cilck the menu button File - Save File and you will be presented with a common save file dialog box. 
You should still be in the same folder where we selected the base file. Browse back over to the 
space_marine_sniper_rifle.lua file and right click it and rename, and the prefix old_ onto the front of the filename. 

Now save our file as space_marine_sniper_rifle.lua and you are done.

Open the new file in a text editor and you should find these lines containing the information we changed. 

GameData["ui_info"]["help_text_list"]["text_05"] = "New and Improved Version"
GameData["cost"]["time_seconds"] = 1.5
GameData["ui_info"]["icon_name"] = "space_marine_icons/upgrade_predator_lascannon_L"

Load the game and you should find that you have replaced the old sniper rifle with a new one.

There are no comments yet. Be the first!

nn_skinr