ebmar

[Query] Patching "First Name" using TSLPatcher

15 posts in this topic

Greetings, fellow Jedi! May the Force be with you all. :cheers:

I currently in practicing some features inside TSLPatcher; particularly patching the "First Name" and avoiding "replace" option for all kind of installation.

I have compared the UTC and building modifiers from them, and there is a field called "FirstName(strref)" set automatically to -1. When I go with that option, the patched UTC had its name erased alias blank space. When I use 0, it create a "Bad StrRef" reference in the name field. When I use 1 there is an ERROR message in the field.

What I'm asking is:

  • How to properly patch the "First Name" field using the patcher?

Many thanks for considering this.

Share this post


Link to post
Share on other sites

The StrRef field is a dialog.tlk reference. If it is set to -1 then you can enter a custom name. If it is set to anything else then that is the entry ID in dialog.tlk (used to allow dynamic updating for other languages).

Share this post


Link to post
Share on other sites
30 minutes ago, DarthParametric said:

If it is set to -1 then you can enter a custom name.

Although it is set to -1 and the "FirstName(lang0)" field is inserted with a custom name [which is automatically assigned by the patcher], the installed UTC only have its "First Name" field as blank space. I checked it using the KotOR Tool by opening the said UTC from the targeted module. Perhaps I'm missing something?

Edit:

Quote

The StrRef field is a dialog.tlk reference.

Ah- I get it, I have to get the dialog.tlk patched with a new reference pointing the intended custom name; more likely. 🤔

Edited by ebmar

Share this post


Link to post
Share on other sites

If you want to add it manually to changes.ini, then you need something like

[mycreature.utc]
FirstName(lang0)=Testy McTesterton

However, I would suggest that a better approach is to make use of ChangeEdit's differencing ability to make your life easy. Save a copy of the original UTC and a copy of your edited UTC. Then allow ChangeEdit to compare them and determine the changes:

TSLPatcher_GFF_Differencing.png.0e51ca9090c7bffd00d880183c7fb687.png

Don't forget to set the appropriate destination if it needs to be injected into a MOD.

  • Thanks 1

Share this post


Link to post
Share on other sites

Welp, I believe I have done pretty much anything needs to be done; as seen in the screencap here:

FN_Patch.thumb.JPG.d142239d205e0d24a523c97e09594a9a.JPG

But still, the patched UTC have its "First Name" field blanked-out. I have done either manually arranging the change.ini or let the patcher generate them automatically.

Edit: Wait, I'm redoing the attempt with "FirstName(strref)=-1" now.

Edit2: Nope. Still blanked-out. Pretty sure something needs to be done with the TLK then [I was hoping to dodge a bullet without doing ones].

Edited by ebmar

Share this post


Link to post
Share on other sites

Setting that, like so:

[mycreature.utc]
FirstName(strref)=-1
FirstName(lang0)=Custom Name

should be enough, in theory.  What does the TSLPatcher log say? Try using the latest exe from K1CP as that has a more verbose output.

As an aside, I am curious as to why you are injecting into a RIM. You should pretty much never do that, aside from those couple of cases where MODs don't work. Is the Endar Spire one of those?

Share this post


Link to post
Share on other sites
42 minutes ago, DarthParametric said:

Setting that, like so:


[mycreature.utc]
FirstName(strref)=-1
FirstName(lang0)=Custom Name

should be enough, in theory.

Yeah, that's what I thought too. 🤔

Quote

What does the TSLPatcher log say? Try using the latest exe from K1CP as that has a more verbose output.

On this attempt I am using the exe which came from K1CP indeed, and there weren't any sign of failure with the patching process. Here's a screencap of the log:

Installlog_Capture.JPG.85453aaa147c9fba0df210f3eb5a9879.JPG

Attached in line are the changes.ini and installlog.rtf of the said attempt; for troubleshooting purpose- if you don't mind: changes_installlog_TS.7z

Quote

As an aside, I am curious as to why you are injecting into a RIM....Is the Endar Spire one of those?

