Aiteron Posted September 1, 2020 Share Posted September 1, 2020 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. Massi, Geras, Kappatao and 1 other 4 Link to comment Share on other sites More sharing options...
Blake81 Posted September 1, 2020 Share Posted September 1, 2020 I'll say, this looks pretty solid, and yeah, it's something that should be on the Vanilla game. Maybe not with every car, but with specific tow trucks. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted September 1, 2020 Share Posted September 1, 2020 RJ set this up sometime last year, but we decided to hold off until it could be visually set up, in addition to tied with the physics system. So far, there’s just been no time to revisit it. Aiteron, trombonaught and Geras 1 2 Link to comment Share on other sites More sharing options...
Aiteron Posted September 2, 2020 Author Share Posted September 2, 2020 6 hours ago, EnigmaGrey said: RJ set this up sometime last year, but we decided to hold off until it could be visually set up, in addition to tied with the physics system. So far, there’s just been no time to revisit it. I understand you have other priorities now. Having studied the code, I was shocked! You've done an insane amount of work. I studied only a part of the code, but this is already tens of thousands of lines of code! I am amazed. I wish you a smooth transition to the new network code. question: what about the methods that i need for mods? can i expect them in the next updates and what is the best way to request new functionality for use in lua code? I tried to make a mod with minimal changes in the code. In the meantime, I'll switch to mods without changing the source code and try to extract everything I can. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted September 3, 2020 Share Posted September 3, 2020 On 9/2/2020 at 1:26 AM, Aiteron said: I understand you have other priorities now. Having studied the code, I was shocked! You've done an insane amount of work. I studied only a part of the code, but this is already tens of thousands of lines of code! I am amazed. I wish you a smooth transition to the new network code. question: what about the methods that i need for mods? can i expect them in the next updates and what is the best way to request new functionality for use in lua code? I tried to make a mod with minimal changes in the code. In the meantime, I'll switch to mods without changing the source code and try to extract everything I can. It’s possible they’ll be added, but there’s enough work involved that’d it’d be pretty much equivalent to implementing towing ourselves. For other things, post your requests here or make your own thread and we’ll keep an eye on it: Aiteron 1 Link to comment Share on other sites More sharing options...
Aiteron Posted September 19, 2020 Author Share Posted September 19, 2020 Towing car. Lua mod (alpha 1.0) Working on a car towing mod. I was able to move the car using lua code (math + physics + developer pain = this mod). Implemented the physics of towing with a tow rope. Video: https://youtu.be/hsXFA7XublU Arsenal26 1 Link to comment Share on other sites More sharing options...
trombonaught Posted September 20, 2020 Share Posted September 20, 2020 5 hours ago, Aiteron said: Towing car. Lua mod (alpha 1.0) Working on a car towing mod. I was able to move the car using lua code (math + physics + developer pain = this mod). Implemented the physics of towing with a tow rope. Video: https://youtu.be/hsXFA7XublU That's freaking amazing! Link to comment Share on other sites More sharing options...
Arsenal26 Posted September 23, 2020 Share Posted September 23, 2020 That looks pretty darn fluid to me... ESPECIALLY the part where you back up, and movement behaves accordingly as it would with slack given to the tow line... Then resuming again after you move far enough ahead making it taut before it affects the towed vehicle... When can we expect to be able to vacation with our RV's + Jeep in tow ??!!? Amazing job... Link to comment Share on other sites More sharing options...
Aiteron Posted September 24, 2020 Author Share Posted September 24, 2020 On 9/24/2020 at 4:06 AM, Arsenal26 said: That looks pretty darn fluid to me... ESPECIALLY the part where you back up, and movement behaves accordingly as it would with slack given to the tow line... Then resuming again after you move far enough ahead making it taut before it affects the towed vehicle... When can we expect to be able to vacation with our RV's + Jeep in tow ??!!? Amazing job... Main physics almost done. I also want to try to visually show the rope, but I need to check if this is possible. there are already several new features that are not shown in the video I think about in the next couple of weeks I will open the mod as an open beta. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now