VStanced/mods
Submit a mod
Mods Guides Forum Submit a mod Log in Register

Scripts: Engine/parts kits

By Holy_Shit_Man Jan 16, 2015 4.9k views

Hello everyone. Some of you want to know how to make a engine kit also known as engine pack.

I’ll show you the faster method. I don’t think that you wanna to write whole java script at your own.

  1. Take a engine kit .java of other engine. Let me take kit from Boss’ LS3.

package java.game.parts.engines.LS3;

import java.util.;
import java.util.resource.
;
import java.game.;
import java.game.parts.
;

public class LS3_engine_kit extends Set
{
public LS3_engine_kit( int id )
{
super( id );
name = “LS3 General Motors stock LS3 engine kit”;
description = “Stock NA LS3 engine.”;
}

public void build( Inventory inv )
{
	inv.insertItem( parts.engines.LS3:0x000001A8r ); // block
	inv.insertItem( parts.engines.LS3:0x000001B4r ); // crankshaft
	inv.insertItem( parts.engines.LS3:0x000001B8r ); // crankshaft bearing
	inv.insertItem( parts.engines.LS3:0x000001ECr ); // connecting rods
	inv.insertItem( parts.engines.LS3:0x000001E4r ); // pistons
	inv.insertItem( parts.engines.LS3:0x000001D4r ); // flywheel
	inv.insertItem( parts.engines.LS3:0x000001B0r ); // clutch
	inv.insertItem( parts.engines.LS3:0x000011A0r ); // transmission
	inv.insertItem( parts.engines.LS3:0x000001E0r ); // oil pan
	inv.insertItem( parts.engines.LS3:0x000001ACr ); // camshaft
	inv.insertItem( parts.engines.LS3:0x000001C4r ); // cylinder head L
	inv.insertItem( parts.engines.LS3:0x000001C8r ); // cylinder head R
	inv.insertItem( parts.engines.LS3:0x000001BCr ); // valve cover L
	inv.insertItem( parts.engines.LS3:0x000001C0r ); // valve cover R
	inv.insertItem( parts.engines.LS3:0x000001F8r ); // ignition L
	inv.insertItem( parts.engines.LS3:0x000001FCr ); // ignition R
	inv.insertItem( parts.engines.LS3:0x000021CCr ); // exhaust L
	inv.insertItem( parts.engines.LS3:0x000021D0r ); // exhaust R
	inv.insertItem( parts.engines.LS3:0x000031DCr ); // intake
	inv.insertItem( parts.engines.LS3:0x000001A4r ); // air filter
	inv.insertItem( parts.engines.LS3:0x000021D8r ); // fuel rail
	inv.insertItem( parts.engines.LS3:0x000001F0r ); // starter
	inv.insertItem( parts.engines.LS3:0x000001F4r ); // water pump
	inv.insertItem( parts.engines.LS3:0x000001E8r ); // radiator
}

}

  1. Decode your target engine’s RPK. Skip it, if you already got working RDB (be sure it’s really working).
    If you don’t know how, search for it at your own. Or try this.

I don’t think that you need over 5k lines of text as example. I’ll use Harrisson’s Devil’s V8.

  1. Now, it’s the coding part:

a)
package java.game.parts.engines.LS3;
Shows which package is that. Package is a RPK and the folder (I believe). So, if we are going to put it into DevilsV8.rpk we need to change LS3 to DevilsV8.

b)
public class LS3_engine_kit extends Set
and
public LS3_engine_kit( int id )
You need to replace LS3_engine_kit with name of java/class file, f.ex.: i_love_kits_it_s_a_random_name – without .java or .class postfix.
Note that there is space after public class, but not after public.

c)
name = “LS3 General Motors stock LS3 engine kit“;
description = “Stock NA LS3 engine.“;

Determines the name and description. Change it to whatever you want, just keep in mind the fact, that you need to know what it is 😛

D)
inv.insertItem( parts.engines.LS3:0x000001A8r ); // block
Determines part and package that contains it. So, we need to change LS3 to DevilsV8 and 0x000001A8 to typeID of the part that you want. Actually, it needs to be a typeID of the script of it, so it’ll be this value

<FILE 00000076.res >
typeof 8
superid 0x0002025C
typeid 0x0000023F
alias DevilsV8_block_80mm
isparentcompatible 1.00
</FILE>
<FILE 00000076.rsd >
script partsenginesDevilsV8scriptsDevilsV8_block_80mm.class
native part partsenginesDevilsV8scriptsDevilsV8_block_80mm.cfg
lod_amp 4.000
</FILE>

So, replace it with the one in kit’s java. Attention!!! Keep an eye on the r after typeIDs
EXAMPLE:

From: inv.insertItem( parts.engines.LS3:0x000001A8r
To: inv.insertItem( parts.engines.DevilsV8:0x0000023Fr

Do the same thing with rest of parts. Pay attention on order you paste the parts. It needs to go as you build engine part by part (so the block needs to be before cylinder head).
If you run out of lines, feel free to duplicate them.

If you made list of parts, and other things written in 2. point, you can save the java on your desktop. Or not, check all lines, then save 😉

  1. RDB part.

Open decode RPK which contains engine kit. I’ll use LS3 here too. You can also use code I’ve pasted down here (not recommended, since BBCode like to f8ck up some codes. At least for me)

</FILE>
<FILE 00000024.res >
typeof 8
superid 0x0002F23C
typeid 0x0000ACDC
alias LS3_engine_kit_4
isparentcompatible 1.00
</FILE>
<FILE 00000024.rsd >
script partsenginesLS3scriptsLS3_engine_kit_4.class
</FILE>

Change typeID to something that does NOT exist in your target engine’s RDB. Note that you can change the last four character. You can use 0 to 9 and A to F – hexadecimals. Then, change script’s destination

  • the place that .class file will be placed. Notice the fact, that it doesn’t need to be actual .class file path. But, in same folder that .class “is” you need to make folder called SRC, and paste the saved .java file into it.
    EXAMPLE:

    From: script partsenginesLS3scriptsLS3_engine_kit_4.class
    To: script partsenginesDevilsV8scriptsi_love_kits_it_s_a_random_name.class
    And in enginesDevilsV8scriptssrc is the i_love_kits_it_s_a_random_name.java file

If you have done everything, go to target’s RDB, check if you done any changes (if yes, undo them – just to make sure that you haven’t break anything accidentally.) and paste edited RDB entry at the end. Save.

  1. Convert your RDB to RPK. If you don’t know how, search for it at your own. Or try this.

  2. Go in game, and check is there a kit that you wanted to do.

  3. If yes, you can be proud of it. If no, check all your files and error.log. If it’s saying about something wrong in some file’s line, check the java you wrote. If crashes without anything in error.log, it’s RPK’s fault. Check it.

If nothing helps, write it down here in comments or PM me with ENGINE KIT HELP!!! as subject 😉 However, I hope that you made/will make this.

right


No file was attached to this page.

Garage talk

7 comments
  1. Bigg_Boss93

    Good job KJ!

  2. mindeliszz

    did you mentioned that public class name must be the same as the the java file name? 😃

  3. Holy_Shit_Man

    Fixed.

  4. BLiTZ

    “Simple” tutorial

  5. Holy_Shit_Man

    You know, there’s harder way.

  6. Snowfox

    This already confuses me 😃 but good work!

  7. tifa

    It gave me error wrong game type rpk please help me thanks in advance

Leave a comment

Members can comment. Log in or create an account.