Recommended Posts

Most tutorials related to adding party members have script for another party member to be replaced. As I have been working to add a party member to, following her capture aboard the Leviathan, replace Bastila, I have been looking at game scripts. I cannot determine if Bastila is truly removed from the party. I must know this, as problems occur if a recruit mod removes a party member that has been removed previously. Further, there are script files that have positions and actions for party members on the Ebon Hawk  (k_trg_partyinit.nss, k_pebn_pophawk.ncs). Is there a conditional that would allow me to place my character where Bastila was seated?

Share this post


Link to post
Share on other sites

The ultimate question is "Is this NPC still on the Party Selection screen?" If not, then they have been fully removed from the available party. For example, when Bastila is taken by Malak aboard the Leviathan, you no longer see her as an available party member. This allows mods like BOS:SR to kick in and place a new NPC straight into the party in her place.

Whenever an NPC needs to be removed from the available party, you just need to run the RemoveAvailableNPC() function in a script, usually fired by dialog.

Share this post


Link to post
Share on other sites
1 hour ago, DarthTyren said:

The ultimate question is "Is this NPC still on the Party Selection screen?" If not, then they have been fully removed from the available party. For example, when Bastila is taken by Malak aboard the Leviathan, you no longer see her as an available party member. This allows mods like BOS:SR to kick in and place a new NPC straight into the party in her place.

Whenever an NPC needs to be removed from the available party, you just need to run the RemoveAvailableNPC() function in a script, usually fired by dialog.

I see compiled scripts for the module. The "RemoveAvailableNPC(0)" line is for source scripts. I have an older version of the spawn armband. The Readme file states that Bastila can be added to the party after the Leviathan, so problems may occur. Would a replacement NPC (I am attempting to work with necessary script) be, additionally, in the same location as Bastila on the Ebon Hawk?

Share this post


Link to post
Share on other sites
2 hours ago, Neville said:

I see compiled scripts for the module. The "RemoveAvailableNPC(0)" line is for source scripts. I have an older version of the spawn armband. The Readme file states that Bastila can be added to the party after the Leviathan, so problems may occur.

If you use the armband to add Bastila back, yes. If not, she's taken out of the party, making it possible to have a new NPC in her place.

2 hours ago, Neville said:

Would a replacement NPC (I am attempting to work with necessary script) be, additionally, in the same location as Bastila on the Ebon Hawk?

Because default position on the Ebon Hawk is relative to position on the party table, yes.

Share this post


Link to post
Share on other sites
22 hours ago, DarthTyren said:

If you use the armband to add Bastila back, yes. If not, she's taken out of the party, making it possible to have a new NPC in her place.

Because default position on the Ebon Hawk is relative to position on the party table, yes.

I have found another problem. I assigned the script to spawn my NPC on a node in dialogue. The NPC spawns, but dialogue of the character I assigned the script to ends with this script. The dialogue for my NPC (I found voice reference files for some) is working.

20210528142646_1.jpg

Share this post


Link to post
Share on other sites

I would need to see the DLG and source in order to help with that.

Share this post


Link to post
Share on other sites
10 hours ago, DarthTyren said:

I would need to see the DLG and source in order to help with that.

This is everything I had. If you need my appearance.2da file, it has Sith Specter's Helmet Mod and a mod, which  I do  not remember the author of, to change textures of Bastila's clothing to match the color of her robes. I do not know what some features of the .utc file (Max Hit Points) are for, or if my recruit scripts would have interfered with each other. I discovered restored dialogue caused problems and my script editor was checking for files in the CD version of KotOR. My script editor now states it cannot compile files without the CD version of the game. My computer gives an error message when I attempt to reinstall the CD version of KotOR to correct files. Further, the .utc file will not save with my assigned portrait image.

Recruit Sarna.ZIP

Share this post


Link to post
Share on other sites

The line that you added...
"You might like to know, the Republic allowed ne to enlist. Do you need my help?"
...is not available? I don't really see a reason why since it's on the main branch.
(p.s. "ne" should be "me")

There's no reason to reuse that row 0 in portraits.2da, you can add a new row, click on the * below the last row.
That aside, can you not pick it when you open p_sarna.utc? It should be the first one in the list.

I don't know which script editor you use or what could be the problem there. I can compile with KotOR Tool + the Steam version. I did have problems compiling in the past, it can be a pain.

Share this post


Link to post
Share on other sites
2 hours ago, Effix said:

The line that you added...
"You might like to know, the Republic allowed ne to enlist. Do you need my help?"
...is not available? I don't really see a reason why since it's on the main branch.
(p.s. "ne" should be "me")

There's no reason to reuse that row 0 in portraits.2da, you can add a new row, click on the * below the last row.
That aside, can you not pick it when you open p_sarna.utc? It should be the first one in the list.

I don't know which script editor you use or what could be the problem there. I can compile with KotOR Tool + the Steam version. I did have problems compiling in the past, it can be a pain.

