Jump to content

Home

TSLPatcher v1.2.10b1 (mod installer)


Recommended Posts

  • Replies 312
  • Created
  • Last Reply

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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...

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :ang3:

This will help immensely, and save a whole lot of time… :thumbsup:

Three cheers for Stoffe… :cheers::cheers::cheers:

 

 

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

Link to comment
Share on other sites

  • 1 month later...
* 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 ;)

 

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.

Link to comment
Share on other sites

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:

[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.)

 

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. :)

Link to comment
Share on other sites

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)

 

(...)

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.

 

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)

 

//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)

 

//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! :cool:

Link to comment
Share on other sites

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.

 

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). :D

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...

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!

 

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 :D

 

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...

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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".

It doesn't have a separate 'tslpatchdata' folder. Everything is packed into the .exe. Just run it, choose your game path and the mod should install just fine. That was how it worked for AVOL's Bastila mod I am using at least.

Link to comment
Share on other sites

Thank you! But I think I will use the old TSL Patcher. The mod should cames out tomorrow and I haven't the time to change all things. ;)

 

 

P.s. I have just a grammar question: Names it "the underwear from Bastilla" or "the underwear of Bastilla"???

Link to comment
Share on other sites

  • 3 weeks later...

I have a question concerning 2DAMEMORY# tokens. I'm working on force powers and I'd like to cumulate more than one value in the prerequisites column. Is it possible?

 

something like this:

prerequisites=2DAMEMORY2 [AND] 2DAMEMORY3

 

to get, per example, 282_283 in the spells.2da file

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...