lfnetwork.com mark read register faq members calendar

Thread: TSLPatcher v1.2.10b1 (mod installer)
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 08-23-2005, 05:12 AM   #81
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
the last line in my 2da fils is 262... and when i run the patcher it adds the new line, but it adds it as 262, so now i have 2 262's in my 2da file...


edit: i added rowlabel high() to the head of the list and now it adds the line, but in place of the number (263) it has high() instead... weird...



Last edited by TheOssusKeeper; 08-23-2005 at 05:22 AM.
TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 05:23 AM   #82
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
What you might want to do is in ChangeEdit delete your original add new row part and recreate a brand new addrow call. Being you had that erronious ExclusiveColumn call in there it might have messed something up...


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 08-23-2005, 05:25 AM   #83
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
ok, i'll try that and see what happens, but should i go ahead and add the rowlabel high() as well?


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 05:28 AM   #84
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
Quote:
Originally Posted by TheOssusKeeper
but should i go ahead and add the rowlabel high() as well?
No! I never had to mention the row numbers in the mod I made and it edited itemcreate.2da and itemcreatemira.2da just fine.


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 08-23-2005, 05:32 AM   #85
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
it's still not working, i totally redid the change.ini file and left out the rowlabel option and like before it add the new line except the rowlabel was the same as the one before it, so now i have 2 rows with the number 262...


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 05:36 AM   #86
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
from what i understood of the readme file about the exclusivecolumn option is it supposed to work with add new line and copy line, and you were supposed to be able to use the high() option to seek out the last line in the 2da file and add 1 to that for the new line... maybe i miss read it...


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 05:40 AM   #87
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
Question: Do you have a stock upcrystals.2da in your tslpatchdata folder?

If you don't... then put one in there and try the install again.

Also, when you went to edit the colums in ChangeEdit, did you manually type in the rowlabels to edit or did you load the labels from upcrystals.2da?


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 08-23-2005, 05:43 AM   #88
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
yes, a clean one extracted strat from the kotor tool...

loaded from the 2da, from the 2da in the tslpatchdata folder...


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 05:45 AM   #89
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
question: what is the max number of rows allowed in the upcrystals.2da file?

i've got 262, trying to add 263, maybe it's maxed out at 262?


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 05:46 AM   #90
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
Even more simply, check to see if your upcrystals.2da's row numbers are ordered correctly. (Look for a skipped row number somewhere below 262, if this is so then you could get 2 of the same row numbers by using the installer, then the error is with your override's 2da file.)


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 08-23-2005, 05:49 AM   #91
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
nope, no skipped no.'s...


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 05:54 AM   #92
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
What number did you assign to your 2da line editing task?

You know when it asks for a number did you assign a high one like 999 or one under 262?


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 08-23-2005, 05:57 AM   #93
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
it didn't ask...


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 06:08 AM   #94
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
Quote:
Originally Posted by TheOssusKeeper
it didn't ask...
Yes it does, it is the Add Modifier Label box... scratch this thought! I think I found something! Bear with me!

This is the USM's upcrystals.2da right? Even the stock upcrystals.2da does this...

262 would be the proper row label addition for upcrystals.2da, in the eyes of the installer, as upcrystals.2da has no row 0, and most all of the other 2da files do... since the row 0 is missing the editor thinks there is one less row that there is supposed to be... hence it uses row 262.

You could test this by adding a false row 263 into your override's upcrystals.2da file and running the installer once again you should end up with 2 row 263's if this is so then I am correct.

Thankfully upcrystals.2da does not have it's row numbers refrenced by anything so 2 row 262's should not harm much of anything... our games should run fine with 2 of the same row numbers. If not then we could always bribe stoffe to fix the lack of an upcrystals.2da row 0 in the installer?

If this is so, this would be neither your fault, or the installers fault, but the games fault, because Bioware and OE did not follow their own 2da file formats and put a row 0 in upcrystals.2da! LOL!

EDIT: I hope I'm right, but I have to log off for tonight good luck TheOssusKeeper!


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------

Last edited by RedHawke; 08-23-2005 at 06:26 AM.
RedHawke is offline   you may: quote & reply,
Old 08-23-2005, 06:15 AM   #95
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
okey dokey, i'll give 'er a whirl... hehehe


TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 06:54 AM   #96
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
i added the rowlabel 0 at the beginning of the file and it worked like a charm...
also now i have a problem with the install files not wanting to copy into the override folder... i've got the install files set, but the patcher will not place them in the override folder, so how do i fix that?

PS. sorry it took so long to get back to you, it's raining here and i get water in my phone lines and i get kicked offline and it takes forever to log back on...


edit: is there a way to add the dumby rowlabel 0 at the beginning of the file via the patcher, so that it will number the new row properly?



Last edited by TheOssusKeeper; 08-23-2005 at 07:04 AM.
TheOssusKeeper is offline   you may: quote & reply,
Old 08-23-2005, 07:49 AM   #97
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by TheOssusKeeper
ok i am sure i am doing something wrong ... i need to add a line to the upcrystals.2da file... but i can't get it to work right... here is what i have so far for the .2da part...

Code:
ExclusiveColumn         high()
Label                   Light
template                g1_w_sbrcrstl22
shortmdlvar             g1_w_short03
longmdlvar              g1_w_lghtsbr03
doublemdlvar            g1_w_dblsbr003
2DAMEMORY1              RowLabel
ExclusiveColumn is not a column you can assign a value to. The high() token assigns the highest value of all numbers in a column in the 2DA file, but ExclusiveColumn is no column. It's a keyword to which you assign the column label of a column in the 2DA file. The value you then assign to this column in the modifier must be unique among all lines in the 2DA file. If it is not, the patcher will modify the existing line that already had a matching value, rather than add the new line.

To use your example, if you had set ExclusiveColumn=Label, it would mean that if any line in the 2DA file already had the value Light in its Label column, that line would be modified and no new line would be added.

This function is meant to eliminate adding duplicate lines if the patcher is run on a game which already has the mod installed. Such as when doing an update to an existing mod, where you want to add lines if the player don't have the old version of the mod installed, but update what's already there (bugfixes etc) if they have the old version.


Quote:
Originally Posted by RedHawke
262 would be the proper row label addition for upcrystals.2da, in the eyes of the installer, as upcrystals.2da has no row 0, and most all of the other 2da files do... since the row 0 is missing the editor thinks there is one less row that there is supposed to be... hence it uses row 262.

If this is so, this would be neither your fault, or the installers fault, but the games fault, because Bioware and OE did not follow their own 2da file formats and put a row 0 in upcrystals.2da! LOL!
In all fairness I wouldn't blame Bioware or Obsidian, since, as far as I can see, the standard upcrystals.2da in 2da.bif does begin with a rowlabel of 0. I would guess that one of the USM people have used KotorTool's Renumber Row Labels function, which will replace all row labels and begin at 1 rather than 0, no matter what the file previously started at.


Quote:
Originally Posted by RedHawke
Thankfully upcrystals.2da does not have it's row numbers refrenced by anything so 2 row 262's should not harm much of anything... our games should run fine with 2 of the same row numbers. If not then we could always bribe stoffe to fix the lack of an upcrystals.2da row 0 in the installer?
If you don't assign a row label directly in a modifier, the patcher will make the row label the same as the line number of the new line. In files which start at rowlabel 0 (most of the standard files with numeric rowlabels as far as I know), this would be identical to the next row label in line.

I guess I didn't think of the fact that incremental row labels don't have to match the line number and didn't add support for the high(), since I incorrectly assumed that it would be the same as assigning no RowLabel. I'll have to fix that in the next version to make high() work for Row Labels too, and add a filter preventing it from adding a row with a Row Label that already exists in the 2DA.

Though in this case, as said, if the upcrystals.2da isn't indexed by the row label (which seems to be the case since the USM file works just fine despite its new row label numbering), it doesn't matter what the value in that column is, since the game won't use it.


mt

Last edited by stoffe -mkb-; 08-23-2005 at 09:15 AM.
stoffe is offline   you may: quote & reply,
Old 08-23-2005, 08:53 AM   #98
ChAiNz.2da
Leave Everything to Me!
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,848
Quote:
Originally Posted by stoffe -mkb-
In all fairness I wouldn't blame Bioware or Obsidian, since, as far as I can see, the standard upcrystals.2da in 2da.bif does begin with a rowlabel of 0. I would guess that one of the USM people have used KotorTool's Renumber Row Labels function, which will replace all row labels and begin at 1 rather than 0, no matter what the file previously started at.
Guilty

But I did notice this blunder right-offhand. Since it didn't affect anything during our test runs I left it in it's current state rather than re-number the whole .2da file again. I can however make a new 'true' index if everyone would feel more comfortable having the line 0 in it.

Just let me know


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 08-23-2005, 09:16 AM   #99
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
@TheOssusKeeper:
Try this version of the patcher. It should allow you to assign the high() token to the RowLabel when adding new lines, allowing you to get the highest row label regardless of the line numbers. Like:
Code:
RowLabel                high()
Label                   Light
template                g1_w_sbrcrstl22
shortmdlvar             g1_w_short03
longmdlvar              g1_w_lghtsbr03
doublemdlvar            g1_w_dblsbr003
@ChAiNz.2da:
I personally wouldn't bother with it. It works anyway and the Row Label isn't actually used for anything in upcrystals.2da, so it doesn't really matter.

There's nothing in the 2DA format in general that demands that a Row Label starts at 0. It doesn't even have to be a numeric value after all, like in plot.2da where they use tags as row label. Some files expect numeric row labels, some does not, and in some it's unused.


mt

Last edited by stoffe -mkb-; 08-23-2005 at 09:31 AM.
stoffe is offline   you may: quote & reply,
Old 08-25-2005, 01:49 AM   #100
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
Quote:
Originally Posted by ChAiNz.2da
Guilty
jk...


Actually, I do think it affects something though, after updating the upcrystals.2da... I add the crystal to the workbench, it didn't show up... so i think the workbench reads what’s in the upcrystals.2da because it didn't find the new crystal...

