View Single Post
Old 07-17-2005, 04:38 PM   #27
Mostly dormant
stoffe's Avatar
Status: Administrator
Join Date: Apr 2002
Posts: 5,850
Helpful!  10 year veteran!  Notable contributor 
Originally posted by TheOssusKeeper

I was wondering if one of you two or both could take a look and see if Iíve got it right so far
For your spells.2da CopyRow modifiers, you don't need to set the NewRowLabel column if you just want it to get the next free number in line. If you leave it out the application will do that automatically. At the end of the modifier list for each grenade, add one line that stores the row index of your new line for later use.

For Napalm, add:
Column: 2DAMEMORY1
Value: RowIndex

For Flash, add:
Column: 2DAMEMORY2
Value: RowIndex

For Shock, add:
Column: 2DAMEMORY3
Value: RowIndex

And finally for Combo, add:
Column: 2DAMEMORY4
Value: RowIndex

See below for more in-depth description of what this does.

Looking at the titlebar, do you have the patcher inside your Override folder? I wouldn't recommend this, since the game would attempt to load any (still unpatched) data files it encounters within the tslpatchdata folder as well.

Originally posted by TheOssusKeeper
Basically I have no clue as to what the 2damemory thing is or how to use it
2DAMEMORY tokens are a way to temporarily retrieve a value from a 2DA-file and store it for later use. Think of them as memory-slots which can keep track of a value that can then be inserted into other places, like other 2DA files or GFF files. To use the above as the example...


...would look up the row index (ie line number) of your newly added line, and store it in the first memory slot. Aside from RowIndex, you can assign the label of any column in the 2da file to a 2DAMEMORY token, which will then store the value found in that column for the line you are currently adding or modifying.

You can then assign this token to any column (in 2da files) or field (in GFF files), which will make the patcher insert the stored value where the token is encountered.

If, for example, your new line ended up on line number 282 in Spells.2da, whenever 2DAMEMORY1 is assigned to anything, the patcher would insert the value 282 at that place.

This mechanism is used for linking together 2DA files that reference each other, or to insert 2da line references into other files, such as GFF format files.

Remember that instructions are processed in the order they are listed, so you must make sure that you have assigned a value to a 2DAMEMORY token before you try to access that value elsewhere.

When adding new lines, don't assign a value to a 2DAMEMORY-token at the very top of the modifier list since the line isn't added until you've assigned a value to at least one column. Thus the line does not exist yet at that point, and no value can be retrieved.

Originally posted by TheOssusKeeper

or how to get the gff files working like they should be or how to get them to reference the proper lines [Row Label] of the spells.2da in the properties subtype correctly of the uti filesÖ
You use the 2DAMEMORY tokens for this. The four extra modifier lines I described adding above would store the line number in spells.2da for the napalm grenade in 2DAMEMORY1, the line number for the Flash grenade in 2DAMEMORY2, the Shock grenade in 2DAMEMORY3 and finally the Combo grenade line number in 2DAMEMORY4.

Now that you have those values memorized, you need to insert them into your item templates (UTI files) for your grenades.

To do this, you'll need to assign the memorized value to the field within the GFF format UTI file that stores which line in spells.2da is used by the grenade explosion.

Open your grenade template in a GFF editor to find what field this is. Find the PropertiesList field and expand it. If you haven't done anything odd, it should only contain one struct, labeled 0, in a grenade template. Expand this struct and find the Subtype field within it. This is what contains your 2da reference.

To describe how to find this field for the patcher we need to provide the full path in the tree to where it is. This is done by separating the different fields in the hierarchy with a backslash character.

So, back in ChangeEdit, select your napalm grenade under the GFF files heading. Fill in the input fields as follows:
GFF Field: PropertiesList\0\Subtype
Press the button with the red arrow pointing up to add your change to the list. Then select the Flash grenade and fill in...
GFF Field: PropertiesList\0\Subtype
Further, select the shock grenade and fill in...
GFF Field: PropertiesList\0\Subtype
And finally select the Combo grenade and fill in...
GFF Field: PropertiesList\0\Subtype
This will take the stored values and assign them in the GFF file to the field referring to the spells.2da file.

I'm terrible at explaining things but hopefully this make it at least a little clearer...
stoffe is offline   you may: quote & reply,