Jump to content

I'm developing a small mod, and I have been hitting a few issues...(First mod woes)


Rivvik

Recommended Posts

Right now I'm focusing on the wheels. I have copy/pasted the Squad's Rover1 modules, and have gotten most of it to function. The issue I have now, is the the front wheels seem to be propelling the craft in the opposite direction as the rear wheels (which are a separate part...for a reason ;) ). In fact they are both the same model, the only real difference is the part.cfg allows for one to steer and one not to.

My second issue may very well be tied to the first, in that I cannot seem to get symmetry working, I only need it at 2x. This is very important.

I also have defined nodes for these purposes, but they don't show up nor can be snapped to. I used "node_Attach = " for some, and "node_Stack_Front/Rear" for the main junction, but none seem to cause the default part "snap to" OR generate the green spheres. I use the "= X,Y,Z, aX,aY,aZ, Size" notation, but nothing.

I also have a hidden pair of rockets in the rear fuselage. The fuselage opens up via a small hatch and the rockets slide out. How can I get the animation to play via an action command? It plays in 3DS Max and seems to have transferred to Unity without issue (I can even preview it, I just don't know how to trigger it. It involves 2 pieces, each with it's own bone, if that matters)

Also how can I have these rockets remain inactive while not deployed, and remain inactive for a few moments after (for safety purposes)?

EDIT Sorry forgot the code:

PART
{
// Kerbal Space Program - Part Config
// Generated By KSP_Config Create (Script)

// --- general parameters ---
name = *SECRET*
module = Part
author = Rivvik

// --- asset parameters ---
mesh = model.mu
scale = 1
rescaleFactor = 1

// --- node definitions ---
// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z, Node Size

node_Attach = 0, 0, 0, 0, -90, 0, 1

// --- editor parameters ---
cost = 250
category = Utility
subcategory = 0
title = *SECRET*
manufacturer = *SECRET*
description = *SECRET*

// --- attach parameters ---
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 0,1,0,1,0

// --- standard part parameters ---
mass = 0.05
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.1
angularDrag = 1
crashTolerance = 12
breakingForce = 80
breakingTorque = 80
maxTemp = 300
fuelCrossFeed = True

// --- Custom parameters ---
MODULE
{
name = ModuleWheel
hasMotor = true
resourceName = ElectricCharge
resourceConsumptionRate = 0.0025

canSteer = true
controlAxisType = Forward
steeringModeType = AutomaticSteer
brakeTorque = 350
brakeSpeed = 1.5
impactTolerance = 250
overSpeedDamage = 60
WHEEL
{
wheelName = wheel
wheelColliderName = wheelCollider
suspensionTransformName = suspensionTraverse
suspensionNeutralPointName = suspensionNeutralPoint
\\damagedObjectName = bustedwheel
rotateX = 1
rotateY = 0
rotateZ = 0
}

steeringCurve
{
key = 0 16
key = 10 9
key = 30 2
}

torqueCurve
{
key = 0 50 0 0
key = 2 20 0
key = 2 7 0 0
key = 5 0 0 0
}

}

MODULE
{
name = FXModuleLookAtConstraint
CONSTRAINLOOKFX
{
targetName = susp2-1
rotatorsName = susp2-2
}

CONSTRAINLOOKFX
{
targetName = susp2-2
rotatorsName = susp2-1
}

CONSTRAINLOOKFX
{
targetName = susp1-2
rotatorsName = susp1-1
}

CONSTRAINLOOKFX
{
targetName = susp1-1
rotatorsName = susp1-2
}

CONSTRAINLOOKFX
{
targetName = susp3-1
rotatorsName = susp3-2
}

CONSTRAINLOOKFX
{
targetName = susp3-2
rotatorsName = susp3-1
}

}

MODULE
{
name = FXModuleConstrainPosition
matchRotation = true
matchPosition = false
CONSTRAINFX
{
targetName = steering
moversName = trackSteering
}

}

This is just the code for the front wheel. As a sample of my ignorance.

I'm totally new to 3D modelling, texturing, and ...whatever this is...so be gentle.

Edited by Rivvik
Forgot cfg
Link to comment
Share on other sites

I also have defined nodes for these purposes, but they don't show up nor can be snapped to. I used "node_Attach = " for some, and "node_Stack_Front/Rear" for the main junction, but none seem to cause the default part "snap to" OR generate the green spheres. I use the "= X,Y,Z, aX,aY,aZ, Size" notation, but nothing.

Why are the definitions removed from the cfg? Also, watch where you use uppercase letters. node_Attach may need to be node_attach. If you want the part to attach at 0,0,0 and orient towards -y, you should have a "-1" not a "-90".

http://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation#Node_Definitions

as far as animation, you need to add the animation component to your game object, select your animation in the component, and turn off play automatically. Then put this in your cfg file:

MODULE {

name = ModuleAnimateGeneric

animationName = anim name

animSwitch = true

startEventGUIName = start event name

endEventGUIName = end event name

}

Edited by Nazari1382
Link to comment
Share on other sites

Why are the definitions removed from the cfg?

Oh I want the mod reveal to be a surprise. ;)

Unless I'm missing something... :S

as far as animation, you need to add the animation component to your game object, select your animation, and turn off play automatically. Then put this in your cfg file:

Ah, many thanks. But will that automatically switch the modes between on/off of the rockets?

EDIT: Ok I added the code and edited the pertinent information. But when I loaded up the game, I got nothing. I have a "Toggle" node in the dropdown for the item, and a Locked for the Status...Neither does anything...

The animation name is stuck at "Take 001" in Unity...unless I missed something.

Edited by Rivvik
New Info
Link to comment
Share on other sites

Oh I want the mod reveal to be a surprise. ;)

Unless I'm missing something... :S

Ah, many thanks. But will that automatically switch the modes between on/off of the rockets?

I'm referring to the node definitions. You have no nodes in the cfg, only the line for allowing your part to surface attach. The Animate generic allows you to play/reverse the animation by right clicking the part or by setting up an action when building the craft.

Link to comment
Share on other sites

I'm referring to the node definitions. You have no nodes in the cfg, only the line for allowing your part to surface attach. The Animate generic allows you to play/reverse the animation by right clicking the part or by setting up an action when building the craft.

Oh I see! I'm remedying that issue currently.

The issue still remains with the animation thing though. Do I need to set up an action to trigger the animation at all?

Link to comment
Share on other sites

I got nodes to appear, still no snap-to or proper symmetry (even with stackSymmetry in place), and I've managed to rename the animation, but I'm not sure where to put the animation component in Unity to get it to play in KSP.

Link to comment
Share on other sites

// --- attach parameters ---

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision

attachRules = 0,1,0,1,0

The rules correspond to the numbers below - 1 is allow, 0 is prevent. The tags are:

stack - Can your part be stacked on others?

SrfAttach - Can your part be placed onto a surface?

allowStack - Will you allow other parts to be stacked on your part?

allowSrfAttach Can other parts be placed on the surface of yours?

allowCollision - A special one: Can your part be placed if part of it is intersecting another part?

Note that you can also force parts attached to this part to attach in a specific symmetry.

// symmetry rules: 0=1x, 1=2x, 2=3x, 3=4x and so on...

stackSymmetry = 3

change it to attachRules = 1,1,1,1,0

Also, I put my animation component on my main game object that contains everything. Then I put that object inside an empty parttools object for exporting.

Link to comment
Share on other sites

Ok, got the anims to fire, engine mode switch, symmetry (mirrorRefAxis), and now all I need is to find out why as soon as I launch my craft it calls apart piece by piece as soon as it tries to move. :S

EDIT Ok I think I fixed that issue...but my wheels don't seem to be able to move without exploding...

EDIT2: And my engines don't produce thrust...

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