Nod Engine SDK => Scripting and Modifying => Topic started by: Question on 2018-02-10, 11:58:16

Title: Issues with modifying discipline.java
Post by: Question on 2018-02-10, 11:58:16
I installed the nod SDK which comes with .java files, and I tried modifying discipline.java to change durations of disciplines.

I compiled it into a .class file, but when i put the file into the codex.nob, no disciplines show up ingame at all. E.G. If i create a caitiff MP character, the discipline page is completely blank.

Im using winrar and selected "store" which is 0% compression, and i can see in codex.nob that discipline.class is 9,664 bytes for both "Size" and "packed size".

Is there something else i need to do to get it to work? If i extract the discipline.class file from a vanilla codex.nob and move it over, it works, but noot if i use this modded discipline.class.

I did notice that in discipline.java, there is :

   protected   static final int      CONSOLE_FLAG_DISCIPLINECAST         = 0x8;
   protected   static final int      CONSOLE_FLAG_DISCIPLINERECAST      = 0x8;
   protected   static final int      CONSOLE_FLAG_DISCIPLINEFIZZLE      = 0x8;

But after compiling, the .class file shows that all the 0x8 has been changed to 8. Every compiler i have tried, including the eclipse compiler, has done this. I'm not sure if this is normal or whether it is causing the game to fail to read the discipline.class file properly...
Title: Re: Issues with modifying discipline.java
Post by: Javokis on 2018-02-10, 12:48:49
VTMR will only read .class files formatted to version 1.1 in the compiler. As for making .nob files, I typically have to use an older version of 7zip [version 4.65] because all newer 7zip versions use an incompatible security encryption that I can't seem to turn off. Though I have heard from mod authors that winrar works fine.

When I made the eclipse workshop and eclipse download available I recently made sure that the correct package compatible with 1.1 library was included [JRE 6], which is the last JRE that includes now deprecated commands that VTMR relies on. Make sure your project is setup to format to version 1.1 class compilation and that the JRE library is setup to run version 6u45.

Also note that it's never advised to modify discipline.java and include modified discipline.class into your mod as this causes a bug in the game engine to stop calculating sanity check protocols. This can cause disciplines to [double tap] when cast, which causes bad data to fill into memory. Best thing to do is create a dependent script derived from discipline.class with overloads. This will make for the most stable modification to disciplines.
Title: Re: Issues with modifying discipline.java
Post by: Question on 2018-02-12, 03:25:34
Winrar definately works fine, as I have made changes to resources.nob and i can put the vanilla disciplines.java back into codex.nob with no issues.

What do you mean by "version 1.1"? The program im using (DrJava) only includes an option for "Eclipse 4.5".

All I wanted to do was change some durations in disciplines.class. The game cant handle that without freaking out? How did the devs even make any changes in the first place then?
Title: Re: Issues with modifying discipline.java
Post by: Javokis on 2018-02-12, 08:32:22
You seem to think that the public SDK is actually the developer's licensed tools. They are not the same. The public SDK is for modders and not the original developer's tools. This becomes even more evident when you try to use Embrace to edit Nihilistic's maps and get strange graphical artifacts and sector errors on certain maps you edit. The SDK is NOT the developer's licensed tools. The SDK is a public release of modified tools for modders. Not the same.



See image attachment about how compiler version is set for eclipse: