Author Topic: Adding Columns  (Read 456 times)

Legacy_NorthWolf

  • Full Member
  • ***
  • Posts: 143
  • Karma: +0/-0
Adding Columns
« on: December 28, 2010, 09:31:42 pm »


               I'm wondering if it's safe to add columns to 2da's used by the system. For example, I want to add a column in the parts_*.2da set to specify whether or not the model is male exclusive, female exclusive, or available to both gende (to assist with tailoring models). Is this possible, or does it break the game (or cause some detrimental behaviour otherwise)?

Thanks in advance.
               
               

               


                     Modifié par NorthWolf, 28 décembre 2010 - 09:32 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Adding Columns
« Reply #1 on: December 28, 2010, 09:49:32 pm »


               The official documentation stated that it is safe as long as you Append the columns to end. There was one 2da that did not follow the rule of appending the new column at the end, I can not remember what one it was at the moment. But I will see if I can find wich one it was. 

EDIT:

From the 2da file format:


Lines 4 to infinity - row data

All lines after and including line 4 are data rows.
Each column in a row is separated from the other columns by one or more space characters. When
viewing the contents of a 2da using a fixed-width font, the columns in each row do not have to visually
line up with the columns in the other rows, but for ease of reading, it is best to line them up anyway.
The very first column in a row is the row's index. The first data row (line 4) has an index of 0, the
second data row (line 5) has an index of 1, and so on.
Every row must contain the exact same number of columns are there are column names given in line 3,
plus one (since the index column has no name).
If the data for a column is a string that contains spaces, then the data for that column should begin with
a quotation mark and end with a quotation mark. Otherwise, the text after the space will be considered
to belong to the next column. Because of how quotation marks are handled, a string entry in a 2da can
never contain actually quotation marks itself.
4. Maintenance

After a 2da file has been created and support for it has been added to the game and/or tools, it will often
be necessary to make changes to the 2da. The following rules govern how to safely make changes.
Columns

Applications may reference a column by position (column 0, column 1, etc.) or by name. To avoid
breaking code that depends on column position, the following rules apply:
BioWare Corp.
http://www.bioware.com
· Always add new columns after the very last column.
· Never insert a new column inbetween two existing ones or as the first one.
· Never delete a column from a 2da.
· Never rename a column.
· When adding a column, make sure that all rows include entries for the new column.
Rows

Many game object properties are integer values that serve as indices into particular 2da files.
Consequently, care must be taken when changing 2da row data to ensure that a minimum amount of
existing data is affected by the change.
Always
add rows to the very end of the file.
Never
insert a row inbetween two other existing rows.
Never
delete a row. If it is necessary to remove the data in a row, fill the row with **** entries instead.
Try to ensure that no existing data, in a 2da or otherwise, references the starred-out row.


               
               

               


                     Modifié par Lightfoot8, 28 décembre 2010 - 09:58 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Adding Columns
« Reply #2 on: December 28, 2010, 10:17:44 pm »


               Ok, this is from the Bioware Aurora Item Format.  It is the one case where you do not add columns to the end.
It is in Refferance to the itemprops.2da colunm Label

Programmer label.
Depending on the row within itemprops.2da, there may be
multiple additional columns after the Label column, with
no heading. This is a violation of the 2da formatting
convention where all rows have the same number of
columns and all columns have a header.
However, this violation of the rules does not matter,
because in this case, the Label column is known to always
be the last column, with no meaningful columns after it.
This is the only 2da where, if you wish to add columns,
you should insert them, not append them to the end. The
insertion should be immediately before the Label column.


               
               

               
            

Legacy_NorthWolf

  • Full Member
  • ***
  • Posts: 143
  • Karma: +0/-0
Adding Columns
« Reply #3 on: December 29, 2010, 10:06:36 pm »


               Much appreciated, Lightfoot.