Jump to content

Recommended Posts

I'm working on updating an old mod for 1.2.  So far it's mostly working, except for two parts.

These parts are truck bases, and each one has two wheels, one on each side.

Here is the old code from the cfg file (I've commented it out in the file):

//	MODULE
//	{
//		name = ModuleWheel
//		hasMotor = true
//		resourceName = ElectricCharge
//		resourceConsumptionRate = 0.7
//		canSteer = true
//		controlAxisType = Forward
//		steeringModeType = AutomaticSteer
//		brakeTorque = 35
//		brakeSpeed = 0.1
//		impactTolerance = 800
//		overSpeedDamage = 50
//	
//		WHEEL
//		{
//		    wheelName = wheel
//		    wheelColliderName = wheelCollider
//		    suspensionTransformName = suspensionTraverse
//		    suspensionNeutralPointName = suspensionNeutralPoint
//		    damagedObjectName = BustWheel
//		    rotateX = 1
//		    rotateY = 0
//		    rotateZ = 0
//		}
//		WHEEL
//		{
//		    wheelName = wheel001
//		    wheelColliderName = wheelCollider001
//		    suspensionTransformName = suspensionTraverse001
//		    suspensionNeutralPointName = suspensionNeutralPoint001
//		    damagedObjectName = BustWheel001
//		    rotateX = 1
//		    rotateY = 0
//		    rotateZ = 0
//		}
//		steeringCurve
//	 	{
//	   	 key = 0 20
//		 key = 10 5
//	  	 key = 30 2
//		 key = 50 1
//	 	}

When I tried to add 2 ModuleWheelBase modules, I get the following error:


Can't add 'KSPWheelController' to KSCTruckAxleNarrowComplex because a 'KSPWheelController' is already added to the game object!
A GameObject can only contain one 'VehicleBase' component.
 
(Filename:  Line: 97)

NullReferenceException: Object reference not set to an instance of an object
  at KSPWheelController.Create (UnityEngine.Rigidbody rb, UnityEngine.GameObject host, UnityEngine.GameObject wheelColliderHost) [0x00000] in <filename unknown>:0 
  at ModuleWheelBase.wheelSetup () [0x00000] in <filename unknown>:0 
  at CallbackUtil+<WaitUntil>c__IteratorF5.MoveNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename

Since I can't add two ModuleWheelBase modules, is there any way to control the two wheels, or are these parts dead and unrecoverable?

Also, if someone could point me to the wheel documentation, that would be helpful.

 

Thanks in advance

Link to comment
Share on other sites

Stock wheel modules absolutely will not support multiple wheels.

Your only option is to split the wheels into separate part(s); might need one each for left and right wheels.

 

On a related note, I'm still working on getting a replacement wheel-collider solution implemented that -will- allow for multiple wheels/legs/etc in a part, and remove all of the rigidbody orientation constraints from wheels; sadly still likely a few weeks/months out.  (See the KerbalFoundries thread for more info / updates)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...