View Full Version : splicing .dat files
coolpotatoes
08-31-2007, 5:50 PM
I have been thinking about working with a friend on a mod, and wondered if we each modify the .dat files for one race, is there any way to take the two .dats and splice them together? ie. I do protoss stuff, he does terran. is there then any way to merge my protoss changes with his changes for the terran, without manually using DatEdit to open one of the files, then modify it entry by entry to look the the other?
Kawagata
08-31-2007, 6:00 PM
no, you can't splice them. Someone asked this before..
DiscipleOfAdun
08-31-2007, 6:17 PM
Currently this is not possible. However, perhaps some future release of Datedit might have the capability to merge the changes from 2 .dat files. The main issue is dealing with changes that occur for the same data in both files. However, making one file take precedence over the other solves this.
Probably the best option would be to give the user the ability to select what happens. A small list like:
-Ignore Both (causes dupe data from each dat file to be disregarded and leaves the default data in place)
-1st File (Causes the 1st dat file to override the second if there's dupe data)
-2nd File (Obviously same as the one above but reversed)
and though I'm not sure it'd be easy:
-Always Ask: (If Datedit comes across dupe data it will display a popup asking the user to select which data to use (1st file, 2nd file, or neither)
/wishful thinking
coolpotatoes
08-31-2007, 8:23 PM
oh well, thanks anyways guys.
loads_of_fun
09-01-2007, 5:18 AM
Did you guys forget about Arsenal Zero? So it is not automatic but it is better then running DatEdit x2 and manually doing it that way.
http://www.starcraft.org/downloads/CustomsDownloads/Expert/Arsenal%20Zero
@ Every one else i might post every now and again (got back into SC) mainly just lurking when bored tho.
ShadowFlare
09-01-2007, 4:31 PM
It may be possible to splice them together with some other type of utility. There are utilities that can be used to compare an original file with two or more different modified versions and put all of the changes from all of the modified versions together into one file. Considering the fixed nature of the dat files (as in, the size of the file and structure of the file being fixed), it would probably work.
actually im not sure if this will work but it shud but u can download mpqdraft and in ur example u said u wud do protoss stuff for example so finish ur changes with that race then save all ur stuff into a .mpq file and call it protoss i guess then ur friend to make one call terran and save that to a .mpq and when u open mpqdraft go to the button "Load Mpq Patch" and select starcraft and wen it comes to the screen for which u can select .mpq's jus tick the terran.mpq and the protoss.mpq
im not sure if that helps any or even if thats wut ur askin lol :confused:
ShadowFlare
09-02-2007, 10:59 PM
That will not work since the file name would be the same for the file in both mods. Heh, you haven't actually done any .dat file mods for Starcraft before, have you?
BroodKiller
09-07-2007, 9:03 AM
Heh, funny enough, but that's the latest idea that I got for the upcoming 1.5 release, so expect to see a "Merge DATs" feature :) I simply can't make it - I keep getting more ideas every time I am 100% sure I am done :P
EDIT: Ah, and just FYI 1.5 already has a "Compare DAT files" feature.
coolpotatoes
09-07-2007, 8:09 PM
Awesome!! Out of curiosity do you have any idea when you might have a public version of DatEdit 1.5 ready? Or is it still to early to tell?
Well, considering that 1.5's been "ready" for the past month or two we could be in for a wait. :P
BroodKiller
09-09-2007, 12:53 PM
Heh, 1.5 has been at works since about January or something. At the current moment it is still 99.99999% complete, with the remained being last-minute ideas, like the above one :P
DiscipleOfAdun
09-11-2007, 2:13 AM
Heh, 1.5 has been at works since about January or something. At the current moment it is still 99.99999% complete, with the remained being last-minute ideas, like the above one :P
Yeah, and every new idea adds another 9 to the end of that. I wanna see 100 9's before that thing is finally decided done. :P lol, jk. BK, your awesome for updating it. I also think adding this will be amazingly helpful.
BroodKiller
09-11-2007, 3:22 AM
Yeah, and every new idea adds another 9 to the end of that. I wanna see 100 9's before that thing is finally decided done. :P lol, jk. BK, your awesome for updating it. I also think adding this will be amazingly helpful.
I wish I could say that this will be the last update before I release, but I remember thinking like this so many times that I do not trust myself on that anymore ;) I will probably just get tired in a day or two, finalize the stuff and release it to get it off my head. I don't like the idea of STILL having it under works.
Yea then you'll have to release a "gold edition" containing all the add-ins that you think about a week after you release it. :P
BroodKiller
09-12-2007, 3:30 AM
Hahahaha....lol, yeah. And then "DatEdit Platinum" for Christmas...:P
BroodKiller
09-19-2007, 3:00 AM
Probably the best option would be to give the user the ability to select what happens. A small list like:
-Ignore Both (causes dupe data from each dat file to be disregarded and leaves the default data in place)
-1st File (Causes the 1st dat file to override the second if there's dupe data)
-2nd File (Obviously same as the one above but reversed)
and though I'm not sure it'd be easy:
-Always Ask: (If Datedit comes across dupe data it will display a popup asking the user to select which data to use (1st file, 2nd file, or neither)
/wishful thinking
Hmm...I have the feature pretty much done, but I have one last concern: I implemented the above options for a situation where the data is NOT duplicated, which is the whole point I think. What a use will there be of overriding duplicated data? Or maybe I am missing something here....?
Still, my current implementation makes sense only in 50% of it because the 'Use data from File1' and 'Use data from File2' options are basically creating copies of the chosen files. I guess something is wrong conceptually here....:/ Someone (U-238?) fancies elaborating a bit?
EDIT:Ah, and the "Always Ask" option has been a piece of cake :)
U-238
09-19-2007, 10:34 AM
Still, my current implementation makes sense only in 50% of it because the 'Use data from File1' and 'Use data from File2' options are basically creating copies of the chosen files. I guess something is wrong conceptually here....:/ Someone (U-238?) fancies elaborating a bit?
Ok, it makes 50% sense because you're 50% there. :P
If the user selects the "1st File" option then datedit will scan both files ("a" and "b") for modified data. The modded data it finds it will stick into a third dat file ("c"). But lets say, in this example, the hitpoint count on the marine is modified in both dat files, but they're at different amounts (eg file "a" has 60 HP for the marine and file "b" has 140) Dat edit will disregard the hitpoint data for the marine in file "b" and use the file "a" data instead. (so the final dat "c" will have the marine with 60 HP)
Same goes for the "2nd file" option only in reverse (file "b" gets the catering instead of "a" so your marine in file "c" has 140 HP)
Ignore Both - I'll use the same example above for this situation. User has two files ("a" and "b") that he wants to merge into file "c". He/she selects the "Ignore Both" option and the merging commences. However both files have modified data for the marine's hitpoint count. ("a" has 60 HP and "b" has 140) the "Ignore Both" option will cause this "dupe data" to be ignored completely and in file "c" the hitpoints will be default (40). (However all other data will be merged. For instance "a" has a zealot with 300 shield points and the zealot in file "b" has the default 60. So, in file "c" the data will show that the zealot has 300 HP since the shield points in the "b" file was not modified)
Always Ask - (I know you said you have this one down but I'm hitting it just to be sure) This would be the most advanced option. User has file "a" and "b" he wants to merge. He/she selects the "Always Ask" option and the merging commences. However, once again, the hitpoints for the marine are modified in both files. File "a" has the marine with 60 HP and file "b" has 140 HP. When datedit comes across this it will display a little popup box asking which file the user wants to use modified data from for this value. The user selects file "a" and hits continue. Datedit continues with the merging. But, again it comes across more dupe data. This time the zealot has two different modified shield point values. Zealot "a" has 20 shield and zealot "b" has 600. Again a pop up box will appear asking which file data to use. This time the user selects file "b". And once again we come across more dupe data. This time the Ultralisks hitpoints are in question. Two different data values reside in the files and datedit asks which file to use. User picks file "b" and we continue on and so forth.
I hope that was clear enough for you? (Complicated I know)
BroodKiller
09-19-2007, 10:47 AM
If the user selects the "1st File" option then datedit will scan both files ("a" and "b") for modified data. The modded data it finds it will stick into a third dat file ("c"). But lets say, in this example, the hitpoint count on the marine is modified in both dat files, but they're at different amounts (eg file "a" has 60 HP for the marine and file "b" has 140) Dat edit will disregard the hitpoint data for the marine in file "b" and use the file "a" data instead. (so the final dat "c" will have the marine with 60 HP)
Same goes for the "2nd file" option only in reverse (file "b" gets the catering instead of "a" so your marine in file "c" has 140 HP)
Ok...hmm....so basically the merging would take data from file1(or file2, in the 2nd case) only if both files have modified data? If I had the first option (1st file) selected and file1 would have the default data but file2 would have modded data, then it would take file2's data, righto?
I'm sorry I am asking this, probably stupid, questions, but I am a bit confused since I thought of about 3 ways of working this thing out and now I have it all mixed up in my mind, which means I can't realy make head or tail out of it. It may seem clear enough for you, but if you're working on it and tried different approaches, it may not be as clear :)
ooooh so close...
Both files have modified data. But if both files have the same value modified (like the marines HP) then it'd take file "a"s data (or file "b"s in the second case)
so if you have the following files
File A changes: Marine 60 HP, Zealot 200 Shield, Ultralisk 3200 HP
File B changes: Marine 200 HP, ghost 11 sight, reaver 50 HP
and I chose the "1st File" option.
then file C would look like this: Marine 60 HP, ghost 11 sight, zealot 200 shield, Ultralisk 3200 HP, reaver 50 HP
blackstar2168
09-19-2007, 11:39 PM
I think that you could compare a-modified data and b-modifed data to default data.
Then for each file:
a mod. and b orig.=a
a orig. and b mod.=b
a orig. and b orig.=a (or b or c whatever is easier)
a mod. and b mod.=ask weather a or b
That would be my way of doing it
U-238
09-20-2007, 12:09 AM
exactly. a much better clarification. Thank you blackstar.
BroodKiller
09-20-2007, 3:00 AM
Good, that's how I implemented it.
Btw, I finished coding, and if the testing rounds will look ok, I will make (finally)a release.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.