So for the people that might be out there who ask themselves how to make your own convoi that follows you, you have came to the right place!
Engine
When coding the engine, you need to do two things:
1. Set the input to throttle
2. enter the code in the activationgroup clamp01((TargetDistance > 22) - (TargetDistance >9999999999))
Airbrake
The airbrake is important to brake the car, so it doesn't ram you.
Step 1. put the code Activate8
into the input section
Step 2. put the code clamp01((TargetDistance > 0) - (TargetDistance >22))
into the activationGroup section.
Auto steering
This is the part that makes the car go after you.
Step 1. put 0.1
into max
and put -0.1
into min
Step 2. put clamp(deltaangle(0,atan(((sin((RollAngle + 0)) * sin(-PitchAngle) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * sin(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))) * cos((TargetHeading - Heading + rate(TargetHeading) * TargetDistance/1000))) + cos((RollAngle + 0)) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * sin(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))) * sin((TargetHeading - Heading + rate(TargetHeading) * TargetDistance/1000))) + cos(-PitchAngle) * (-sin((RollAngle + 0))) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * cos(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))))) - ((pingpong(Time*1000,1) - 0.5))) / ((cos(-PitchAngle) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * sin(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))) * cos((TargetHeading - Heading + rate(TargetHeading) * TargetDistance/1000))) + sin(-PitchAngle) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * cos(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))))) - ((pingpong(Time*1000,1) - 0.5)))) + ((((cos(-PitchAngle) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * sin(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))) * cos((TargetHeading - Heading + rate(TargetHeading) * TargetDistance/1000))) + sin(-PitchAngle) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * cos(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))))) - ((pingpong(Time*1000,1) - 0.5))) < 0) ? ((((sin((RollAngle + 0)) * sin(-PitchAngle) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * sin(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))) * cos((TargetHeading - Heading + rate(TargetHeading) * TargetDistance/1000))) + cos((RollAngle + 0)) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * sin(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))) * sin((TargetHeading - Heading + rate(TargetHeading) * TargetDistance/1000))) + cos(-PitchAngle) * (-sin((RollAngle + 0))) * ((TargetDistance + rate(TargetDistance) * TargetDistance/1000) * cos(((TargetElevation + 90 + rate(TargetElevation) * TargetDistance/1000) + (asin((cos(TargetElevation + (rate(TargetElevation)) * TargetDistance/1000) * (TargetDistance + rate(TargetDistance)*TargetDistance/1000) * 9.81)/(1000 * 1000))/2))))) - ((pingpong(Time*1000,1) - 0.5)))>0) ? 180 : -180) : 0)),-25,25)
into the Input section
If you have all the steps correct, it should work correctly.
Any questions about it in the comments
here is the truck, if the steering code doesnt work, i think it might help XD Ai truck (Zis-5)
It seems the code, is a bit too long for the steering XD
putting it into the comments doesnt work, becouse it exeeds the 4000 character limit, imma post a link to the truck in a pinned comment soon
Can he make one of these for planes?
This is pretty awesome.
@winterro thank you sir
Cool!
@FaLLin1 yeah, it is possible, il figure that out for ya
is it possible for planes?
Thats pretty sweet, good innovation.
Step 1: Code
Step 2: Code
Step 3:
Codecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecodecode