Jump to content

Home

DeNCS Script Decompiler


Recommended Posts

TSLRP would like to announce the release of DeNCS Script Decompiler Beta 1. This is a GUI NCS-Script Decompiler written entirely in Java and uses the latest beta build of the JRE (1.6.0) to take advantage of the additional features it offers. The J2SE 1.6.0 beta can be obtained here.

 

While we encourage any suggestions/feature additions/critiques in this thread please note that this is merely a public release of a TSLRP internal tool; we do not plan on making updates to this a high priority. It will sometimes fail but it works for the majority of the scripts tested. At present it will only work on KotOR2 scripts. See the readme for more details.

 

Just a warning: this program can take up serious amounts of RAM with prolonged use.

Link to comment
Share on other sites

So what format does this decompile the scripts to. does it completly convert them to there *.nss format or to the *.pcode format?

 

I know I'll give it a go. However a script decompiler that uses that much RAM hopefully will be worthwhile as our current decompilers don't need that much memory.

Link to comment
Share on other sites

Originally posted by Darkkender

So what format does this decompile the scripts to. does it completly convert them to there *.nss format or to the *.pcode format?

 

I know I'll give it a go. However a script decompiler that uses that much RAM hopefully will be worthwhile as our current decompilers don't need that much memory.

 

*.nss format is what you can save them as.

 

We only recommend 256 so you can do other things (ie run Eclipse IDE which is a known memory hog) as well without having to worry about anything. Decompiling normal scripts (those with a main method and a handful of subroutines) only cause minor increases in RAM usage. I was able to decompile 2 dozen scripts and the RAM usage came to rest at about 30MB. The real problem lies in closing tabs; the program generates data that can get pretty big for larger files and it doesn't deallocate all of it. So prolonged use isn't going to do your RAM any favors :rolleyes:

Link to comment
Share on other sites

Very nice work - quite impressive!

 

I almost started working on something like this, but other Kotor Tool features took precedence.

 

You might want to mention in the Readme file that the command to start DeNCS is:

 

java -jar dencs.jar

 

Not everyone is familiar with Java ;)

Link to comment
Share on other sites

By default I believe installing the JVM will associate jar files with java.exe or javaw.exe, eliminating the need to use the command line. However, you are right, we probably should have mentioned the command line way anyways :rolleyes:

Link to comment
Share on other sites

  • 1 month later...

I am trying to decompile a_doormoor.ncs (the script that fires when the morgue door opens on peragus) and I have JRE installed, and I extracted nwscript.nss to kotor tool directory, and then ran DeNCS, and opened that above script, and it is still decompiling for almost 10 minutes, and my hard drive is doing nothing. Is there something that I did not install correctly or that I am missing?

Link to comment
Share on other sites

Originally posted by DarthMoeller

I am trying to decompile a_doormoor.ncs (the script that fires when the morgue door opens on peragus) and I have JRE installed, and I extracted nwscript.nss to kotor tool directory, and then ran DeNCS, and opened that above script, and it is still decompiling for almost 10 minutes, and my hard drive is doing nothing. Is there something that I did not install correctly or that I am missing?

 

Did you install the correct version of the Java Runtime Environment? You'll need some beta version and not the official release AFAIK.

 

Must have hanged if it works for 10 minutes on that script since it's a very simple script:

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));
}

Don't know what else could be wrong if you have the proper JRE, Java doesn't work on my machine for some reason so I can't test DeNCS and see if the script works to decompile here. :/

Link to comment
Share on other sites

Originally posted by DarthMoeller

I am trying to decompile a_doormoor.ncs (the script that fires when the morgue door opens on peragus) and I have JRE installed, and I extracted nwscript.nss to kotor tool directory, and then ran DeNCS, and opened that above script, and it is still decompiling for almost 10 minutes, and my hard drive is doing nothing. Is there something that I did not install correctly or that I am missing?

 

a_doormor.ncs takes about 1 second on my computer

(edit: snipped redundancy)

 

You mean you installed JRE 1.6, right? Have you been able to decompile anything with DeNCS, or was this the first script you tried? If you try running with an earlier JRE, it will usually appear to do nothing.

Link to comment
Share on other sites

Originally posted by JdNoa

You mean you installed JRE 1.6, right? Have you been able to decompile anything with DeNCS, or was this the first script you tried?

Yeah, I couldn't remember if I had it installed or not so i went to install it and it said it was already installed. This was the first script that I have tried to decompile.

Link to comment
Share on other sites

Originally posted by DarthMoeller

Yeah, I couldn't remember if I had it installed or not so i went to install it and it said it was already installed. This was the first script that I have tried to decompile.

 

Could you go to your file type association and check which version of Java is associated with JAR files? (On my system you have to select Advanced and then Edit the action to get the actual path).

 

Edit: I'm going to just post all the scripts DeNCS was able to decompile on PCGameMods. Don't know why I didn't think of that earlier. :/

Link to comment
Share on other sites

Originally posted by tk102

Wow, thanks JdNoa! :D

What tk said! :D

 

Wow! This will come in nice and handly like :thumbsup:

 

EDIT: Just took a second glance over this and I must say, VERY nice touch by seperating these scripts by the area number! This will definitely help in finding what we're looking for... :)

Link to comment
Share on other sites

  • 1 month later...

I don't know if anyone is going to notice this thread, but I can't get DeNCS to decompile anything. I downloaded the 25mb jre file from the link given, but I also have jre 1.5.0 (I have eclipse 3.0 and ibm's RAD installed too).

 

DeNCS will work for a few seconds at 100% cpu, then my cpu will go back to its normal usage percent and nothing will change in the DeNCS window. I tried to use path:\to\jre1.6.0\bin\javaw.exe path:\to\kotortool\dencs.jar , but it gave me errors...

Link to comment
Share on other sites

I don't know if anyone is going to notice this thread, but I can't get DeNCS to decompile anything. I downloaded the 25mb jre file from the link given, but I also have jre 1.5.0 (I have eclipse 3.0 and ibm's RAD installed too).

 

DeNCS will work for a few seconds at 100% cpu, then my cpu will go back to its normal usage percent and nothing will change in the DeNCS window.

DeNCS requires jre 1.6.0, it may not work with 5.0. You can download it here:

http://www.java.net/download/jdk6/binaries/

 

Make sure you have the latest version of nwnnsscomp.exe (1.03) in the same directory as DeNCS. If it's missing you get the behaviour you described.

Link to comment
Share on other sites

You only need the jre.

 

You could use the full path for java from the command line to make sure you're using 1.6. I often do that because I have 3 versions installed and my path variable never seems to be set up to use the one I want.

So, frex, on my computer:

H:>"g:\program files\java\jre1.6.0\bin\java.exe" -jar dencs.jar

 

Alternately, you could go to your environment variables and check which java version is in your Path variable.

Link to comment
Share on other sites

Now I need to figure out a better way to add something to dm_bmedbox80.ncs (it won't decompile fully).

 

Since it's not a standard script that comes with the game the easiest way is probably to ask the one who made the mod it belongs to for the source code. :)

Link to comment
Share on other sites

  • 1 month later...
Here's an archive of every script from K2 that DeNCS was able to decompile or partially decompile:

 

http://www.pcgamemods.com/14269/

 

You'll need a .7z (7zip) extractor (WinRAR or 7-Zip are the two I know of). Decompressed it's about 31MB.

 

correct link is now (took me few min to find hope this helps next guy(gal) out

http://www.pcgamemods.com/mod/14269.html

 

 

and thank you Jdnoa !

kdsphantom

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...