Author Topic: Can someone tell me how to fix this?  (Read 483 times)

I wanted to have the jeep have car sounds, and it works. What I did was change the Train vehicle's models and sounds.
The only problem is, the script below does something to the wheels and either it
Does not steer
3 wheels steer, but one doesnt, creating this very odd drifting thing
No wheels appear at all
Can someone fix this? I can't remove it and don't know how to edit it.

Code: [Select]
function Train::onadd(%this, %obj)
{

parent::onadd(%this,%obj);
//Switched to first position so the vehicle is created before it's checked on
%obj.setWheelSteering(0,0);
%obj.setWheelSteering(1,0);
%obj.setWheelSteering(2,0);
%obj.setWheelSteering(3,0);
%obj.setWheelSteering(4,0);

%obj.setWheelPowered(1,True);
%obj.setWheelPowered(2,True);
%obj.setWheelPowered(3,True);
%obj.setWheelPowered(4,True);


TrainSpeedCheck(%this, %obj);

TrainSmokeCheck(%obj); 

//Traintire.radius=0.65; // Messes others players
//Trainbacktire.radius=0.55; // up so they are glitchy
}

You wanted to make the Jeep have car sounds, so you edited the train?

Yea I'm pretty confused as to what you're attempting to accomplish

He wants to make the Jeep have sounds while driving. The Train add-on has sounds while driving, so he's trying to take code from it.

Take all the code from the jeep...


And, and then.
Take the noise-making code from the train.

Remove every line with "setWheelSteering"

Heres what I tried
I put the code from the train into the jeeps (edited one)
That didn't work at all. It screwed the jeep up, it wouldn't spawn, etc.
But if I make the train model of the jeeps, it works more than editing the jeep's script.

Heres what I tried
I put the code from the train into the jeeps (edited one)
That didn't work at all. It screwed the jeep up, it wouldn't spawn, etc.
But if I make the train model of the jeeps, it works more than editing the jeep's script.
Well, try what Kalphiter said, but honestly I guarantee it's easier to edit the Jeep to make sounds than it is to completely overhaul a completely different add-on in every way just for the sounds.

Wow thanks Kalphiter, I tried that (or something like it) a while ago but now it works. (What I did made the tires not spawn for some reason.)