I injected it into a RIM because I can't seem to find the module for the Endar Spire, in particular; assuming that a RIM pretty much works the same as MOD, hence the injection then. 😁

Quote

You should pretty much never do that, aside from those couple of cases where MODs don't work.

If you don't mind explaining; what's the worst case scenario that potentially came with it?

Share this post


Link to post
Share on other sites

MODs are not vanilla files. You have to create them yourself. You extract all the files from the vanilla xxx.rim and xxx_s.rim for a given module, then use the ERF/RIM Editor to pack them as a MOD.

Once you alter a RIM, you no longer have a vanilla copy of the module. That can taint any future mod work. And if you lose the backup or subsequently install additional files over the top of it,  you'll likely need to reinstall to revert to a vanilla state.

Edit: You can also try setting LogLevel=4 in changes.ini, which enables debug logging. That might provide more useful info.

  • Thanks 1

Share this post


Link to post
Share on other sites
53 minutes ago, DarthParametric said:

MODs are not vanilla files. You have to create them yourself. You extract all the files from the vanilla xxx.rim and xxx_s.rim for a given module, then use the ERF/RIM Editor to pack them as a MOD.

Once you alter a RIM, you no longer have a vanilla copy of the module. That can taint any future mod work. And if you lose the backup or subsequently install additional files over the top of it,  you'll likely need to reinstall to revert to a vanilla state.

Thank you for the details! I haven't actually practiced with packing the MOD- but I will!

Quote

You can also try setting LogLevel=4 in changes.ini, which enables debug logging. That might provide more useful info.

Nice! Haven't thought that there was this detailed feature on the patcher. Anyway, here is attached; the log with debug logging enabled: installlog_debug.7z

and a screenshot for convenience's sake:

Spoiler

Installlog_Debug_Cap.thumb.JPG.9b864801bea1c61c0bdd7c0b94786180.JPG

 

Share this post


Link to post
Share on other sites

You could try this. Not sure if it will work:
 

Spoiler

 


; =====================================================[v1.0.5b1]====
; TSLPATCHER - GENERATED MODIFICATIONS FILE (12/2/2018)
; ===================================================================
; This file is automatically generated and as such has no formatting
; to speak of. You can insert blank lines between sections (but NOT
; between keys within a section!) and add comment lines starting
; with semicolon to make it more readable without breaking anything.
; -------------------------------------------------------------------

[Settings]
FileExists=1
WindowCaption=[K1] Sith Ass' on Endar Spire [TSLPort] v1.0.0
ConfirmMessage=N/A
LogLevel=3
InstallerMode=1
BackupFiles=1
PlaintextLog=0
LookupGameFolder=0
LookupGameNumber=2
SaveProcessedScripts=0


[TLKList]


[InstallList]
install_folder0=Override


[2DAList]
Table0=heads.2da
Table1=appearance.2da


[GFFList]
File0=n_sithsoldier003.utc


[CompileList]


[SSFList]


; ===================================================================

