PDA

View Full Version : decompiling kotor scripts


jinger
05-05-2006, 07:03 AM
i take it there's no way to get the source code for K1 scripts? for TSL i got the DeNCS decomiled scripts archive hosted on pcgamemods, just great. is there at least some manual or something i can read so that i may understand the bytecode Kotor Tool can get me and write down the script myself? :P please help!

i'm sure someone already asked about this, sorry for that.

stoffe
05-05-2006, 08:35 AM
i take it there's no way to get the source code for K1 scripts? for TSL i got the DeNCS decomiled scripts archive hosted on pcgamemods, just great. is there at least some manual or something i can read so that i may understand the bytecode Kotor Tool can get me and write down the script myself? :P please help!

i'm sure someone already asked about this, sorry for that.

As I understand it DeNCS should work with KotOR1 scripts as well if you use the nwscript.nss file from that game. (I haven't tested it though since I don't have Java installed on my computer.)

As for doing it the hard way, there is a fairly detailed description of the compiled NCS script bytecode format available here (http://www.torlack.com/index.html?topics=nwndata_ncs). It's for Neverwinter Nights, but the format is pretty much the same in the KotOR games.

jinger
05-11-2006, 07:14 PM
thanks for the link :D it seems quite a bit of work, don't know if i have the patience for that right now, but thanks

Lit Ridl
05-21-2006, 12:49 PM
Maybe it will be better to get source from Kotor Tool? If you agree do the folowing:
Kotor Tool/Kotor II/BIFs/scripts.bif now you will see "Scripts, Compiled" - it is for compiled .ncs scripts and "Scripts, Source" now we need to click on "Extract entire BIFF subyipe" and select folder where you want to extract all scripts. Some computers may need 0,5-5 minutes to decompile and extract, computer will say that program freezes it's ok. Don't try to open source scripts in Kotor tool! You've finished now!

EnderWiggin
05-21-2006, 02:11 PM
Maybe it will be better to get source from Kotor Tool? If you agree do the folowing:
Kotor Tool/Kotor II/BIFs/scripts.bif now you will see "Scripts, Compiled" - it is for compiled .ncs scripts and "Scripts, Source" now we need to click on "Extract entire BIFF subyipe" and select folder where you want to extract all scripts. Some computers may need 0,5-5 minutes to decompile and extract, computer will say that program freezes it's ok. Don't try to open source scripts in Kotor tool! You've finished now!


Except for the fact that not all scripts have a source in there....

:rolleyes:

_EW_

Edit: Yeah, what DK said. Most scripts don't have source available.

Darkkender
05-22-2006, 01:18 PM
Except for the fact that not all scripts have a source in there....

:rolleyes:

_EW_


Let me rephrase this for you EW. Most of the scripts don't have there source available. Especially since nearly every module has anywhere from 10-50 scripts in k1 maybe more for some modules.(thinking manaan) The available script source's in the generic scripts.bif section are for the generic scripts and not for the sometimes more advanced scripts found in the modules.

As to DeNCS the biggest problem currently is that it was built for an older version of the Java Runtime Environment and some of the recent changes in the JRE have directly Affected DeNCS so that it won't seem to decompile the scripts now. This has been a topic of discussioon by Dashus and JDnoa in other threads.(possibly even other forums.)

Pavlos
05-22-2006, 01:28 PM
The good thing is though that BioWare used a lot of include files for their scripts - one for every planet in fact... so it is quite easy to figure out things. Just look under the scripts.bif -> source and you should find them.

Edit:

Endar Spire: k_inc_end
Taris: k_inc_tar
Dantooine: k_inc_dan
Kashyyyk: k_inc_kas
Tatooine: k_inc_tat
Korriban: k_inc_*** (I can't seem to find this)
Leviathan: k_inc_lev
Manaan: k_inc_man
Unknown World: k_inc_unk
Star Forge: k_inc_endgame

Some of the things they use an include for are weird... simple checks for Global Booleans etc.. I suppose it is to make sure the designers can easily manipulate the engine - taking a load off the programmers.

Darkkender
05-22-2006, 01:31 PM
The good thing is though that BioWare used a lot of include files for their scripts - one for every planet in fact... so it is quite easy to figure out things. Just look under the scripts.bif -> source and you should find them.

One for every planet in scripts.bif? I sure would love to get a copy of your scripts.bif. Especially since mine doesn't have an include for any planets at all. That is except for K_inc_hawk.nss which of course controls more than the Ebon Hawk.

Pavlos
05-22-2006, 01:37 PM
Have a look at my edit. Also, there is no such thing as k_inc_hawk in KotOR I. The file you probably mean is: k_inc_ebonhawk :).

Darkkender
05-23-2006, 01:52 AM
I did typo the Ebonhawk include however as I said I would love your scripts.bif because all of those includes are not in mine. I even rechecked it this evening.

stoffe
05-23-2006, 06:45 AM
I did typo the Ebonhawk include however as I said I would love your scripts.bif because all of those includes are not in mine. I even rechecked it this evening.

Strange, I can confirm that those files listed in the above post are present in my scripts.bif for KotOR as well. Perhaps there is a difference between the US and international versions when it comes to what non-essential files are included? (Would not be unheard of, since nwscript.nss is broken in international versions of K2:TSL but works in the current US version, as I understand it.)

jinger
05-23-2006, 10:25 AM
As to DeNCS the biggest problem currently is that it was built for an older version of the Java Runtime Environment and some of the recent changes in the JRE have directly Affected DeNCS so that it won't seem to decompile the scripts now. This has been a topic of discussioon by Dashus and JDnoa in other threads.(possibly even other forums.)
i see :) that's why it wasn't working.Strange, I can confirm that those files listed in the above post are present in my scripts.bif for KotOR as well.strange indeed, those files have been a great help for me… with certain scripts, very little help with many others though.

Darkkender
05-23-2006, 11:25 AM
I discovered what the problem was last night after my last post. I went back and was checking my k1 installation to see if there was a problem with file sizes. Sure enough about half of the bif files were only 3/4 the size of the ones on the cd's. So I was able to fix the effective problem by copying them straight from the cd's. Now I have those includes as well as many more scripts that had been missing. Not to mention other resources entirely including an entire bif file.