here's my meaning:
in the upcrystals.2da file:
row label 262
row label 262 (the patcher just dup'ed the previous rowlabel)

in the itemcreate.2da:
row label 416
( in this config. the itemcreate wouldn't recognize the new crystal at rowlabel 262 or the one at rowlabel 416, in their respective 2da files.)

same goes for this config. as well:
in the upcrystals.2da file:
row Label 262
rowlabel 0 (add for proper row label indexing)
row label 263

in the itemcreate.2da:
row label 416
(when this config didn't work either I went back and deleted the rowlabel 0 that was placed between the 262 and 263 rowlabels, then the crystal showed up and worked fine in the iteamcreate.2da...)

i got every thing working now 100%... thanx for all the help...

edit: I got to think’n that maybe it didn’t recognize the new crystal because there was a break in the rowlabel numbers, i.e. rowlabel 262, rowlabel 0 and rowlabel 263? But why didn’t it recognize the dup’ed rowlabel, unless it was because it was duplicated?


TheOssusKeeper is offline   you may: quote & reply,
Old 08-25-2005, 02:06 AM   #101
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
hey Stoffe, version 1.1.7 works like a dream, thanks... keep up the good work...


TheOssusKeeper is offline   you may: quote & reply,
Old 08-30-2005, 01:32 PM   #102
zulu9812
Rookie
 
zulu9812's Avatar
 
Join Date: Jul 2005
Posts: 26
When I use ChangeEdit.exe to compare to 2da files for differences, anf I get the following error:

"Invalid row index specified, unable to look up cell value"

This happens with every single 2da file (and yes, I'm comparing 2das of the same type. e.g. apearance.2da and appearance.2da). I'll confess to now really knowing what I'm doing with this program, though.


Up The Irons!
zulu9812 is offline   you may: quote & reply,
Old 08-30-2005, 01:52 PM   #103
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by zulu9812
When I use ChangeEdit.exe to compare to 2da files for differences, anf I get the following error:

"Invalid row index specified, unable to look up cell value"

This happens with every single 2da file (and yes, I'm comparing 2das of the same type. e.g. apearance.2da and appearance.2da). I'll confess to now really knowing what I'm doing with this program, though.
Are you loading the unmodified 2DA file first, and the modified one second, when you compare? I think that error would occur if the first 2DA file has more lines or columns than the 2nd 2DA file in the current version.

Since the TSLPatcher is unable to delete lines from a file I didn't put too much thought into it this case before. I'll change it so it will just skip the extra lines and compare the rest, rather than display cryptic messages, in the next version.


mt

Last edited by stoffe -mkb-; 08-30-2005 at 02:23 PM.
stoffe is offline   you may: quote & reply,
Old 08-30-2005, 02:46 PM   #104
zulu9812
Rookie
 
zulu9812's Avatar
 
Join Date: Jul 2005
Posts: 26
I was actually comparing two modified files, but thanks - that makes a lot more sense now


Up The Irons!
zulu9812 is offline   you may: quote & reply,
Old 08-30-2005, 05:01 PM   #105
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by zulu9812
When I use ChangeEdit.exe to compare to 2da files for differences, anf I get the following error:

"Invalid row index specified, unable to look up cell value"
I think I have fixed that behavior in this new version now. If it encounters rows or columns in the first 2DA file that aren't present in the second 2DA file, it will just pop up a warning about the extra rows/columns but continue comparing the lines/columns present in both files.

However, for addrow and addcolumn modifiers to be created, the 2DA file containing the new rows/cols must be the second one loaded.

I also did some cleaning up and optimizing of the compare function, and made it use the label column text (for 2DAs that have that column) in the created modifier labels instead of line number to make it a bit clearer which lines have been found when viewing the list.


mt
stoffe is offline   you may: quote & reply,
Old 09-30-2005, 10:18 PM   #106
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
Hey Stoffe, can I give an idea for the next version of the ChangeEdit.exe?
I was thinking if it is possible, to select multi files (mass select) and input them into the 'install files' windows with them using the preset destination folder and settings? instead of having to select one file at a time... just a thought if it could be done, that would be awesome and a time saver as well...


TheOssusKeeper is offline   you may: quote & reply,
Old 10-01-2005, 03:14 PM   #107
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by TheOssusKeeper
I was thinking if it is possible to select multiple files (mass select) and input them into the 'install files' windows with them using the preset destination folder and settings? Instead of having to select one file at a time...
That hopefully shouldn't be too hard to implement. I'll add it to the ToDo list and have a look at it next time I feel like working on ChangeEdit. Thanks for the suggestion.


mt
stoffe is offline   you may: quote & reply,
Old 10-04-2005, 05:11 PM   #108
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by TheOssusKeeper
Hey Stoffe, can I give an idea for the next version of the ChangeEdit.exe?
I was thinking if it is possible, to select multi files (mass select) and input them into the 'install files' windows with them using the preset destination folder and settings? instead of having to select one file at a time...
Since I had some free time this evening I added an extra button next to the arrow buttons which you can use to mass-add files to the install list. It will pop up a box asking you for the destination folder name and the Replace/copy setting for the file, and then open a standard Open dialog box for you to select the files to add. Use CTRL/SHIFT when clicking to select multiple files.

I also took the opportunity to add the two new settings fields that were added in TSLPatcher 1.1.7 to the Settings screen in ChangeEdit to make them a little more accessible.

The first (required file) can contain the name of a file that must be present in the user's override folder in order for the installation to proceed. The second (error message) can contain a message that will be displayed to the user if that specified file is missing and installation aborts. Just leave both boxes blank to not use this feature.

That feature is mostly intended when making updates to existing mods to ensure the user has the mod that will be updated installed.

You can get this tiny update to ChangeEdit.exe here. As far as I have seen from some quick testing things seem to work.


mt
stoffe is offline   you may: quote & reply,
Old 10-04-2005, 09:45 PM   #109
TheOssusKeeper
Forumite
 
TheOssusKeeper's Avatar
 
Join Date: Jul 2005
Location: Missouri, USA
Posts: 534
Quote:
Originally Posted by stoffe -mkb-
Since I had some free time this evening I added an extra button next to the arrow buttons which you can use to mass-add files to the install list. It will pop up a box asking you for the destination folder name and the Replace/copy setting for the file, and then open a standard Open dialog box for you to select the files to add. Use CTRL/SHIFT when clicking to select multiple files.

You can get this tiny update to ChangeEdit.exe here. As far as I have seen from some quick testing things seem to work.
Wow Stoffe, thank you very much… you're an absolute
This will help immensely, and save a whole lot of time…
Three cheers for Stoffe…


Edit: I just tried it out, it seems to work perfectly... as always



Last edited by TheOssusKeeper; 10-04-2005 at 10:39 PM.
TheOssusKeeper is offline   you may: quote & reply,
Old 11-28-2005, 07:58 PM   #110
ermo
Rookie
 
Join Date: May 2005
Location: Definitely not in Kansas anymore...
Posts: 10
Question Hacking script files?

Quote:
Originally Posted by stoffe -mkb-
* Added a primitive way for the Patcher to modify things like NCS scripts with correct 2DA index values and StrRefs. It is currently VERY primitive, and WILL mess up your files if you don't know what you are doing when you configure it. As such it is not added to the ChangeEdit application, and I won't describe how it works here. If you really need to use it, ask me and I'll describe how it works.
All right, I'll bite

Code:
515=2DAMEMORY1
Is the key '515' some sort of index that counts the number of bytes nb since the beginning of the compiled script file? It would make sense, I suppose.

But really, it'd be rather nice if there was some way of instructing TSLPatcher to replace real text in .nss files. Although it would probably be a 'corner case' as it were.

On a side note: I have to agree with your comment on Bioware/OE being allergical to their own constants in the scripts. It's just plain poor programming practice.


Can't respond to an assertion that's semantically nil, sorry.
ermo is offline   you may: quote & reply,
Old 11-29-2005, 08:36 AM   #111
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by ermo
All right, I'll bite
515=2DAMEMORY1
Is the key '515' some sort of index that counts the number of bytes nb since the beginning of the compiled script file? It would make sense, I suppose.
The number is a byte offset into the file (in decimal, not hexadecimal) where it will overwrite the following 4 bytes with the value you are assigning to it. The value must be an integer (32 bit signed interval in the case of NCS files).

If you put ReplaceFile=1 at the top of the hackfile section the patcher will overwrite any existing copies of the file in Override with the copy from the tslpatchdata folder before it modifies the file. If this line is left out the patcher will skip the file if it's already present in override (since it has no way of knowing if the byte offset would still be valid in a custom-modified file). For example:
Code:
[myscript.ncs]
ReplaceFile=1
4752=StrRef0
... would write the resulting StrRef stored in the StrRef0 token of an entry added to dialog.tlk at byte offset 4752 in myscript.ncs, overwriting any myscript.ncs found in the override folder.

This will work for any file and not just NCS files, though I made it primarily with hacking NCS script with proper StrRef and 2DA indexes in mind.

Note that if the target file has a NCS extension it will write the assigned value as big-endian, since this is the way NWScript-integers are stored in NCS files. All other file types will have the value written little-endian. This is important to remember if you use a hex editor to search for a dummy value in an NCS file to get the offset for the value. (I.e. to find the location of the value 999 in a compiled script you'd search for 0x000003E7.)

Quote:
Originally Posted by ermo
But really, it'd be rather nice if there was some way of instructing TSLPatcher to replace real text in .nss files. Although it would probably be a 'corner case' as it were.
Yes, I agree that the current solution is an ugly hack, hence the name "HACKList".

But I doubt my programming skills are sufficient to implement my own NSS->NCS compiler in the TSLPatcher, so I haven't looked into a more elegant solution much. It was the best solution I could think of at the time for this problem. Juggling with byte offsets is hardly user friendly, but it worked for what I needed it for at the time.


mt

Last edited by stoffe -mkb-; 11-29-2005 at 08:52 AM.
stoffe is offline   you may: quote & reply,
Old 11-29-2005, 06:59 PM   #112
ermo
Rookie
 
Join Date: May 2005
Location: Definitely not in Kansas anymore...
Posts: 10
Thumbs up

Quote:
Originally Posted by stoffe -mkb-
The number is a byte offset into the file (in decimal, not hexadecimal) where it will overwrite the following 4 bytes with the value you are assigning to it. The value must be an integer (32 bit signed interval in the case of NCS files).
Hehe, I suspected as much (and thanks for the instructions)

Quote:
(...)
Note that if the target file has a NCS extension it will write the assigned value as big-endian, since this is the way NWScript-integers are stored in NCS files. All other file types will have the value written little-endian. This is important to remember if you use a hex editor to search for a dummy value in an NCS file to get the offset for the value. (I.e. to find the location of the value 999 in a compiled script you'd search for 0x000003E7.)
... as opposed to little-endian E7 03 00 00. Ok.

Quote:
Yes, I agree that the current solution is an ugly hack, hence the name "HACKList".
But I doubt my programming skills are sufficient to implement my own NSS->NCS compiler in the TSLPatcher, so I haven't looked into a more elegant solution much. It was the best solution I could think of at the time for this problem. Juggling with byte offsets is hardly user friendly, but it worked for what I needed it for at the time.
Well, who said anything about implementing a compiler? All I had in mind was that you could re-format .nss files with the help of some simple markup and call nwnnsscomp.exe --game 2 --compile <current nss file>

(script before TSLPatcher is run)

Code:
//my_mod.nss
// reformat with 2DAMEMORY# values from TSLPatcher

int SpellId1, SpellId2, SpellId3, SpellId4, SpellId5;

// this block is here for convenience. I'd like to avoid having to create
// these lines  one by one each time tslpatcher has replaced the tokens.
// SpellId1 = 2DAMEMORY1;
// SpellId2 = 2DAMEMORY2;
// SpellId3 = 2DAMEMORY3;
// SpellId4 = 2DAMEMORY4;
// SpellId5 = 2DAMEMORY5;

//<tslpatcher> SpellId1 = 2DAMEMORY1;
//<tslpatcher> SpellId2 = 2DAMEMORY2;
//<tslpatcher> SpellId3 = 2DAMEMORY3;
//<tslpatcher> SpellId4 = 2DAMEMORY4;
//<tslpatcher> SpellId5 = 2DAMEMORY5;

if (GetHasSpellEffect(SpellId1))
{
    // foo
}
(...)
(script after TSLPatcher is run)

Code:
//TSLPatcher reformatted my_mod.nss on 2005-11-29 at <current time>
//my_mod.nss
// reformat with 2DAMEMORY# values from TSLPatcher

int SpellId1, SpellIdd2, SpellId3, SpellId4, SpellId5;

// this block is here for convenience. I'd like to avoid having to create
// these lines  one by one each time tslpatcher has replaced the tokens.
// SpellId1 = 2DAMEMORY1;
// SpellId2 = 2DAMEMORY2;
// SpellId3 = 2DAMEMORY3;
// SpellId4 = 2DAMEMORY4;
// SpellId5 = 2DAMEMORY5;

SpellId1 = 301;//2DAMEMORY1
SpellId2 = 302;//2DAMEMORY2
SpellId3 = 303;//2DAMEMORY3
SpellId4 = 304;//2DAMEMORY4
SpellId5 = 305;//2DAMEMORY5

if (GetHasSpellEffect(SpellId1))
{
    // foo
}
(...)
I hope you get the idea. But since I'm the only one who's asked, it's probably not worth the effort.

Btw. don't be so hard on yourself. If your programming skils are 'insufficient' as you put it, you've certainly managed to hide it well. Give yourself some credit. From my point of view, it's well deserved.

Rock on!


Can't respond to an assertion that's semantically nil, sorry.

Last edited by ermo; 11-29-2005 at 07:04 PM. Reason: Code ooops, formatting
ermo is offline   you may: quote & reply,
Old 12-01-2005, 08:05 AM   #113
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by ermo
Well, who said anything about implementing a compiler? All I had in mind was that you could re-format .nss files with the help of some simple markup and call nwnnsscomp.exe --game 2 --compile <current nss file>
Well, I've tried to make the installer app fairly stand alone with little reliance on external things to decrease the risk of things going wrong (which admittedly has already failed miserably with the whole RTF thing), but I guess an external EXE is less likely to cause trouble than a DLL.

Still, it would require you to ship nwnnsscomp.exe with the mod. File size issues aside, I'm not exactly sure how legal it would be to distribute someone elses application like this with your own work.

A text substitution function that looks through NSS files for tokens and replace them with values, and calls to nwnnsscomp.exe if located within the tslpatchdata folder probably wouldn't be too hard to do, but it'll take some time to implement. I'll look into it, but since I am pretty busy with other things right now and have little time to spare for modding I'm afraid it will have to wait a few weeks until I have more free time.

Quote:
Originally Posted by ermo
If your programming skils are 'insufficient' as you put it, you've certainly managed to hide it well.
Heh, that's half the reason why I haven't posted the source code for my tools yet (it's not pretty).


mt

Last edited by stoffe -mkb-; 12-01-2005 at 03:28 PM.
stoffe is offline   you may: quote & reply,
Old 12-01-2005, 01:27 PM   #114
Darkkender
Knight of Holowan
 
Darkkender's Avatar
 
Join Date: Aug 2004
Location: In the mountains of Oregon
Posts: 2,953
Current Game: Star Wars The Old Republic
Veteran Modder 
Hey Stoffe, you could always distribute a batch file that calls nwnnsscomp that way somebody could adjust it for there own folders. As for distributing the source I think it would take a simple permission PM to Fred. The Original sourcecode by Torlack is made available at his site. I suppose if you wanted to do what I'm doing which is to download it and integrate the critical components into a program you could as long as you abide by Torlacks terms. Which are by the way pretty mild basic GNU type of terms.


Working so, we will learn history as a tree knows it; we will climb into shapes printed in the seed; we will become time made visible, years made fragrant; we will make of concentric memory a stem of praise; we will inhabit daylight at a trees own speed; we will be travelers who remain, patriots to this ground.
OMG I only rank 62.13018% geek or a Extreme Geek as it is referred to on the geektest at Geektest
[TSL]Holowan Plugin
Darkkender is offline   you may: quote & reply,
Old 12-17-2005, 06:24 AM   #115
timsong
Lurker
 
Join Date: Dec 2005
Posts: 1
Whenever I click the install mod button, I got a "RichEdit Line Insertion Error" message. Anyone know why?
timsong is offline   you may: quote & reply,
Old 12-17-2005, 07:50 AM   #116
Tupac Amaru
Junior Member
 
Tupac Amaru's Avatar
 
Join Date: Mar 2005
Location: Tahuantinsuyu
Posts: 273
Quote:
Originally Posted by timsong
Whenever I click the install mod button, I got a "RichEdit Line Insertion Error" message. Anyone know why?
This post should solve your problem :
http://www.lucasforums.com/showpost....5&postcount=65
Tupac Amaru is offline   you may: quote & reply,
Old 12-20-2005, 12:11 PM   #117
Herbatic
Lurker
 
Join Date: Dec 2005
Posts: 4
I've just started modding KotOR, and I was using KMM, which is fantastic, but as soon as I had my first mod conflict I thought a program like yours would be the ideal solution - I was very happy when I found you had already made it!

Quote:
Originally Posted by stoffe -mkb-
Could someone else confirm if TalkEd.exe is unable to load an unaltered KotOR1 dialog.tlk file, please?
I opened an original dialog.tlk and the one from All-in-one Force Powers 3.01, and it appears to work fine with both

So I guess this means it should be fully compatible with KotOR, despite the name?

This program is just amazing Stoffe, I know enough about programming to appreciate the effort and skill to make this program.

Makes me want to start modding...
Herbatic is offline   you may: quote & reply,
Old 12-22-2005, 10:02 AM   #118
Joris1
Rookie
 
Joris1's Avatar
 
Join Date: Aug 2005
Location: Braunschweig,Germany,Europe
Posts: 86
Hi, I have a question:

I saw in a mod by AVOl that he used your TSL Patcher. But in there was only a zip file and no folder names "tslpatchdata".

How can I make it that is it so??


"But the angel said to them: Do not be afraid. I bring you good news of great joy that will be for all the people. Today in the town of David a Savior has been born to you; he is Christ the Lord.", Lucas 2:10-11
Joris1 is offline   you may: quote & reply,
Old 12-22-2005, 10:18 AM   #119
ChAiNz.2da
Leave Everything to Me!
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,848
Quote:
Originally Posted by Joris1
Hi, I have a question:

I saw in a mod by AVOl that he used your TSL Patcher. But in there was only a zip file and no folder names "tslpatchdata".

How can I make it that is it so??
You'll need to extract the contents of the .zip file...

It should contain all the necessary files afterwards


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 12-22-2005, 10:32 AM   #120
Joris1
Rookie
 
Joris1's Avatar
 
Join Date: Aug 2005
Location: Braunschweig,Germany,Europe
Posts: 86
I already try that! It contains only the exe file


"But the angel said to them: Do not be afraid. I bring you good news of great joy that will be for all the people. Today in the town of David a Savior has been born to you; he is Christ the Lord.", Lucas 2:10-11
Joris1 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > T3-M4's Astromech Droid Center > TSLPatcher v1.2.10b1 (mod installer)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:45 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.