Jump to content

Home

DeNCS Script Decompiler


Recommended Posts

Ok I have a problem trying to decompile anything I have all the proper files and I am running JRE 1.6.0-rc-b67 the very lastest version here is what happens I open a script and nothing happens here is what I am getting in the console.

 

read actions. There were 877

 

---> starting decompilation: a_sion_cut.ncs <---

Variable Naming: consider adding GetPositionFromLocation

Variable Naming: consider adding GetPositionFromLocation

Variable Naming: consider adding EffectMovementSpeedDecrease

Variable Naming: consider adding GetPositionFromLocation

Variable Naming: consider adding GetPositionFromLocation

Execing nwnnsscomp -d -g 2 -o "D:\My Documents\My Development\Knights of the Old

Republic\Knights of the Old Republic 2 - The Sith Lords Enhanced\Development\Mo

dules\a_sion_cut.pcode" "D:\My Documents\My Development\Knights of the Old Repub

lic\Knights of the Old Republic 2 - The Sith Lords Enhanced\Development\Modules\

a_sion_cut.ncs"

OUTPUT>Lookup path root set to: E:\Program Files\LucasArts\SWKotOR2\

OUTPUT>Decompiling: a_sion_cut.ncs

OUTPUT>Total Execution time = 47 ms

Execing nwnnsscomp -c -g 2 -o "E:\Program Files\LucasArts\SWKotOR2\_generatedcod

e.ncs" "E:\Program Files\LucasArts\SWKotOR2\_generatedcode.nss"

OUTPUT>Lookup path root set to: E:\Program Files\LucasArts\SWKotOR2\

OUTPUT>Compiling: _generatedcode.nss

OUTPUT>Total Execution time = 47 ms

Execing nwnnsscomp -d -g 2 -o "E:\Program Files\LucasArts\SWKotOR2\_generatedcod

e.pcode" "E:\Program Files\LucasArts\SWKotOR2\_generatedcode.ncs"

OUTPUT>Lookup path root set to: E:\Program Files\LucasArts\SWKotOR2\

OUTPUT>Decompiling: _generatedcode.ncs

OUTPUT>Total Execution time = 62 ms

Exception in thread "Thread-2" java.lang.NoSuchMethodError: javax.swing.JTabbedP

ane.getTabComponentAt(I)Ljavax/swing/JComponent;

at com.knights2end.nwscript.decomp.Decompiler.stateChanged(Decompiler.ja

va:332)

at javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:312)

at javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:2

44)

at javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingl

eSelectionModel.java:116)

at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingl

eSelectionModel.java:50)

at javax.swing.JTabbedPane.setSelectedIndexImpl(JTabbedPane.java:500)

at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:486)

at javax.swing.JTabbedPane.insertTab(JTabbedPane.java:617)

at com.knights2end.nwscript.decomp.Decompiler.newNCSTab(Decompiler.java:

749)

at com.knights2end.nwscript.decomp.Decompiler.newNCSTab(Decompiler.java:

661)

at com.knights2end.nwscript.decomp.Decompiler.decompile(Decompiler.java:

833)

at com.knights2end.nwscript.decomp.Decompiler.open(Decompiler.java:991)

at com.knights2end.nwscript.decomp.Decompiler.access$0(Decompiler.java:9

79)

at com.knights2end.nwscript.decomp.Decompiler$3.run(Decompiler.java:962)

 

 

Then if I try save or try to click anywhere it gives me more errors.

Link to comment
Share on other sites

Argh, Razorfish mentioned this a few days ago. They changed one of the methods in the new JRE recently. (This is what we get for using a beta version...) Bleh. I'm kind of swamped with school work at the moment (essay due in one hour, whee!), so I can't fix anything right now. Sorry. :/ Um... I don't suppose the script archive would help you?

Link to comment
Share on other sites

Unfortunatly the 2 scripts I need in the archive have the compare does not match the scripts are a_sion_cut.ncs and a_sion_cut2.ncs but I could see if the USM team has those scripts as they modified them or if the version in the archive work right in game.

 

For tonight I will try the ones in the archive and see if I have any bugs.

 

Thanks for the quick respond.

 

I tried the ones in the archive and they are bugged the npc's don't move I will just ask the USM scripter if he still has his original NSS

