Euro Truck Simulator 2 Autopilot Mod
There's not really a reliable way to do this. 1) You can only get positions of AI vehicles by reading from unknown memory locations, which may change from one game version to another 2) You could analyse each frame, but I don't know how reliable that is. This might also cause a performance hit 3) You'd have to write a device driver that controls the throttle. This might disable your pedals/trigger button (on controllers)/whatever other input device you're using. There's workarounds for that, but they might be messy.
Euro Truck Simulator 2 Mods. LS19 PROVENCE V1.0.1.0. WTS CEZ GORJANCE 2019 V1.0. RABE SKE 400 & KVERNELAND ACCORD.
This could be done by implementing how the AI works in-game to your own truck. I have a simpler solution: pick out any AI vehicle and attach the in-game camera to that. I obviously don't know how the engine works, but I doubt it'd be as easy as 'apply AI logic to player's truck'.
For one, the AI doesn't have physics as much as your truck does. (ninja edit: you could of course make a clone of the player's truck and use that as an AI vehicle. That way it'll look like the player is in their own truck) I am not a programmer and when I think about coding I think it in equations that are chained together.
Not really, sorry:P if you wanna get started, look at something (relatively) simple as Javascript. Don't dive head-first into C or C++. Been there, done that. If you wanna make adaptive cruise control in-game, you'd have to take the location, speed and direction of travel of every AI vehicle in front 1 of your truck and determine how quickly they're approaching you (or going away from you). You wanna set a minimum following distance in seconds 2. Combining these two together, you can determine the speed you wanna be going at in real-time and feed this information into the throttle and brake system(s) of the truck. If you wanna go fully autonomous, you'd have to feed map information (i.e.
Where the lanes are, where the lanes go, destination in the GPS) into the throttle, brake and steering systems of the truck (cause you wanna slow down for turns, right?). 1) More like but a bigger half-circle. 2) Say you wanna be 3s behind the guy in front of you. The distance this equates to depends on the speed you're going.
How do you think, would it be a great idea to add an autopilot feature to the game? For a long time now I was imagining a so called Passenger simulation, where I can switch my camera to the second seat (or even in the back of the cabin) and just enjoy the scenary outside without driving off the road, cause the autopilot handles this for me. And with the new 'Vive la France!' DLC I want this option even more, I want to sit in the passenger seat and just look around in these beautiful forests. I know, there is not much driving in this thing, but, hey, after a hundred hours of playing normally can I cheat a bit?) For example, this feature can unlock after a certain level, or maybe you will be able to be a passenger only in free roam, just set a waypoint, and autopilot would drive you there nice and easy. Also more cameras in the cabin would be great, like when you stop to rest, you switch to your bed camera, turn on some lights inside, plenty of things I can think of!) So, what do you think?).