I decided to make a car towing mod. I have some results, but this is not a simple mod.
I changed the source code of the game (decompiled, modified, compiled) and wrote a mod for lua.
Stopped at the current state of the mod. (There is no point in continuing if the developers do not add the necessary code for the mod to the game and decompilation does not perfectly restore the code, so the decompiled files crash the game (I think the deadlock occurs))
I added the following code to the game source code:
1. OnVehicleUpdate event - trigger when vehicle update
2. Change vehicle position (like setDebugZ(float))
public void setDebugXYZ(float x, float y, float z) {
this.tempTransform.set(this.jniTransform);
this.tempTransform.origin.x = x - WorldSimulation.instance.offsetX;
this.tempTransform.origin.y = z ;
this.tempTransform.origin.z = y - WorldSimulation.instance.offsetY;
setWorldTransform(this.tempTransform);
}
This is not real towing. I'm teleporting transport now.
Joints are needed for real towing. Now, as I understand it, the developers use the modified Bullet engine, and there are no joints in engine java api now.
What I want to achieve with this functionality:
1. Towing a car with a correct turn and physics similar to realism (imitation)
2. For towing you need a special device or a special car
3. Towing affects the movement of the car. (Depending on the weight of the towed vehicle)
What I've done:
How can I submit a request to developers for the methods I need?
Write what you think about the mod idea. If there are a lot of people interested, perhaps the developers will implement the required functionality.