Link to comment
Share on other sites

Unfortunatly the 2 scripts I need in the archive have the compare does not match the scripts are a_sion_cut.ncs and a_sion_cut2.ncs

 

Here are two scripts that match a_sion_cut and a_sion_cut2 without any errors, if those in the decompiled archive doesn't work:

 

// ST: a_sion_cut.nss (153HAR_s.rim)

void main() {
   object oSion = GetObjectByTag("DarthSion");
   if (!GetIsObjectValid(oSion)) {
       AurPostString("Darth Sion isn't here, don't bother with the rest of the cut scene", 5, 7, 10.0);
       return;
   }

   SetPartyLeader(NPC_PLAYER);

   object oPC = GetFirstPC();
   object oAtton = GetObjectByTag("atton");
   object oKreia = GetObjectByTag("kreia");

   if (!GetIsObjectValid(oAtton) || !GetIsObjectValid(oKreia)) {
       AurPostString("No Atton or Kreia, don't bother with the rest of the cut scene", 5, 7, 10.0);
       return;
   }

   int nParam = GetScriptParameter(1);
   switch (nParam) {
       case 0: {
           AssignCommand(oPC,    ClearAllActions());
           AssignCommand(oKreia, ClearAllActions());
           AssignCommand(oAtton, ClearAllActions());

           AssignCommand(oPC,    ActionJumpToLocation(GetLocation(GetObjectByTag("WP_pc"))));
           AssignCommand(oKreia, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_npc2"))));
           AssignCommand(oAtton, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_npc3"))));

           object oWP1 = GetObjectByTag("WP_SION_PC1");
           object oWP2 = GetObjectByTag("WP_SION_PC2");
           object oWP3 = GetObjectByTag("WP_SION_PC3");
           AssignCommand(oPC, ActionForceMoveToLocation(GetLocation(oWP1)));

           vector vPos = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_pc_look")) );
           AssignCommand(oPC, ActionDoCommand(SetFacingPoint(vPos)));

           AssignCommand(oPC, SetLockOrientationInDialog(oPC, TRUE));
           DelayCommand(0.1, AssignCommand(oKreia, ActionForceMoveToLocation(GetLocation(oWP2))));
           DelayCommand(0.1, AssignCommand(oAtton, ActionForceMoveToLocation(GetLocation(oWP3))));
       }
       break;

       case 1:
           AssignCommand(oPC, ActionWait(1.8));
           AssignCommand(oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_HEAD_TURN_LEFT ));
       break;

       case 2: {
           AssignCommand(oPC,    ClearAllActions());
           AssignCommand(oKreia, ClearAllActions());
           AssignCommand(oAtton, ClearAllActions());

           AssignCommand(oPC, SetLockOrientationInDialog(oPC, FALSE));

           vector vFace1 = GetPositionFromLocation(GetLocation(oSion));
           AssignCommand(oPC,    ActionDoCommand(SetFacingPoint(vFace1)));
           AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace1)));

           DelayCommand(0.5, AssignCommand(oAtton, ActionDoCommand(SetFacingPoint(vFace1))));
       }
       break;

       case 3:
       break;

       case 4: {
           effect eSlow = EffectMovementSpeedDecrease(50);
           AssignCommand(oSion, ClearAllActions());
           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSlow, oSion, 4.0);
           AssignCommand(oSion, ActionForceMoveToObject(GetObjectByTag("WP_SION_2")));
       }
       break;

       case 5: {
           AssignCommand(oKreia, ClearAllActions());
           AurPostString("Kreia flourish.", 5, 12, 10.0);

           vector vFace2 = GetPositionFromLocation(GetLocation(oPC));
           AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace2)));

           AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
           AssignCommand(oKreia, CreatureFlourishWeapon(oKreia));
       }
       break;

       case 6:
           AurPostString("Kreia runs first WP.", 5, 14, 10.0);
           AssignCommand(oKreia, ClearAllActions());
           AssignCommand(oKreia, ActionForceMoveToObject(GetObjectByTag("WP_kreia_leave_1"), TRUE));
       break;

       case 7:
           AssignCommand(oKreia, ClearAllActions());
           AssignCommand(oKreia, ActionForceMoveToObject(GetObjectByTag("WP_kreia_leave_2"), TRUE));
       break;

       case 8: {
           object oDoor = GetObjectByTag("kreia_sion_door");
           if (GetIsObjectValid(oDoor)) {
               AssignCommand(oDoor, ActionCloseDoor(oDoor));
               AssignCommand(oDoor, SetLocked(oDoor, TRUE));
           }
       }
       break;

       case 9: {
           AssignCommand(oKreia, ClearAllActions());

           vector vFace3 = GetPositionFromLocation(GetLocation(oPC));
           AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace3)));

           AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
       }
       break;

       case 10: {
           object oKreiaCheck = GetObjectByTag("kreia");
           if (GetIsObjectValid(oKreiaCheck)) {
               AurPostString("Kreia removed from party.", 5, 10, 10.0);
               RemovePartyMember(NPC_KREIA);
           }
       }
       break;

       case 11:
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON2, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON2, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionEquipItem( CreateItemOnObject("w_melee_06", oKreia, 1, TRUE), INVENTORY_SLOT_RIGHTWEAPON, TRUE) );
       break;

       case 12: {
           object oSword = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oKreia);
           DestroyObject(oSword);
       }
       break;
   }
}

 

