@name Steering [PcmciaKai]
@inputs [Controller Hl Hr]:wirelink Left Right
@outputs Norm Speed Lock Steer
if (first() | dupefinished()) {
runOnTick(1)
timer("init",100)
Hl["Constant",number] = Hr["Constant",number] = 1
Hl["Damping",number] = Hr["Damping",number] = 1
Hl["Length",number] = Hr["Length",number] = 1
Norm = 33.583 # Length of the hydraulics that they need to be centered (use accurate values)
Speed = 0.4
Lock = 21.4 # Hydraulic length to add on steering, basically defining a steering lock
}
elseif (clk("init")) {
Hl["Constant",number] = Hr["Constant",number] = 50000
Hl["Damping",number] = Hr["Damping",number] = 1000
}
#Steer = round(clamp(entity():isConstrainedTo():toLocal(Controller["Entity",entity]:driver():eyeAngles()):yaw()+90,-90,90))*(Lock/90) # Mouse steering BETA
Steer += clamp((Left-Right)*Lock-Steer,-Speed,Speed)
Hl["Length",number] = Norm-Steer
Hr["Length",number] = Norm+Steer