Pavement Drive Assist

by Arcitos

Introduces a driver assistance system that autonomously follows paved roads, while maintaining a preset cruise speed if desired.

Utilities
4 years ago
0.14 - 0.18
182

g Is version 2.1.4 for 0.16 following roads?

6 years ago

I can't get vehicles to follow surfaces.

The research appears correctly, so I researched it.
Tried turning off the research requirement.
Built concrete surface, just brick surfaces and even enabled Asphalt Roads and built a number of those surface types.
Removed Vehicle Snap mod, just in case.
The Console recognises Assist is enabled/disabled toggling the "I" key and a sound plays on pressing key.
"Control O" opens the Cruise control limit, so all in all things appear to be installed and working, but... vehicles approaching at any angle (tried the car and tank) don't divert to follow a paved surface.

Just wondered if anyone was having the same problem or if I'm doing something wrong?

6 years ago
(updated 6 years ago)

Yep, seems to be related to the 0.16 multiple passengers in vehicles feature ... removing the check for and player.vehicle.get_driver() == player on pda.lua Line #84 seems to work, but will be an issue in multiplayer games.

Edit, figured it out, the documenttation isnt clear, but you sometimes need get_driver().player instead of just get_driver(), maybe because that can return a LuaEntity, or a LuaPlayer:

if (player.vehicle ~= nil) and player.vehicle.valid and player.vehicle.type == "car" and vehicle_blacklist[player.vehicle.name] == nil and player.vehicle.get_driver() ~= nil and (player.vehicle.get_driver().player == player or player.vehicle.get_driver() == player) then

6 years ago

Yes, that seems to be it. The vehicle judders a bit lining up, but this may be due to Vehicle Snap still being enabled (? - I'll play around with it a bit more just to see), but the car definitely follows the path now. It also bleeps and the car stop when it has no more path left, so seems to be working now. Thanks bitbased.

Hopefully Arcitos can release an official fix. Thanks again Arcitos for the update.

6 years ago
(updated 6 years ago)

Ok, the issue is fixed in 2.1.5. I'm sorry, i tested the new code only in single player mode and assumed it would behave the same way in multiplayer. Which it obviously don't.

@Avalanch: The shaking of the vehicle is caused by vehicle snap. It aligns the vehicles orientation to the nearest snap angle, but pda will reset this alignment each tick to keep the vehicle on the road.

6 years ago

Yeah, working now officially Arcitos. Thank you :o) And no apologies necessary.

Weird thing is, even with Vehicle Snap removed completely, there's still a slight judder. I noticed earlier that with PDA removed, Vehicle Snap also has a judder, so... I have no idea what's happening there. It really doesn't bother me though, so don't worry about it. I just thought I'd mention it.

New response