[heads.2da]
AddRow0=heads_row_107_0
[heads_row_107_0]
head=TSL_darkjh01
2DAMEMORY1=RowIndex
[appearance.2da]
AddRow0=appearance_row_tsl_es_sith_ass_mal_01_0
[appearance_row_tsl_es_sith_ass_mal_01_0]
label=TSL_ES_Sith_Ass_Mal_01
walkdist=1.813
rundist=3.96
driveanimwalk=1.813
driveanimrun=3.96
modeltype=B
normalhead=2DAMEMORY1
modela=TSL_darkjmidm
texa=TSL_DarkJMidM
envmap=DEFAULT
bloodcolr=S
wing_tail_scale=1
moverate=NORM
driveaccl=50
drivemaxspeed=5.4
hitradius=0.25
perspace=0.35
creperspace=0.4
height=1
targetheight=l
abortonparry=0
racialtype=20
haslegs=1
hasarms=1
footstepvolume=1
sizecategory=3
perceptiondist=9
footsteptype=1
soundapptype=0
headtrack=0
head_arc_h=30
head_arc_v=15
hitdist=1
prefatckdist=1.4
groundtilt=0
body_bag=2
2DAMEMORY2=RowIndex
[n_sithsoldier003.utc]
!Destination=modules\end_m01aa_s.rim
!ReplaceFile=0
FirstName(strref)=-1
SoundSetFile=41
FeatList\3\Feat=39
FeatList\4\Feat=40
FeatList\5\Feat=41
FeatList\6\Feat=42
FeatList\7\Feat=43
AddField0=SithAssName
AddField1=gff_n_sithsoldier003_FeatList_10_1
AddField2=gff_n_sithsoldier003_FeatList_11_1
ClassList\0\Class=3
Equip_ItemList\0\EquippedRes=g_w_shortsbr02
AddField2=gff_n_sithsoldier003_Dropable_1
Comment=Room 7 Sith Assassin
Appearance_Type=2DAMEMORY2
[SithAssName]
FieldType=ExoLocString
Path=FirstName
Label=
lang0=Sith Assassin
[gff_n_sithsoldier003_FeatList_10_1]
FieldType=Struct
Path=FeatList
Label=
TypeId=1
AddField0=gff_n_sithsoldier003_Feat_2
[gff_n_sithsoldier003_Feat_2]
FieldType=Word
Label=Feat
Value=55
[gff_n_sithsoldier003_FeatList_11_1]
FieldType=Struct
Path=FeatList
Label=
TypeId=1
AddField0=gff_n_sithsoldier003_Feat_3
[gff_n_sithsoldier003_Feat_3]
FieldType=Word
Label=Feat
Value=93
[gff_n_sithsoldier003_Dropable_1]
FieldType=Byte
Path=Equip_ItemList\0
Label=Dropable
Value=0
[install_folder0]
Replace0=TSL_darkjh01.mdl
Replace1=TSL_darkjh01.mdx
Replace2=TSL_DarkJH01.tpc
Replace3=TSL_darkjmidm.mdl
Replace4=TSL_darkjmidm.mdx
Replace5=TSL_DarkJMidM01.tpc

 

 

 

 

Share this post


Link to post
Share on other sites
23 minutes ago, DarthParametric said:

You could try this. Not sure if it will work:

  Reveal hidden contents

 



; =====================================================[v1.0.5b1]====
; TSLPATCHER - GENERATED MODIFICATIONS FILE (12/2/2018)
; ===================================================================
; This file is automatically generated and as such has no formatting
; to speak of. You can insert blank lines between sections (but NOT
; between keys within a section!) and add comment lines starting
; with semicolon to make it more readable without breaking anything.
; -------------------------------------------------------------------

[Settings]
FileExists=1
WindowCaption=[K1] Sith Ass' on Endar Spire [TSLPort] v1.0.0
ConfirmMessage=N/A
LogLevel=3
InstallerMode=1
BackupFiles=1
PlaintextLog=0
LookupGameFolder=0
LookupGameNumber=2
SaveProcessedScripts=0


[TLKList]


[InstallList]
install_folder0=Override


[2DAList]
Table0=heads.2da
Table1=appearance.2da


[GFFList]
File0=n_sithsoldier003.utc


[CompileList]


[SSFList]


; ===================================================================

