lachjames

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

11 Jedi Padawan

About lachjames

  • Rank
    Jedi Apprentice

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi I've spent the last month working on a new decompiler for NCS code, and I'm ready to share my work in progress with you all. It works properly on many scripts, but there are still situations where it produces incorrect code (but the issues are usually relatively minor). I started this project both because an updated, open source NCS decompiler would be useful to me, and also to learn more about decompilation theory. It's a fascinating topic - I plan to create a YouTube video series on decompilation, using this code as an example. It's also meant to be a reference for others who want to implement an NCS decompiler for themselves (e.g. in C++ for the xoreos-tools project), or for those who want to learn decompilation in general - although NCS is a relatively simple language to decompile (for many reasons, discussed in the GitHub readme), I use very little in the way of "heuristics" and have based my algorithms mostly on the famous 1994 Cifuentes thesis "Reverse Compilation Techniques". I'll keep you all updated if you're interested in any educational content I produce based on this project. Relative to DeNCS, my code has some new features (some implemented fully, some still in the works), including: - Detecting if-else if-else if-...-else chains and not using nested ifs (done) - Doesn't have any problems with ACTION assignments to global variables (DeNCS fails on this, which is one of the main reasons some K1 scripts don't work in DeNCS) (done) - Handles recursion gracefully using a technique I came up with (which I believe might be novel) (WIP but mostly done) - Detecting includes and using the source code from the game's NSS files rather than the decompiled code (WIP) It works quite well, but it's not perfect yet and there are issues (take a look at the GitHub README for more information). Please be very careful if you want to use this for your mods, and (if possible) decompile scripts with the original DeNCS as well to check for consistency. If in doubt, I'd trust DeNCS over my decompiler for now. You can find the complete source code on GitHub at https://github.com/lachjames/ncs2nss as well as instructions on using the decompiler if you'd like to give it a try. I'd be very grateful for any suggestions or issues anyone would like to raise I'm aware that other decompiler projects are currently in the works, and I'd be more than happy to work with anyone who would like to work with me. I've licensed the code under GPL 3.0; my understanding (I'm not a lawyer) is that you are welcome to use the code for anything as long as you open source that code too. At the very least, this is my intent. This is the same license xoreos-tools uses, so it seems reasonable. This project relies on xoreos-tools for disassembly; Windows binaries are included in the xt/ folder (but I intend to remove this before any official release, or at least work with @DrMcCoy to make this automatically update to the latest version of xoreos-tools).
  2. Thanks Great to meet you too! Thanks for taking a look - my point was not so much that it does anything that your code doesn't, but more that you might be better off joining forces with @DrMcCoy by contributing to xoreos-tools, rather than both of you buliding separate NCS assembly readers (e.g. you suggested previously that you have suggestions for ncsdis). All code has bugs (especially mine...), including ncsdis and (I have to imagine) your assembler as well, so wouldn't it be better to combine the two and learn from each of them rather than keeping the implementations separate? I just submitted a feature request on the xoreos-tools GitHub, discussing compiling xoreos-tools as a DLL rather than as executables. This might help your project too? Sure, I agree with what you said; however, the issue I have is not so much their description of JSR in itself (which I agree from a certain point of view is correct), but rather how that clashes with the description of ACTION - in essence, it says ACTION pops variables and pushes the return value to the stack if there is one, but JSR does not modify the stack. The return value part is clear and true, but this might indicate to the reader (as it did for me) that the JSR calling convention requires the caller to remove arguments after the call. It's because of how ACTION is described that I misinterpreted the description of JSR. There are significant differences between how ACTION and JSR work (the main one being that JSR does not push a return value to the stack but ACTION does) so the section saying that invoking subroutines and engine routines is done "basically in the same manner" is, IMO, incorrect. To be clear, I'm not meaning to rag on the Skywing documentation by any means - it's the only reason I've been able to get this far with my implementation of ncs2nss! It's brilliant and I'm very grateflu that it exists. Anyway, it's not a huge deal now as I figured it out in the end
  3. Hi @DrMcCoy thanks for “@ing” me - I rarely post on forums but this has given me motivation to do so I’ve made the GitHub repo for my implementation of “ncs2nss” public at https://github.com/lachjames/ncs2nss. There are a few things to know: - Firstly, it’s a work in progress and isn’t perfect. However, all the fundamental components are implemented and the code runs most of the time without error (as in runtime error - it may well make decompilation errors) - I would be not just happy but “double plus happy” if this were ported into C++ and included in xoreos-tools - I say in the readme that one of my goals is to demonstrate how this can be done in Python (using tools I’m familiar with such as rply) so others can implement the same (e.g. in xoreos-tools). I haven’t put an official license on it yet but like DrMcCoy I’m a big believer in open source so consider it open with attribution. - My version works with ncsdis and I encourage you to do the same (and include your improvements in xoreos-tools) as one perfect library for disassembly is better than two that work most of the time. This is just my opinion and I don’t mean to diminish the work you’ve done on the disassembler (I’m sure it’s great, just like xoreos-tools is great) - I just feel that if we all merge our efforts we can make a better final product @DrMcCoy feel free to post/copy anything from our conversations if you’d like. I’m an open book; just didn’t want to annoy you on GitHub by cluttering up your inbox with posts on issues In particular, let me copy-paste my latest message to him on Discord below: *** BEGIN QUOTE *** Hey so I've realized that this heuristic analysis is not reliable enough to be used properly, but I came up with another solution which works every time. The problem is that the Skywing documentation is incorrect, and JSR does in fact work just like ACTION in that it modifies the stack pointer by popping off arguments. It doesn't push on a return value though (if there is one, space for that must have been allocated by the caller function before calling the callee). Perhaps what they mean is that the JSR does not do anything "intrinsically", but the function calling convention appears to be that functions pop their own arguments (which is more reasonable than making the caller do it every time; this is something I've actually taught before in computer science classes). In any case, what you can do is the following (after constructing a call graph): For each subroutine in the call-graph, iterating with DFS reverse post-order traversal: 1. If the current subroutine is part of a cycle in the call graph: 1.a. Collect all the subroutines in the cycle 1.b. Trace both the final stack pointer and subroutine calls from every possible path from the start block of each subroutine to a block with no successors. 1.c. For each of these paths, we can form an entry in a system of simultaneous equations, where the final stack pointer is on the RHS and the subroutine calls are on the LHS. For example, if a path through subA calls subB 2 times and subC 2 times, and the final stack pointer is -8, our equation would be "0a + 4b + 2c = 8". 1.d. Solve this (potentially overdetermined) system of linear equations for a, b, c, ... which are the number of arguments for subroutines A, B, C, ... respectively. 2. Otherwise, compute the number of arguments as per usual for non-recursive functions. Can then also determine if there's a return value after finding the number of arguments. One issue with this is the problem of vector/struct arguments. This method will tell you the size of the stack space which is popped from the stack after calling each subroutine; however, it does not tell you the structure of said space. However, this is easy to calculate once you know the number of arguments - when you call the function in another subroutine, you can use the state of the stack at that call to determine the types of the sub's arguments (including how much space they take up). *** END QUOTE *** Don’t mean to take over this thread so I’ll make a new one if you want. I’d also be more than happy to talk to anyone on discord about this - feel free to message me (Lachjames#6269 - if you’re on the DS discord server you should be able to message me).
  4. Thank you all for your great ideas I think making Revan a bigger part of the story (keeping relationships, the face, etc.) is a great idea and shouldn't be too hard to implement. Perhaps changing the cave scene so Revan takes off their mask is a good start there, as LoneWanderer suggests. Maybe Thor110 can help me with porting animations from K1. Adding interactions with quests is also a great idea (e.g. LoneWanderer's suggestions, Manaan's economy, etc.), and I'd love some more suggestions for those. Before I can start working on this mod, I want to make sure I have adequate TTS models for the K1 characters I'll need (I have one for Bastila, so I need to develop one for Carth, Mission, and HK). It's just a matter of training time now as I've already collected datasets. Once I have these TTS models, I'll be able to create new content for KOTOR 2 using characters from KOTOR 1, which will make a continuity mod a lot more compelling.
  5. View File KOTOR Dialog Editor This is a visual dialog editor for KOTOR and TSL. It's currently in alpha, so if you're planning to use it for your mods just be aware that there might be (i.e. will be) bugs. COMPATIBILITY I am unaware of any compatibility issues with the DLGs created by this editor, but that doesn't mean there aren't any because this is an early alpha release. Please let me know if you experience any issues. INSTALLATION STEPS 1. Download the ZIP file, and unzip it into a folder (it doesn't create one on its own - I hate it when zips do that ). 2. Copy your "dialog.tlk" into the folder alongside the file "app.exe" - I included the "dialog.tlk" file for KOTOR (as "kotor.tlk"), and for TSL (as "tsl.tlk"), but if you're using any mods which edit "dialog.tlk" for the game you're working on (e.g. using TSLRCM), you'll need to replace it with your own copy. You can find the "dialog.tlk" file in the same folder as the base executable for your KOTOR/TSL installation. If it's for KOTOR 1, rename the copy of "dialog.tlk" you put into your app folder to "kotor.tlk". If it's for TSL, rename your "dialog.tlk" to "tsl.tlk". Don't change the name of dialog.tlk inside your actual KOTOR/TSL installation, as that will break the game. Only change the name of the version you copied into the KotOR Dialog Editor install directory (alongside "app.exe"). 34 Run "app.exe" UNINSTALLATION Delete all the downloaded files. USAGE INSTRUCTIONS General Usage - Create a new dialog file (for KOTOR 1) by pressing the "New" button, or open an existing DLG file using "Open" - Save dialog files using the "Save" button (there's no auto-save, nor does ctrl-s work - I'll make it work eventually) - Once you open a dialog file, you'll see some panels: - The top-left panel contains the "actions" list, which is a set of actions you can currently take. - The bottom-left panel contains "link" information when you select a response which is linked to the current response. - The top-middle panel contains NPC dialog (entries) - The bottom-middle panel contains player dialog (replies) - The right panel contains metadata for the selected response (strref, text, script, etc.) Some Important Terminology To understand what the actions do, you'll need to know the following terminology (some of which I made up, so please read this even if you're a pro): - Response: A line of dialog, spoken either by an NPC or the player (I sometimes call this a "node" too) - Entry: A line of NPC dialog - Reply: A line of player dialog - Start: A possible entry point for the dialog (always points to an entry, never a reply) - Link: Responses are linked to one another through "links" - Metadata: The general dialog data (things like the script that should run when the dialog ends, etc,.) - Selected response: The response which is highlighted in orange - this is preserved when navigating (until you select something else) - Current response: The response you last navigated into. - Copied response: The response you last selected "Copy Selected Node" on. Actions: The panel in the top-left corner contains a list of actions you can perform to edit your dialog. I'll try to describe the actions as well as I can here, but honestly the best way to learn the software is just to try it out: - Back To Start: Go back to the start of the dialog you're currently in - New Response: Create a new response (either an entry or a reply, depending on context) - Unlink Response: Removes the link between the selected response and the current response - Copy Selected: Sets the selected response as the copied response - Paste Into Start: If you have an entry as your copied response, and have selected a start response, it makes the start response point to the copied response - Paste As Link (Link): Adds a link from the current response to the copied response - Move Selected Up/Down: Moves the selected response up or down (respectively) by one level in the dialog evaluation order (for player dialog, this changes the order of the dialog lines they can choose from; for NPCs, the first line in the evaluation order whose "Active" script is either blank or returns TRUE is selected as the NPC's line) - Step Back/Forward: Move back/forwards in your dialog history (so you can easily go in/out of replies without restarting the dialog) FAQ I did x and it crashed/broke my DLG/set my PC on fire Yeah, this is alpha software and I need some people to test it out. Please let me know what broke the software so I can fix it. I'm clicking responses but nothing's happening You need to select responses for both the player (the bottom screen) and the NPCs they're talking to (the top screen). If this info doesn't fix your problem, let me know so I can look into it. I can navigate through the dialog, but how do I edit things? You left click on dialog lines to navigate through them, or right click on them to "select" them. Once a line is selected, you can edit it in the window to the right, edit the link between it and the current dialog node on the bottom-left panel, or copy it to another node by navigating to that node and pressing "Paste Into Current (Link)". The navigation seems to work, but I can't see the actual dialog text Make sure you have the correct "dialog.tlk" file in the same folder as "app.exe". If this doesn't solve the problem, please let me know so I can look into it. Cool app. Ugly, though... Yeah, I'm working on it, and I'm open to suggestions for making the UI cleaner/better/easier to use. DLGEdit's faster to use/better in some other way This isn't meant to be a replacement for DLGEdit - DLGEdit's power comes from the ease at which you can change an existing DLG into exactly what you want. Although this tool can do that too, it's designed for easily/naturally building DLGs from scratch rather than doing minor edits in existing DLGs, while having to actually run the dialog in KOTOR/TSL as little as possible (to avoid the time it takes to load the games and get to the conversation). FUTURE FEATURES - Flow chart view - Animation selection - More testing, bug fixes, etc. KNOWN ISSUES - If you create a link from node A to node B, and node A already has a link to node B, the dialog editor doesn't know which one you want to select when you right click and does weird things (e.g. always selecting the bottom-most copy, even when you right click on another copy). Will fix this asap. 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). Thanks to Thor110 for helping me test it out. Thanks to the Xoreos team for allowing us to include xoreos-tools with this mod. We use the gff2xml and xml2gff tools from xoreos-tools to read and write the DLG files. Xoreos-tools is licensed under the terms of the GNU General Public License v3; more information can be found here. Submitter lachjames Submitted 06/12/2020 Category Modding Tools  
  6. Hi With the release of the KotOR Save Importer for TSL (found here), making TSL's continuity match what happened in a KotOR game is now possible. I'm hoping to create a mod which adds some continuity features to TSL based on the events in KotOR 1. Thor110 has offered to help with this, and if anyone else would like to contribute I'm very open to that as well. I created this thread to continue a great discussion on the DS modding discord about some possible additions to TSL. If you have any suggestions for things we could add to TSL that depend on the player's actions in KOTOR 1, please respond to this post with them. In that discussion, we came up with the following suggestions (credit given where due; apologies if I missed someone, I did my best): - Atton no longer requiring the player to tell him what happened in KotOR 1 (me) - Cameos in TSL are adjusted based on the events of KotOR 1 (Thor110, Soaring__Sky) - HK-47 is found in a shop on Nar Shaddaa if he wasn't purchased in KotOR 1 (Thor110) - Obligatory Deadeye Duncan appearance (bogpill) - Yuthura (Soaring__Sky) - Elise from Dantooine (yeah... her) (bogpill) - Nikto NPCs referencing swoop gang choices from K1 (134340Goat) - Add some T3 dialog discussing what happened in K1, depending on whether the player repaired T3's memory in K1 (134340Goat) - Mission/Zaalbar/their allies(?) helping Atton in the cantina when he needs it (group effort, with ideas from bogpill, Soaring__Sky, 134340Goat, Thor110, and me) - Griff tries to talk the player into some far-fetched scheme (Soaring__Sky) - A Romeo/Juliet spinoff could make an appearance, if the appropriate quest was completed in KOTOR 1 (bogpill) Looking forward to hearing even more great ideas - thanks everyone
  7. Version 0.2.0

    83 downloads

    This is a visual dialog editor for KOTOR and TSL. It's currently in alpha, so if you're planning to use it for your mods just be aware that there might be (i.e. will be) bugs. COMPATIBILITY I am unaware of any compatibility issues with the DLGs created by this editor, but that doesn't mean there aren't any because this is an early alpha release. Please let me know if you experience any issues. INSTALLATION STEPS 1. Download the ZIP file, and unzip it into a folder (it doesn't create one on its own - I hate it when zips do that ). 2. Copy your "dialog.tlk" into the folder alongside the file "app.exe" - I included the "dialog.tlk" file for KOTOR (as "kotor.tlk"), and for TSL (as "tsl.tlk"), but if you're using any mods which edit "dialog.tlk" for the game you're working on (e.g. using TSLRCM), you'll need to replace it with your own copy. You can find the "dialog.tlk" file in the same folder as the base executable for your KOTOR/TSL installation. If it's for KOTOR 1, rename the copy of "dialog.tlk" you put into your app folder to "kotor.tlk". If it's for TSL, rename your "dialog.tlk" to "tsl.tlk". Don't change the name of dialog.tlk inside your actual KOTOR/TSL installation, as that will break the game. Only change the name of the version you copied into the KotOR Dialog Editor install directory (alongside "app.exe"). 34 Run "app.exe" UNINSTALLATION Delete all the downloaded files. USAGE INSTRUCTIONS General Usage - Create a new dialog file (for KOTOR 1) by pressing the "New" button, or open an existing DLG file using "Open" - Save dialog files using the "Save" button (there's no auto-save, nor does ctrl-s work - I'll make it work eventually) - Once you open a dialog file, you'll see some panels: - The top-left panel contains the "actions" list, which is a set of actions you can currently take. - The bottom-left panel contains "link" information when you select a response which is linked to the current response. - The top-middle panel contains NPC dialog (entries) - The bottom-middle panel contains player dialog (replies) - The right panel contains metadata for the selected response (strref, text, script, etc.) Some Important Terminology To understand what the actions do, you'll need to know the following terminology (some of which I made up, so please read this even if you're a pro): - Response: A line of dialog, spoken either by an NPC or the player (I sometimes call this a "node" too) - Entry: A line of NPC dialog - Reply: A line of player dialog - Start: A possible entry point for the dialog (always points to an entry, never a reply) - Link: Responses are linked to one another through "links" - Metadata: The general dialog data (things like the script that should run when the dialog ends, etc,.) - Selected response: The response which is highlighted in orange - this is preserved when navigating (until you select something else) - Current response: The response you last navigated into. - Copied response: The response you last selected "Copy Selected Node" on. Actions: The panel in the top-left corner contains a list of actions you can perform to edit your dialog. I'll try to describe the actions as well as I can here, but honestly the best way to learn the software is just to try it out: - Back To Start: Go back to the start of the dialog you're currently in - New Response: Create a new response (either an entry or a reply, depending on context) - Unlink Response: Removes the link between the selected response and the current response - Copy Selected: Sets the selected response as the copied response - Paste Into Start: If you have an entry as your copied response, and have selected a start response, it makes the start response point to the copied response - Paste As Link (Link): Adds a link from the current response to the copied response - Move Selected Up/Down: Moves the selected response up or down (respectively) by one level in the dialog evaluation order (for player dialog, this changes the order of the dialog lines they can choose from; for NPCs, the first line in the evaluation order whose "Active" script is either blank or returns TRUE is selected as the NPC's line) - Step Back/Forward: Move back/forwards in your dialog history (so you can easily go in/out of replies without restarting the dialog) FAQ I did x and it crashed/broke my DLG/set my PC on fire Yeah, this is alpha software and I need some people to test it out. Please let me know what broke the software so I can fix it. I'm clicking responses but nothing's happening You need to select responses for both the player (the bottom screen) and the NPCs they're talking to (the top screen). If this info doesn't fix your problem, let me know so I can look into it. I can navigate through the dialog, but how do I edit things? You left click on dialog lines to navigate through them, or right click on them to "select" them. Once a line is selected, you can edit it in the window to the right, edit the link between it and the current dialog node on the bottom-left panel, or copy it to another node by navigating to that node and pressing "Paste Into Current (Link)". The navigation seems to work, but I can't see the actual dialog text Make sure you have the correct "dialog.tlk" file in the same folder as "app.exe". If this doesn't solve the problem, please let me know so I can look into it. Cool app. Ugly, though... Yeah, I'm working on it, and I'm open to suggestions for making the UI cleaner/better/easier to use. DLGEdit's faster to use/better in some other way This isn't meant to be a replacement for DLGEdit - DLGEdit's power comes from the ease at which you can change an existing DLG into exactly what you want. Although this tool can do that too, it's designed for easily/naturally building DLGs from scratch rather than doing minor edits in existing DLGs, while having to actually run the dialog in KOTOR/TSL as little as possible (to avoid the time it takes to load the games and get to the conversation). FUTURE FEATURES - Flow chart view - Animation selection - More testing, bug fixes, etc. KNOWN ISSUES - If you create a link from node A to node B, and node A already has a link to node B, the dialog editor doesn't know which one you want to select when you right click and does weird things (e.g. always selecting the bottom-most copy, even when you right click on another copy). Will fix this asap. 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). Thanks to Thor110 for helping me test it out. Thanks to the Xoreos team for allowing us to include xoreos-tools with this mod. We use the gff2xml and xml2gff tools from xoreos-tools to read and write the DLG files. Xoreos-tools is licensed under the terms of the GNU General Public License v3; more information can be found here.
  8. Thanks, that means a lot if you have any suggestions or issues, please let me know!
  9. View File 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 lachjames Submitted 06/03/2020 Category Mods TSLRCM Compatible Yes  
  10. Version 1.0.0

    60 downloads

    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.
  11. View File K2Console - A Console For KOTOR 2 DESCRIPTION This is a little tool that mimics the visible console from K1, in TSL. It's written in Python (I've attached the source code below). IMPORTANT NOTES - The tool does not work in fullscreen mode (for now). I'd like to fix this in the future, but for now it only works in windowed mode. - The tool doesn't connect to TSL at all - it's completely separate. This means that (for example) if you open the console in TSL with tilde, and then alt-tab out of TSL and press tilde again, K2Console will detect this but TSL itself won't (meaning K2Console and TSL will be out of sync). - If you get out of sync and/or want to start the program again, you can type "xxxxx" (five x's in a row) into the console while it's open, which will close the program. Then just run the file "k2console.exe" and it'll start up again. No need to restart TSL (but make sure the TSL console is closed when you start K2Console, or you'll still be out of sync). - This program works by reading your keyboard inputs and storing them to memory, which is also one way a keylogger might work - so your anti-virus might identify it as such. This code does not connect to the internet at all (you can verify this for yourself if you like). I haven't included the source with the program package to avoid cluttering your TSL installation, but I included it as a separate download below. INSTALLATION Unzip all three files into the same folder as swkotor2.exe (i.e. C:\SteamLibrary\steamapps\common\Knights of the Old Republic II\, or wherever your TSL installation is located). UNINSTALLATION Delete the three files "k2console.exe", "console.bat", and "steam_console.bat". INITIALIZATION If you use Steam: Instead of starting your game through Steam, you can start it by running the file "steam_console.bat", located in your TSL install folder. Otherwise: Start the game by running "console.bat", again located in your TSL install folder. USAGE - Whenever you press ` to open the console in TSL, the mimic console should pop up too. I tried my best to exactly match the behavior of the TSL console (e.g. when it keeps text vs clears it), but if you find any discrepancies please let me know so I can fix them. - If I did my job, you shouldn't really be able to tell that the console's not built into TSL, so just use it as normal (with the ability to see what you wrote!) - To close the program (not TSL, just the console), type "xxxxx" (5 x's in a row) into the open console (this won't work if the console's not visible). Alternatively, you can close the command line that opens when you run the .bat file. INCLUSION IN OTHER MODS I'm not sure why you'd want to include this in other mods, but if you want to, you're welcome to do so with appropriate attribution. CREDITS Thanks to Thor110 for the idea for this tool, and for helping out with testing and ideas (as well as taking the screenshot for me). k2console.py Submitter lachjames Submitted 05/31/2020 Category Modding Tools  
  12. Version 0.1.0

    41 downloads

    DESCRIPTION This is a little tool that mimics the visible console from K1, in TSL. It's written in Python (I've attached the source code below). IMPORTANT NOTES - The tool does not work in fullscreen mode (for now). I'd like to fix this in the future, but for now it only works in windowed mode. - The tool doesn't connect to TSL at all - it's completely separate. This means that (for example) if you open the console in TSL with tilde, and then alt-tab out of TSL and press tilde again, K2Console will detect this but TSL itself won't (meaning K2Console and TSL will be out of sync). - If you get out of sync and/or want to start the program again, you can type "xxxxx" (five x's in a row) into the console while it's open, which will close the program. Then just run the file "k2console.exe" and it'll start up again. No need to restart TSL (but make sure the TSL console is closed when you start K2Console, or you'll still be out of sync). - This program works by reading your keyboard inputs and storing them to memory, which is also one way a keylogger might work - so your anti-virus might identify it as such. This code does not connect to the internet at all (you can verify this for yourself if you like). I haven't included the source with the program package to avoid cluttering your TSL installation, but I included it as a separate download below. INSTALLATION Unzip all three files into the same folder as swkotor2.exe (i.e. C:\SteamLibrary\steamapps\common\Knights of the Old Republic II\, or wherever your TSL installation is located). UNINSTALLATION Delete the three files "k2console.exe", "console.bat", and "steam_console.bat". INITIALIZATION If you use Steam: Instead of starting your game through Steam, you can start it by running the file "steam_console.bat", located in your TSL install folder. Otherwise: Start the game by running "console.bat", again located in your TSL install folder. USAGE - Whenever you press ` to open the console in TSL, the mimic console should pop up too. I tried my best to exactly match the behavior of the TSL console (e.g. when it keeps text vs clears it), but if you find any discrepancies please let me know so I can fix them. - If I did my job, you shouldn't really be able to tell that the console's not built into TSL, so just use it as normal (with the ability to see what you wrote!) - To close the program (not TSL, just the console), type "xxxxx" (5 x's in a row) into the open console (this won't work if the console's not visible). Alternatively, you can close the command line that opens when you run the .bat file. INCLUSION IN OTHER MODS I'm not sure why you'd want to include this in other mods, but if you want to, you're welcome to do so with appropriate attribution. CREDITS Thanks to Thor110 for the idea for this tool, and for helping out with testing and ideas (as well as taking the screenshot for me). k2console.py