Jump to content

[help] ModuleManager Syntax confusion


Markelius

Recommended Posts

So, I'm trying to write a modulemanager patch to create a duplicate of the Vernor Engine that's in the propulsion category and acts like an engine rather than an RCS thruster. I got as far as replacing it's rcsthruster module block with one written as if it were any other engine in the propulsion category.

My problem is, I've written what appears in my eyes to be a patch that should work, and yet ingame it does not appear in staging when placed, and cannot be activated and used by any means.

Here's my patch:


// Creates a duplicate of the Vernor engine and adds it to the propulsion category.


// vernorEngine (stock)
+PART[vernierEngine]
{
@name = vernierEngineRocket
@title = Vernor Engine MicroMotor
@category = Propulsion
@description = A VR-N1ER Engine, refitted as a microthruster for small craft instead of an LFO burning linear RCS port. It doesn't have much thrust, but it can be placed in a lot of places other microthrusters can't.


EFFECTS, 0
{
running
{
AUDIO
{
channel = Ship
clip = sound_rocket_mini
volume = 0.0 0.0
volume = 1.0 1.0
pitch = 0.0 0.8
pitch = 1.0 1.0
loop = true
}
PREFAB_PARTICLE
{
prefabName = fx_exhaustFlame_yellow_tiny_Z
transformName = thrustTransform
emission = 0.0 0.0
emission = 1.0 1.0
speed = 0.0 0.8
speed = 1.0 1.0
}
}
engage
{
AUDIO
{
channel = Ship
clip = sound_vent_medium
loop = false
}
}
disengage
{
AUDIO
{
channel = Ship
clip = sound_vent_soft
loop = false
}
}
}

!MODULE[ModuleRCS] {}

MODULE[ModuleEnginesFX], 1 {
thrustVectorTransformName = thrustTransform
exhaustDamage = True
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 12
heatProduction = 0
fxOffset = 0, 0, 1.6
PROPELLANT
{
name = LiquidFuel
ratio = 0.9
DrawGauge = True
}
PROPELLANT
{
name = Oxidizer
ratio = 1.1
}
atmosphereCurve
{
key = 0 260
key = 1 140
}
}

MODULE, 2
{
name = ModuleGimbal
gimbalTransformName = thrustTransform
gimbalRange = 1
}




MODULE, 3
{
name = ModuleTestSubject

// nowhere: 0, srf: 1, ocean: 2, atmo: 4, space: 8
environments = 15

useStaging = True
useEvent = True
}
}

I'm pretty new to writing modulemanager patches (and modding KSP in general), so I'm not sure what I need to do to make this work. I read through the documentation on github but I don't understand what I've done wrong. Can anyone point out my mistakes so I can fix them and hopefully not make them again? Many thanks in advance. :3

Link to comment
Share on other sites

Give this a Shot if it don't work will start a test install and play with it

// Creates a duplicate of the Vernor engine and adds it to the propulsion category.


// vernorEngine (stock)
+PART[vernierEngine]
{
@name = vernierEngineRocket
@title = Vernor Engine MicroMotor
@category = Propulsion
@description = A VR-N1ER Engine, refitted as a microthruster for small craft instead of an LFO burning linear RCS port. It doesn't have much thrust, but it can be placed in a lot of places other microthrusters can't.


EFFECTS
{
running
{
AUDIO
{
channel = Ship
clip = sound_rocket_mini
volume = 0.0 0.0
volume = 1.0 1.0
pitch = 0.0 0.8
pitch = 1.0 1.0
loop = true
}
PREFAB_PARTICLE
{
prefabName = fx_exhaustFlame_yellow_tiny_Z
transformName = RCSthruster
emission = 0.0 0.0
emission = 1.0 1.0
speed = 0.0 0.8
speed = 1.0 1.0
}
}
engage
{
AUDIO
{
channel = Ship
clip = sound_vent_medium
loop = false
}
}
disengage
{
AUDIO
{
channel = Ship
clip = sound_vent_soft
loop = false
}
}
}

!MODULE[ModuleRCS] {}

MODULE
{
name = ModuleEnginesFX
thrustVectorTransformName = RCSthruster
exhaustDamage = True
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 12
heatProduction = 0
fxOffset = 0, 0, 1.6
PROPELLANT
{
name = LiquidFuel
ratio = 0.9
DrawGauge = True
}
PROPELLANT
{
name = Oxidizer
ratio = 1.1
}
atmosphereCurve
{
key = 0 260
key = 1 140
}
}

MODULE
{
name = ModuleGimbal
gimbalTransformName = RCSthruster
gimbalRange = 1
}

MODULE
{
name = ModuleTestSubject

// nowhere: 0, srf: 1, ocean: 2, atmo: 4, space: 8
environments = 15

useStaging = True
useEvent = True
}
}

EDIT- Forgot to change to thrusterTransformName = RCSthruster has to stay the same updated.

Edited by Mecripp2
Link to comment
Share on other sites

This what you want ?[snip]

No, In that picture, the particles should be going in every direction pushing the thrusters into the ship. I want the thrust to come out the opposite direction of the circular black hole on the thruster.

Link to comment
Share on other sites

  • 1 month later...

Sorry to jump in on this a month late (I was googling for something else, and came across this).

One idea is that you can create an additional "model" in unity with the correct thrust vectors, and no visible meshes, and use the "MODEL {}" syntax for the part to load both the old model and your "model of thrust vectors". As long as the new thrust vector transforms are named differently, you can reference those in the engine settings and it might work.

It's kinda like part welding, except here you're just adding the new thrust vectors you need.

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...