View Single Post
Old 08-13-2007, 01:28 PM   #237
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Kristy Kistic
Hi Stoffe

Is there a way to check if a field already exists in a gff file before actually adding a new one? (Like the ExclusiveColumn token for 2da's.) The point being I'd like to avoid adding the exact same field if it already exists.
I've made a quick modification to how the TSLPatcher modifies GFF files. If it now encounters a field with the same label, data type and position in the GFF tree as one it tried to add it will not add a new field, but modify the existing field instead, setting the values the new field would have been given.

The exception is structs added to a List field since they have no label, but are rather accessed by the list index they are added as, which would be dynamic if some mod has already modified the same file earlier.

I've uploaded version 1.2.9b which contains this change. See the first post (or the SWK Modding tools page) for a download link.

Same disclaimer as usual: This has only been minimally tested so use it at your own risk. It seemed to work as intended when I tried it, but there might be bugs and oversights. If you notice anything odd please let me know.

stoffe is offline   you may: quote & reply,