The dialogue line becomes available if the player has spoken to Sarna once. I tried selecting the portrait option, but the .utc file does not save with the portrait. I use KotOR Scripting Tool, found here KotOR Scripting Tool - Modding Tools - Deadly Stream . It was working when I created the spawn for Sarna. I had the CD version of the game installed to check for errors. I uninstalled it due to error messages. Now, I can create new script, but the tool will not compile the script. It gives the message "Lookup path root set to C:\Program Files\SWKotOR\" "Error: Couldn't initialize the NwnStdLoader". I cannot find a way to change path for KotOR Scripting Tool. I tried changing the path for KotOR Tool, but it gives the same message. It may be necessary for me to have someone else compile my source script.

20210531170144_1.jpg

Share this post


Link to post
Share on other sites
3 hours ago, Neville said:

The dialogue line becomes available if the player has spoken to Sarna once. I tried selecting the portrait option, but the .utc file does not save with the portrait. I use KotOR Scripting Tool, found here KotOR Scripting Tool - Modding Tools - Deadly Stream . It was working when I created the spawn for Sarna. I had the CD version of the game installed to check for errors. I uninstalled it due to error messages. Now, I can create new script, but the tool will not compile the script. It gives the message "Lookup path root set to C:\Program Files\SWKotOR\" "Error: Couldn't initialize the NwnStdLoader". I cannot find a way to change path for KotOR Scripting Tool. I tried changing the path for KotOR Tool, but it gives the same message. It may be necessary for me to have someone else compile my source script.

The problem is nwnnsscomp.exe. Download this one (TSLPatcher1210b1.7z) :

You'll have to use a normal text editor to write your scripts, then run nwnnsscomp.exe from PowerShell or the Command Prompt.

Share this post


Link to post
Share on other sites
1 hour ago, AmanoJyaku said:

The problem is nwnnsscomp.exe. Download this one (TSLPatcher1210b1.7z) :

You'll have to use a normal text editor to write your scripts, then run nwnnsscomp.exe from PowerShell or the Command Prompt.

 

1 hour ago, AmanoJyaku said:

The problem is nwnnsscomp.exe. Download this one (TSLPatcher1210b1.7z) :

You'll have to use a normal text editor to write your scripts, then run nwnnsscomp.exe from PowerShell or the Command Prompt.

I have those tools. TLKEd brings up a full list of StrRef files, and  I have seen many mods installed with TSLPatcher, as it directs location to place new files and edits .2da files, but, though some mods by InyriForge included source script, I have not seen TSLPatcher used often with script that was not already compiled. I am trying simply to create a recruit mod. The program nwnnsscomp, this a program I tried to use, never truly opens for me.

Share this post


Link to post
Share on other sites
59 minutes ago, Neville said:

I have those tools. TLKEd brings up a full list of StrRef files, and  I have seen many mods installed with TSLPatcher, as it directs location to place new files and edits .2da files, but, though some mods by InyriForge included source script, I have not seen TSLPatcher used often with script that was not already compiled. I am trying simply to create a recruit mod. The program nwnnsscomp never truly opens for me.

What I meant was you need to download TSLPatcher1210b1.7z to get the version of nwnnsscomp that works, it's different from the version included in KotOR Scripting Tool.

Nwnnsscomp is a command line tool. You will need to open PowerShell to run it:

https://docs.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started?view=powershell-7.1

Alternatively, you can run it from the Command Prompt. Just follow the instructions in the link above and replace "PowerShell" with "Command Prompt".

Share this post


Link to post
Share on other sites
45 minutes ago, AmanoJyaku said:

What I meant was you need to download TSLPatcher1210b1.7z to get the version of nwnnsscomp that works, it's different from the version included in KotOR Scripting Tool.

Nwnnsscomp is a command line tool. You will need to open PowerShell to run it:

https://docs.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started?view=powershell-7.1

Alternatively, you can run it from the Command Prompt. Just follow the instructions in the link above and replace "PowerShell" with "Command Prompt".

I still do not understand why my tools stopped working, and this is quite complex. It will take much time to figure out. Instructions do not show how to run another program with this. I do not see anything about that, except for internal files, in the instructions. Instructions show other file formats. All of this becomes very frustrating following over a month of work.

Share this post


Link to post
Share on other sites
31 minutes ago, Neville said:

I still do not understand why my tools stopped working, and this is quite complex. It will take much time to figure out. Instructions do not show how to run another program with this.

From the link:
 

Quote

Where do I find PowerShell?

The easiest way to find PowerShell on Windows 10 is to type PowerShell into the search bar as shown in Figure 1-1.

But, you probably want to open PowerShell in the directory that has nwnnsscomp, so:

  1. In Explorer, open the directory that has nwnnsscomp
  2. Go to File
  3. Select Windows PowerShell
  4. Select Open Windows PowerShell

