Sign in to follow this  
lachjames

MOD:KotOR Save Importer for TSL

Recommended Posts

KotOR Save Importer for TSL


This is both a mod in itself, and a resource for modders to use. It allows data from KotOR 1 to be imported into TSL. It is extensible, so modders can very easily map variable values from KotOR 1 to KotOR 2 without any scripting required.

There are several reasons why it might be useful to allow TSL to load data from a KotOR 1 save. The obvious example of where this would be useful is at the start of TSL when talking to Atton for the first time (where the player's choices determine what the game believes happened in the first game). It would be better if the game were aware of this without asking the player directly. Ideally, this would be TSL itself reading a KotOR 1 save, but for several reasons this is not feasible.

Modders might also want to create new content which bridges between KotOR 1 and KotOR 2. For example, a mod which extends the KotOR/TSL storyline might benefit from knowing decisions that the player made in both games. Alongside the app (app.exe) is a folder called "requirements". This contains a yaml file "revan.yaml", which is an example of how you can dynamically tell the save importer which variables to import from KotOR 1, what variables to assign them to, and how to map the variables across.

You can optionally install the file "101atton.dlg", which will change the initial conversation with Atton to no longer ask the player for information about KotOR 1 (because the game already knows this information, since you imported the data directly from your KotOR 1 save). 

IMPORTANT NOTES
 - You need to have a KotOR save which is far enough into the game that the ending has been determined. A save during the final battle of the game should be sufficient for this. If you don't have such a save, the variable "G_FinalChoice" can be manually set it in the GUI interface to the appropriate value (0 for LS ending, 1 for DS ending).
 - You can set/change variables within the tool using the GUI.
 - The mod was tested with TSLRCM; I make no guarantees about whether it would work without it.

COMPATIBILITY
This mod is compatible with TSLRCM. This mod changes the script "k_kreia_spawn", and (optionally) the DLG 101atton.dlg, and therefore should be compatible with any mod that does not change either of these scripts (except for TSLRCM, whose changes are incorporated into our files). Please ensure you install TSLRCM before installing this mod.

INSTALLATION
Please ensure you install TSLRCM before installing this mod. To use this tool, please follow these instructions:
 1. Extract the compressed files, and run the executable "app.exe".
 2. If you want to automatically import data from a KotOR 1 save, press the button "Load from KotOR 1 save". This will open a file selection box; navigate to the KotOR 1 save you wish to load from (it should be a folder). Select the folder and press "Select Folder". You can also manually edit/change the values in the GUI to your liking. Pressing "Create without KotOR 1 save" resets all values to their defaults.
 3. Once you've imported and/or set the values to your liking, press "Write Script". The tool will then generate a file "k_kreia_spawn.ncs" in the folder alongside "app.exe".
 4. Copy the file "k_kreia_spawn.ncs" into your TSL overrides folder. If you want to include the Atton dialog changes as well, copy the DLG file "101atton.dlg" into the TSL overrides folder too.

UNINSTALLATION
Delete the files "k_kreia_spawn.ncs", and "101atton.dlg" (if you installed it), from your overrides folder. 

INCLUSION IN OTHER MODS
Anyone who wants to use this in their mod is free to do so, with appropriate attribution.

CREDITS
This mod is created by me (lachjames), Thor110, and VarsityPuppet. Thanks for VarsityPuppet for the idea for this tool, and our discussions on its implementation. Thanks also to Thor110 for his great advice and assistance with editing the DLG files (which I've never done before as I'm new to KOTOR modding).

Thanks to the Xoreos team for allowing us to include xoreos-tools with this mod. We use the unerf and gff2xml tools from xoreos-tools to read data from KotOR 1 saves. Xoreos-tools is licensed under the terms of the GNU General Public License v3; more information can be found here.

Thanks also to Fred Tetra for creating the KotOR version of nwnnsscomp.exe, which is also used in this tool for compilation.


  • Submitter
  • Submitted
    06/03/2020
  • Category
  • TSLRCM Compatible
    Yes

 

Share this post


Link to post
Share on other sites

Hello, @lachjames!
I'd like to create a version of "Revan Unmasked" mod for "KotOR Save Importer for TSL", so I have a few questions and feedback regarding the program.

1. How to import player's portrait value from KOTOR? In KSE the "Portrait" variable is separate from Globals list.

I added new variable "101PER_Revan_Face" in globalcat.2da of TSL. Then I wrote code for the "Portrait" variable (tried names "Portrait" and "PortraitId"):

Spoiler

G_FinalChoice:
  k1_type: number
  k2_name: 101PER_Revan_End
  k2_type: number
  values:
    1: 1 # 101PER_Revan_End=1 is LS
    2: 0 # 101PER_Revan_End=0 is DS
PortraitId:
  k1_type: number
  k2_name: 101PER_Revan_Face
  k2_type: number
  values:
    1: 1 # PMHA01
    2: 2 # PMHA02
    26: 26 # PMHC04

 

but see only code for setting "101PER_Revan_End" variable in generated k_kreia_spawn script.

2. What will the program do if it reads unmapped value from the save file? Tested "G_FinalChoice" variable, and it seems that unmapped value will be automatically set to 0 (or to the default value of the type)? I need to know this, because the player can use custom head from some mod (and portrait variable = value I didn't map).

3. If you use KOTOR 1 variable names In GUI, then you should provide users with the appropriate KOTOR 1 values to choose from, rather than TSL values (e.g. "1" and "2" for "G_FinalChoice", not "1" and "0").

4. It seems that words LS and DS are swapped in the comments of the values of variable  "G_FinalChoice" (# means the beginning of the comment, right?) It should be:

Spoiler

1: 1 # 101PER_Revan_End=1 is DS
2: 0 # 101PER_Revan_End=0 is LS

 

5. Can you add a pop-up string with comments from YAML-file to drop-down list with values for variables in GUI? Then end-users will be able to quickly understand what values "0", "1" means without opening YAML file (I doubt end users even want or can read YAML code).

Edited by LoneWanderer

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this