// ST: a_sion_cut2.nss (153HAR_s.rim)

void main() {
   object oSion = GetObjectByTag("DarthSion");
   object oKreia = GetObjectByTag("kreia");
   object oAtton = GetObjectByTag("atton");

   if (!GetIsObjectValid(oSion) || !GetIsObjectValid(oKreia) || !GetIsObjectValid(oAtton)) {
       AurPostString("No Darth Sion and/or Kreia, don't bother with the rest of the cut scene", 5, 7, 10.0);
       return;
   }

   int nParam = GetScriptParameter(1);
   switch (nParam) {
       case 0: {
           AssignCommand(oKreia, ClearAllActions());
           AssignCommand(oKreia, ActionJumpToLocation( GetLocation(GetObjectByTag("WP_kreia_start")) ));

           vector vFace1 = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_fight_kreia")) );
           AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace1)));

           AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
       }
       break;

       case 1: {
               effect eSlow = EffectMovementSpeedDecrease(50);
               ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSlow, oSion, 15.0);

               AssignCommand(oSion, ClearAllActions());
               AssignCommand(oSion, ActionForceMoveToLocation( GetLocation(GetObjectByTag("WP_fight_sion"))) );

               vector vFace2 = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_sion_left") ));
               AssignCommand(oSion, ActionDoCommand(SetFacingPoint(vFace2)));

               AssignCommand(oSion, SetLockOrientationInDialog(oSion, TRUE));
       }
       break;

       case 2: {
           SetFakeCombatState(oKreia, TRUE);

           vector vSion1 = GetPositionFromLocation(GetLocation(oSion));
           AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vSion1)));

           AssignCommand(oKreia, ActionPlayAnimation(10173));
           AssignCommand(oKreia, ActionPlayAnimation(ANIMATION_LOOPING_READY, 1.0, -1.0));
           AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
           AssignCommand(oKreia, CreatureFlourishWeapon(oKreia));
       }
       break;

       case 3: {
           AssignCommand(oKreia, ClearAllActions());
           AssignCommand(oKreia, ActionForceMoveToLocation( GetLocation(GetObjectByTag("WP_fight_kreia")) ));

           vector vSion2 = GetPositionFromLocation(GetLocation(oSion));
           AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vSion2)));

           AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
       }
       break;

       case 4:
           AssignCommand(oSion, CreatureFlourishWeapon(oSion));
       break;

       case 5:
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF) ));
           ChangeObjectAppearance(oKreia, 627);
       break;

       case 6: {
           vector vFace3 = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_sion_right")) );
           AssignCommand(oSion, ActionDoCommand(SetFacingPoint(vFace3)));
           AssignCommand(oSion, SetLockOrientationInDialog(oSion, TRUE));
       }
       break;

       case 7: {
           vector vDoor = GetPositionFromLocation( GetLocation(GetObjectByTag("kreia_sion_door")) );
           AssignCommand(oSion, ActionDoCommand(SetFacingPoint(vDoor)));
           AssignCommand(oSion, SetLockOrientationInDialog(oSion, TRUE));
       }
       break;

       case 8:
           AssignCommand(oAtton, ClearAllActions());
           AssignCommand(oAtton, ActionForceMoveToObject(GetFirstPC(), TRUE));
       break;

       case 9: {
               object oSword = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oKreia);
               DestroyObject(oSword);
       }
       break;

       case 10:
       break;

       case 11:
           AssignCommand(oSion, ClearAllEffects());
       break;

       case 12:
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON2, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON2, OBJECT_SELF) ));
           AssignCommand(oKreia, ActionEquipItem( CreateItemOnObject("w_melee_06", oKreia, 1, TRUE), INVENTORY_SLOT_RIGHTWEAPON, TRUE) );
       break;
   }
}