Make sure your script is in the same directory, along with the nwscript.nss file. Then type nwnnsscomp -c <filename.nss>. If your script uses include files they will need to be in the directory, as well.

Nwnnsscomp defaults to checking for nwscript.nss and does not allow you to specify the file with the functions. This prevents you from putting both games' NSS files in the same directory. I have two directories on my computer, one for KotOR1 and another for KoTOR2. Each has a copy of nwnnsscomp, along with every NSS file that comes with each game.

Share this post


Link to post
Share on other sites
7 minutes ago, AmanoJyaku said:

From the link:
 

But, you probably want to open PowerShell in the directory that has nwnnsscomp, so:

  1. In Explorer, open the directory that has nwnnsscomp
  2. Go to File
  3. Select Windows PowerShell
  4. Select Open Windows PowerShell

Make sure your script is in the same directory, along with the nwscript.nss file. Then type nwnnsscomp -c <filename.nss>. If your script uses include files they will need to be in the directory, as well.

I have two directories on my computer, one for KotOR1 and another for KoTOR2. Each has a copy of nwnnsscomp, along with every NSS file that comes with each game.

I can open PowerShell. I am confused as to how to use it. Again, I still do not understand why my own tools stopped working. I tried using KotOR scripting tool compile with the newer version of nwnnsscomp. It gave the message "Error: Unrecognized option"

Share this post


Link to post
Share on other sites
2 hours ago, Neville said:

I can open PowerShell. I am confused as to how to use it. Again, I still do not understand why my own tools stopped working. I tried using KotOR scripting tool compile with the newer version of nwnnsscomp. It gave the message "Error: Unrecognized option"

As I said, you will not be using KotOR Scripting Tool. You will use a text editor like Notepad to write your script, and nwnnsscomp to compile the script. KotOR Scripting Tool is just an interface to nwnnsscomp.

But, it is a broken interface because the version of nwnnsscomp it's designed for doesn't work. The reason KotOR Scripting Tool won't work with the good version of nwnnsscomp is because it sends options to nwnnsscomp that only work with the broken version. (Specifically, -g, which tells the old nwnnsscomp to compile for either KotOR1 or TSL.)

Once again, the instructions for PowerShell:

  1. In Explorer, create a directory with nwnnsscomp and all of the NSS files from either KotOR1 or KotOR2
  2. In Explorer, place your new NSS file, named <filename.nss>, in that directory
  3. In Explorer, use the File menu to open PowerShell
  4. In PowerShell, type .\nwnnsscomp -c <filename.nss>

If you prefer to use the Command Prompt, you will have to open it in the Windows Search Bar. Then type cd <path>, where <path> is the directory that holds nwnnsscomp.exe. The only advantage to using Command Prompt is you can leave out the .\ when running nwnnsscomp.

To summarize, stop using KotOR Scripting Tool.

Share this post


Link to post
Share on other sites
11 minutes ago, AmanoJyaku said:

As I said, you will not be using KotOR Scripting Tool. You will use a text editor like Notepad to write your script, and nwnnsscomp to compile the script. KotOR Scripting Tool is just an interface to nwnnsscomp.

But, it is a broken interface because the version of nwnnsscomp it's designed for doesn't work. The reason KotOR Scripting Tool won't work with the good version of nwnnsscomp is because it sends options to nwnnsscomp that only work with the broken version. (Specifically, -g, which tells the old nwnnsscomp to compile for either KotOR1 or TSL.)

Once again, the instructions for PowerShell:

  1. In Explorer, create a directory with nwnnsscomp and all of the NSS files from either KotOR1 or KotOR2
  2. In Explorer, place your new NSS file, named <filename.nss>, in that directory
  3. In Explorer, use the File menu to open PowerShell
  4. In PowerShell, type .\nwnnsscomp -c <filename.nss>

If you prefer to use the Command Prompt, you will have to open it in the Windows Search Bar. Then type cd <path>, where <path> is the directory that holds nwnnsscomp.exe. The only advantage to using Command Prompt is you can leave out the .\ when running nwnnsscomp.

To summarize, stop using KotOR Scripting Tool.

With PowerShell 7.1.3-win-x86, I cannot seem to go into Explorer. I will have to continue my scripting work tomorrow.

Share this post


Link to post
Share on other sites
Guest Qui-Gon Glenn

Windows Explorer is simply the name for your folder view. You can make the Powershell window smaller and/or drag it all the way left until it pops as the left half of your screen.

Down on your quickbar, click on the Folder Icon. Drag the newly opened Explorer window to the far right until it pops into the right half of your screen. If you need to open another Explorer window, select the folder and right click it, and select Open In New Window.

Now you have Explorer open, and Powershell. This was never necessary btw, you make the folders in Explorer, move the .nss in question into that folder with Explorer, then open Powershell in that folder and execute the command line.

This is just basic terminology we use, so if you aren't familiar with it you soon will be since you seem committed to trying :)

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.