Jump to content

Home

[Solved] Problem compiling script for TSL


ceryxp

Recommended Posts

Hi everyone,

Recently I've been playing a lot of KotOR and TSL. For some time I've been using Achilles' Extended Force Powers Mod for K1. Every once in a while I would look around to see if anyone had done the same thing for TSL, with no luck. Finally, after years of doing basic things with KotOR Tool, I decided to try editing the script myself. I read the scripting tutorials on this forum, specifically on how to compile scripts and followed those steps. I started by trying to edit k_inc_force.nss using KotOR Tool, which was easy and I saved a copy of the altered nss for future reference. But when I tried to compile, KotOR Tool said it compiled, didn't give any error messages, but didn't produce a compiled k_sp1_generic.ncs anywhere that I could find. Next I downloaded Fred Tetra's compiler and followed the instructions as outlined in this thread. Again, the output stated that it was compiling but didn't produce a compiled ncs. I tested to ensure that I could compile other scripts by running a couple source files from other mods then testing the scripts in game, all worked as expected.

 

Here is an example of the changes I am making:

From:
float fDuration = Sp_CalcDuration( 30.0 );

To:
float fDuration = Sp_CalcDuration( 60.0 );

These are the same changes that Achilles' did in their mod and should have the effect of doubling the duration of the power. I haven't altered any syntax so that shouldn't be preventing the script from compiling and the compiler never returns any errors. I have tried running every which thing as administrator in every possible combination. I have a copy of nwscript.nss in both my Override folder and the same folder as nwnnsscomp.exe.

 

No matter what I do I can't seem to get this to compile and I can't figure out what I'm doing wrong. The scripts that I have been able to compile are much shorter than k_inc_force.nss, which is approximately 7000 lines. Could the length of the script be an issue? If there was a syntax error wouldn't the compilers return an error? Is there some magic combination of administrator rights and compatibility mode needed to get these to run?

 

I've placed a copy of the source script on my Dropbox if anyone would like to take a look at it.

https://www.dropbox.com/s/su899xcz02k7rp9/k_inc_force.nss?dl=0

 

Now, while trying to find a solution to this problem I may have found an alternative method that would require a little more work. Would it be possible to simply copy the sections that I want to alter from k_inc_force.nss to another file, make my edits and compile that much shorter script? Would I need to include any header info or a referrer to the original k_sp1_generic.ncs? I know that I would need to alter spells.2da to point to the new spells script for each force power that I alter (that would be the more work).

 

Thanks everyone in advance for any help you can provide in trying to solve this.

 

Help me, Obi-Code Kenobi. You're my only hope!

 

 

[Edit]

Well, If I had only waited about 5 mins... Quite literally after I made this post I found my solution. It was buried further down in the forum post from which I got the alternate idea. It seems I needed to extract k_inc_debug.nss and k_sp1_generic.nss to the same folder as k_inc_force.nss. Make my edits to k_inc_force.nss then compile k_sp1_generic.nss. So I was missing two other source files and I was trying to compile the wrong script. Now I feel a little silly. Once I've done a bit of testing I may post the altered script for others to use if there is interest.

Thanks again.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...