[heads.2da]
AddRow0=heads_row_107_0
[heads_row_107_0]
head=TSL_darkjh01
2DAMEMORY1=RowIndex
[appearance.2da]
AddRow0=appearance_row_tsl_es_sith_ass_mal_01_0
[appearance_row_tsl_es_sith_ass_mal_01_0]
label=TSL_ES_Sith_Ass_Mal_01
walkdist=1.813
rundist=3.96
driveanimwalk=1.813
driveanimrun=3.96
modeltype=B
normalhead=2DAMEMORY1
modela=TSL_darkjmidm
texa=TSL_DarkJMidM
envmap=DEFAULT
bloodcolr=S
wing_tail_scale=1
moverate=NORM
driveaccl=50
drivemaxspeed=5.4
hitradius=0.25
perspace=0.35
creperspace=0.4
height=1
targetheight=l
abortonparry=0
racialtype=20
haslegs=1
hasarms=1
footstepvolume=1
sizecategory=3
perceptiondist=9
footsteptype=1
soundapptype=0
headtrack=0
head_arc_h=30
head_arc_v=15
hitdist=1
prefatckdist=1.4
groundtilt=0
body_bag=2
2DAMEMORY2=RowIndex
[n_sithsoldier003.utc]
!Destination=modules\end_m01aa_s.rim
!ReplaceFile=0
FirstName(strref)=-1
SoundSetFile=41
FeatList\3\Feat=39
FeatList\4\Feat=40
FeatList\5\Feat=41
FeatList\6\Feat=42
FeatList\7\Feat=43
AddField0=SithAssName
AddField1=gff_n_sithsoldier003_FeatList_10_1
AddField2=gff_n_sithsoldier003_FeatList_11_1
ClassList\0\Class=3
Equip_ItemList\0\EquippedRes=g_w_shortsbr02
AddField2=gff_n_sithsoldier003_Dropable_1
Comment=Room 7 Sith Assassin
Appearance_Type=2DAMEMORY2
[SithAssName]
FieldType=ExoLocString
Path=FirstName
Label=
lang0=Sith Assassin
[gff_n_sithsoldier003_FeatList_10_1]
FieldType=Struct
Path=FeatList
Label=
TypeId=1
AddField0=gff_n_sithsoldier003_Feat_2
[gff_n_sithsoldier003_Feat_2]
FieldType=Word
Label=Feat
Value=55
[gff_n_sithsoldier003_FeatList_11_1]
FieldType=Struct
Path=FeatList
Label=
TypeId=1
AddField0=gff_n_sithsoldier003_Feat_3
[gff_n_sithsoldier003_Feat_3]
FieldType=Word
Label=Feat
Value=93
[gff_n_sithsoldier003_Dropable_1]
FieldType=Byte
Path=Equip_ItemList\0
Label=Dropable
Value=0
[install_folder0]
Replace0=TSL_darkjh01.mdl
Replace1=TSL_darkjh01.mdx
Replace2=TSL_DarkJH01.tpc
Replace3=TSL_darkjmidm.mdl
Replace4=TSL_darkjmidm.mdx
Replace5=TSL_DarkJMidM01.tpc

 

 

 

 

Nope. Not working either. Here's a warning that were encountered in the process:

FN_Patch_Warning.JPG.f1054135c7a55947cfa406fc132769f8.JPG

Observed by the log it seems to be necessary to add a reference to the [dialog?] TLK. Ain't sure about that too, but most likely. 🤔

I'll try to fiddle with the TLK and see if something can came out of it.

Share this post


Link to post
Share on other sites
14 hours ago, DarthParametric said:

You'd be better off just replacing the UTC outright.

Hahah, yeah- that's what I did locally. Although that method seems to be not so preferable for a release version. 🤔

Anyways; finally, I get to patch the "FirstName" field properly, by creating a new 'append.tlk' which inside it is a new entry to be pointed as reference for the StrRef.

The "FirstName(strref)" value will be StrRef0 then, to link with the append.tlk's tokens.

Here's the attached log and the working INI to take a look at: installlog_changes_Working_Patch.7z

and a screenshot of the log which quite explain the patching process:

Spoiler

Working_INI_installlog.thumb.JPG.aa3f2a7769ab85f193069d00be261a7a.JPG

Nice to know that append.tlk work in similar fashion to 2DAMEMORY.

Quote

The StrRef field is a dialog.tlk reference.

And many thanks for this information in particular; it helps me a lot with guessing which part should is necessary to be inspected. :cheers:

Share this post


Link to post
Share on other sites
2 minutes ago, ebmar said:

Although that method seems to be not so preferable for a release version.

I would recommend overwriting a UTC every time over touching the TLK.

  • Like 1

Share this post


Link to post
Share on other sites
Just now, DarthParametric said:

I would recommend overwriting a UTC every time over touching the TLK.

Make sense for custom-based mods; which the author wants the mod to works 100% as it was designed for. 🤔

Thanks for the heads-up! :cheers:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now