I've noticed that people are still using props for steering wheels, or are using straight default holograms to do it. I can't stand this, so I wrote a bit of code that might inspire some people.
Code:
@name basic E2 Steering Wheel
@inputs Steering:entity
@persist Model:string Ratio Angle
interval(100)
Model="models/steeringwheels/truckwheel.mdl"
Ratio=5
if(first()){
holoCreate(1)
holoModel(1,Model)
holoPos(1,entity():toWorld(vec(0,0,10)))
holoParent(1,entity())
}
holoAng(1,entity():toWorld(ang(A,90,0)))
Angle=entity():isWeldedTo():angles():yaw()-Steering:angles():yaw()
I know it's dirty. Sue me.
The ratio value controls the angle amplification between the steering wheel and the steering master. Unless you use the wheels from the Steering Wheel Pack and a PHX bar for the steering master, you'll probably have to play with the angles a bit.
I don't know a whole lot about controlling hologram angles properly, so I couldn't quite figure out how to get the wheel at the proper angle, so users will have to set the angle manually by placing the E2. I wanted to have a steering wheel angle and depth adjuster, which would have been cool, but I just don't know enough yet. Enjoy.
Code:
@name basic E2 Steering Wheel
@inputs Steering:entity
@persist Model:string Ratio Angle
interval(20)
Model="models/steeringwheels/truckwheel.mdl"
Ratio=5
if(first()){
holoCreate(1)
holoModel(1,Model)
holoPos(1,entity():toWorld(vec(0,0,10)))
holoParent(1,entity())
}
holoAng(1,entity():toWorld(ang(90,Angle,0)))
Angle=entity():isWeldedTo():angles():yaw()+Steering:angles():yaw()
I fixed it, still no model shows. It's just a holocube, tried changing models, no effect. The code you wrote was kinda wrong, sure it was following the slave, but it was TILTING left and right(If you look to north) instead of just yawing(turning) if you know what i mean. Now i edited it so it turns to the slave correctly, so you can just place the chip on the dashboard.