Link to comment
Share on other sites

  • 1 month later...
Now after installing 1.4.2.10 it won`t run at all.

1.5 Update 2 (I think), jdk6 beta2, don`t worked propelry either, but at least I`ve seen DeNCS window when using them.

 

Any idea how to fix this problem ?

 

Unfortunately not. I'm not even a big fan of Java for numerous reasons beyond measure.

Link to comment
Share on other sites

tk not all scripts are in the library I have found 5-10 alone that either are not there or the compare failed also it is a good tool if you make a script and accidently lose your nss file you can recover it instead of rebuilding it in case you forgot how you did it :-)

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

This is really starting to annoy me.

 

I am using Kotor Tool v1.0.2210.16738 (2006-1-19 12:38)

 

I have DeNCS.jar & nwscript.nss in my Kotor directory

 

My nwnnsscomp.exe was created on March 16 2005

 

I first downloaded jdk-6-beta2-windows-i586.exe from

http://java.sun.com/javase/downloads/ea.jsp

 

I have also downloaded jdk-6-rc-bin-b92-windows-i586-20_jul_2006.exe from

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

 

I have no problem opening DeNCS.jar. When I try decompile a script I get the right hand pane that should show the decompiled script but no actual script. If I right click in this pane I will get the pop command "View Byte Code" but nothing happens.

 

I am getting sick and tired off not being able decompile scripts and having to ask other members to fix files so that I can merge mods.

Link to comment
Share on other sites

I am getting sick and tired off not being able decompile scripts and having to ask other members to fix files so that I can merge mods.

Why would you need to decompile mod scripts?

 

With the exception of a few early KotOR I mods, most modders have decompiled source scripts packaged with their mods. So the tough part is combining two modders changes and compiling the script. You would not need a decompiler for that in any case. :confused:

Link to comment
Share on other sites

Why would you need to decompile mod scripts?

 

With the exception of a few early KotOR I mods, most modders have decompiled source scripts packaged with their mods. So the tough part is combining two modders changes and compiling the script. You would not need a decompiler for that in any case. :confused:

 

Because I am a moron who thought that you had to decompile nss files. Instead of opening nss files with notepad or wordpad. :o:(

Link to comment
Share on other sites

  • 5 months later...
  • 11 months later...

Yep! I'm trying to use DeNCS right now, but I just can't open it. The path for the .jar is

C:\Program Files\KotorModding\Kotor Tool\DeNCS.jar

and the one for java is

C:\Program Files\Java\jre1.6.0_03\bin\java.exe

 

I tried several commands after reading this topic but none of them seem to work. The last one I tried was

"C:\Program Files\Java\jre1.6.0_03\bin\java.exe" -jar dencs.jar

but it failed... If I remove the quotes, Windows just tells me he cannot find "C:\Program", stupide thing...

 

I could use some help '^^ Thanks in advance.

 

Edit: Just had to use the complete path for DeNCS. So the complete command was

"C:\Program Files\Java\jre1.6.0_03\bin\java.exe" -jar "C:\Program Files\KotorModding\Kotor Tool\DeNCS.jar"

 

But after selecting the output directory I get this:

dencszz0.png

Do I really have to put a nwscript.nss in the java directory?! The readme says it should goes in the Kotor Tool directory...

 

Edit#2: I finally tried to put the .nss in the java directory. Now it asks for

C:\Program Files\Java\jre1.6.0_03\bin\nwnnsscomp.exe

that's crazy /:| Does anybody know anything to do about this?

Link to comment
Share on other sites

  • 2 weeks later...

Archived

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

×
×
  • Create New...