Fandom

Need For Madness Wiki

Hacking Scripts

290pages on
this wiki
Add New Page
Comments4 Share

Also known as Java Hacking or Java Editing, this kind of NFM1/2 hacking is difficult in a way because it solely depends on what the editor is doing. Need For Madness is ran by several CLASS files, containing scripts and text for ALL of the features used. These CLASS files need to be decompiled to a JAVA file before editing.

Attention Warning: It is essential that the user always keeps at least one backup file in case the hacking goes wrong. Failure to do so will often result in irreversible errors and problems.

Ingredients for 'Java Hacking'

Anything like name changing or statistics and physics edits requires:

  • A Java Development Kit Unit.
  • A Java Decompiler (either Jad or Cavaj works)
  • An Intergrated Development Environment program (e.g. NetBeans, BlueJ)
  • A Brain
  • WinRAR

Decompiling CLASS Files

First, you must have WinRAR downloaded. (if not, search it on Google) Then open WinRAR and look for your Need For Madness folder, (wherever you've downloaded it to) then an Executable Jar File, will be visible. (mad.jar for NFM1, madness.jar for NFM2) Open the Jar file and a couple of CLASS files should pop up. Hold Ctrl and click on ALL of the CLASS files. Once done, press Ctrl+C (Copy). Create a New Folder anywhere, open it up and paste (Ctrl+V) the CLASS files in there. You are now ready to decompile the files.

Another method (WinRAR must be downloaded as well) is to look into your Need For Madness folder, find the Jar file with it, right click it then Extract it. A bunch of CLASS files will appear.

Decompiling with Jad

Download Jad here.

Try watching this video here.

Decompiling with Cavaj

Watch this video here for the tutorial. It also has the download link available in the description.

Errors

Upon the attemption of Java Editing, noticeable errors appear in certain files as the NFM1 and NFM2 files have errors in them, and are usually marked with an exclamation mark dependant on the program used.

Even with the fixed Java files, a common situation occurs. When you replace the new CLASS file from the old one and try to play the game, an error will occur, rendereing it unplayable. A common solution to this is to uninstall Java then re-install Java with the latest version.

Credit goes to WEST No.5 at AIM Games for the fixed Java files:

Fixed NFM1 Java: http://www.mediafire.com/?6rrgotw307ni9

  • Gamesparker and Madness have errors in them.

Fixed NFM2 Java: http://www.mediafire.com/?ksab8u95hy1q7

  • Gamesparker, Madness and xtGraphics have errors in them.
    • NOTE: The fixed xtGraphics will cause more than one car of the same type appearing in a game.
    • Also, when using the fixed Gamesparker, ALL of the cars and stages will be unlocked from the start, even if 'return 17;' value is changed.

Set-up

With NetBeans

Try watching this video here

With BlueJ

Have BlueJ installed, not the latest version, but version 3.0.4. [ Older Versions ] Open up BlueJ, go on File > New Project. In your NFM folder or anywhere you want to save it, make a Project Folder. Then close BlueJ. Go to the Project folder manually with Windows Explorer or something similar. Inside the Project folder, you should see two files: 'package' and README. Do not touch these just yet.

If you have decompiled the CLASS files to a JAVA file and kept them in a folder, copy the JAVA files then paste them to your Project Folder. After that, click on the 'package' icon and BlueJ should load up. When BlueJ is loaded, you should see lots of blocks connected by arrows and lines. If there is an exclamation mark on the box, then the file has an error.

Before compiling everything, make sure there are no CLASS files in the Project Folder, or else the JAVA files won't compile. Gamesparker is an 'applet' that can be run. Just click on it then press 'Compile'. If it works without detecting errors, then that is fine. Go to your NFM Folder then copy the following folders; data/graphics, sounds, stages/tracks and music. Then paste them into your Project Folder. Now go back to BlueJ, right click on Gamesparker then press 'run Applet'. (This will not appear unless all of the files have been compiled) Here, you can see your hacking progress and notice any bugs.

If you are happy with your changes, compile everything first. Copy a CLASS file you want to update, open WinRAR, head to your Need For Madness folder then open up the Jar File. Finally, paste the updated CLASS file and replace the old file with the new one. Then load up your Need For Madness and see if it works. If the screen says 'Error. Click for details', see the Errors section of this topic for a potential solution.


Try watching this video here


Available Java Hacks

Double click on the JAVA file you wish to hack, a large page of coding and scripts will appear. Most of the hacks here can be done in NFM2 as well, just with some small differences. NOTE: These hacks are NOT for NFMM, because the scripting is more difficult and different compared to the first and second NFM installments.

Changing Car Starting Arrangement

In xtGraphics.java, look for this:

int xstart[] = {


};

int zstart[] = {

};

There should be some values here that define where the cars start. Editors can compare this to coding a car but with no Y-Axis. Play around with these values so you can get an idea on where the cars will start.

Car Piece Limit

If a car has gone 'over the limit', missing polygons will occur.

In ContO.java, look for this:

p = new Plane[120]

Change that value to a higher number, like 10000 for instance. Save, compile then add it to your NFM.

Stage Limit

If you have reached the limit of track pieces in a stage, an Error will appear.

In Trackers.java, you should see some values that are the same, increase those values to a higher number. This will slightly increase the stage limit.

In Gamesparker.java, look for this:

ContO aconto1[] = new ContO[330]; Change the new ContO[330] to a higher number.

Changing Probability

This is the probability that a certain car will appear in a game, the lower the value, the better chance it has in appearing.

in xtGraphics, look for this:

   float proba[] = {
       0.6F, 0.7F, 0.4F, 0.3F, 0.8F, 0, 0.3F, 0.3F, 0.3F, 0.1F, 
       0.1F, 0.5F, 0, 0, 0, 0

There are 16 values in NFM2 (10 in NFM1) and are in the order of the car selection. Remember, the lower the value, the better chance it has of appearing in a game. (As such, Mighty Eight, M A S H E E N, Radical One and DR Monstaa all have the highest chances of appearing in a game)

Hacking Statistics and Physics for Cars

You need to have the fixed Madness.java file before continuing, otherwise the files will not compile.

To hack the statistics of a car, visit one of the articles below for information:

To hack the physics of a car, the editor should take note of the following variables:

   float drag[] = {
       0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 
       0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 0.5F
   };

Attention Warning: This should not be touched in any way!

Qleft yeah because it was wrong to have it changable in the first place... the coefficiant of drag should be constant for all..

0.5 and keep it that way...
- Omar Waly, commenting about drag

Qright
   float bounce[] = {
       1.2F, 1.05F, 1.3F, 1.15F, 1.3F, 1.2F, 1.15F, 1.1F, 1.2F, 1.1F, 
       1.15F, 0.8F, 1.05F, 0.8F, 1.1F, 1.15F
   };

Self Explanatory, this is how 'bouncy' a car is. Notice how Wow Caninaro and Nimi both have the highest bounce value, with 1.3F

   int lift[] = {
       0, 30, 0, 20, 0, 30, 0, 0, 20, 0, 
       0, 0, 10, 0, 30, 0
   };

Basically, this is the 'Lifts Others' variable, meaning how high a car can lift another car off the ground.

   int revlift[] = {
       0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 
       0, 0, 0, 0, 0, 32
   };

The opposite of 'Lifts Others', this is perhaps 'Gets Lifted', meaning when a car hits another car, it will determine how high it will get lifted off the ground during collision.

THIS ARTICLE WILL BE UPDATED SOON

Need for Madness Flying Cars Hack00:58

Need for Madness Flying Cars Hack

An example of a Java Hack used

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki