Jump to content

The trouble with Klaws


Recommended Posts

Ok, so I made this part quite a while back, a tug-boat bow for the Maritime Pack.  On it, I put a ModuleGrappleNode and a very basic animation.  Here's the .cfg file:

	name = FS_15MTugBow
	module = Part
	author = Fengist
	mesh = model.mu
	scale = 1
	rescaleFactor = 1
	node_stack_bottom = 0.0, -2.60375, 0.0, 0.0, -1.0, 0.0, 1
	node_stack_top = 0.0, 0.0, -0.648, 0.0, 0.0, -1.0, 1
	TechRequired = generalConstruction
	entryCost = 2500
	cost = 380
	category = Structural
	subcategory = 0
	title = Tug Boat Bow
	manufacturer = Fengist's Shipyard
	description = One of our engineers dropped a torch on one of our styrofoam hulls and this is the result. We liked the pointy bit so we decided to sell it.
	attachRules = 1,0,1,1,0
	mass = 10
	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.3
	angularDrag = 2
	crashTolerance = 70
	breakingForce = 50
	breakingTorque = 50
	maxTemp = 2000 // = 3000
	fuelCrossFeed = True
	bulkheadProfiles = size1, srf
	MODULE
	{
		name = ModuleGrappleNode
		nodeTransformName = dockTransform
		deployAnimationController = 1
		nodeType = size1
		captureRange = 0.06
		captureMinFwdDot = 0.733
		captureMaxRvel = 1
	}
	MODULE
	{
		name = ModuleAnimateGeneric
		animationName = clampAnim
		startEventGUIName = Arm
		endEventGUIName = Disarm
		actionGUIName = Toggle Arming
	}
	MODULE
	{
	    name = TweakScale
	    type = surface
	}

The theory is:  Take the tugboat bow, run it into another ship, activate the Klaw and move the other ship to where you want it and release.

I'm able to activate the Klaw and grab the other ship with no problem.  The issue arises when I try to release.  Clicking the Disarm button doesn't change the button name back to Arm.  It remains 'Disarm.' And while the Klaw does release what I've grabbed, that object then floats away.  And I don't mean float as in drift, I mean floats as in - becomes massless and starts to rise up into the atmosphere!

I've played with the transform orientation, captureRange and captureMinFwdDot and no real difference.  I've also tested the sock Klaw on the front of this part and it has no problems grabbing and releasing other parts.  Mine turns them into baloons.

Any ideas why?

Link to comment
Share on other sites

The Klaw can't be the Root part. there's minor bug in the way force is applied when you detach the claw such that if the Klaw is the root part of the vessel, you get NullRef and IndexOutofBounds error (you should see it in the debug log in game) and it'll screw up the game and you get symptoms like you described and the Klaw will not attach to anything else. Padishar logged the bug in the Tracker, but no telling when it'll be fixed.

Edited by nli2work
Link to comment
Share on other sites

Edit: You can ignore the below Nli

I should have known it needed a mesh collider, every damned thing else does.  The error below was caused because I had the Z scale set to 0 on the transform and the collider became 2D. Unity apparently abhors a 2D collider.

------------------------------------------------------------

Hey @nli2work,  Back a couple years ago, you made this post:

Did I read correctly?  You put a mesh collider on the claw transform????

I tried that and umm... I ended up floating in space with a lot of 

[LOG 13:52:48.786] E is NaN! tA: 3.14159265358979, e = NaN
[ERR 13:52:48.812] Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "FS.15MTugBow/model/Tug 1/dockTransform"

followed by explosion awesomness :(

Edited by Fengist
Link to comment
Share on other sites

Actually, I couldn't get it to work right till I did put a mesh collider on the node.

Now, it's almost perfect.

And I'm not sure if it's the way I designed the part or the fact that my boats are built in the SPH, but the Y on my transform is pointed at the target.

I dunno, but it works great now.

Edited by Fengist
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...