Jump to content

2 prefab particles, one part


Recommended Posts

Has anyone discovered a way to add 2 prefab_particle objects to a single part? I tried adding 2 of them with different transformName 's under Effects/running_trust and KSP only recognizes the first one in the .cfg. Any ideas?

		running_thrust
{
AUDIO
{
channel = Ship
clip = sound_jet_deep
volume = 0.0 0.0
volume = 0.05 0.4
volume = 1.0 1.0
pitch = 0.0 0.6
pitch = 1.0 1.0
loop = true
}
PREFAB_PARTICLE
{
prefabName = fx_smokeTrail_light
transformName = exhaustport
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
PREFAB_PARTICLE
{
prefabName = fx_smokeTrail_light
transformName = exhaustport2
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
}

Link to comment
Share on other sites

I haven't tried it, no. But I'm wondering why you need this. I'm not criticizing, I'm genuinely curious, because I love finding all sorts of interesting use-cases that Squad didn't think of. :)

In the case of multiple-nozzle engines, all of the transforms should be named the same, and it'll apply the effect to all of them. If it's also multi-mode, then you can have different transform names for the modes, and they can have separate effects blocks.

Are you trying to have smoke coming from a place that's not directly associated with a nozzle?

One of the things that the stock Mammoth engine does (and I copied for SpaceY), is that it has a set of four "thrustTransform" transforms that are associated with the individual nozzles, but a single "smokePoint" transform in the middle (associated with the PREFAB_PARTICLE) so that it generates one smoke trail.

EDIT: Oh right, you're doing boats (*slaps forehead*). If you're doing smoke from exhaust ports, it should apply it (I think) if you have multiple transforms with the same name.

Edited by NecroBones
Link to comment
Share on other sites

EDIT: Oh right, you're doing boats (*slaps forehead*). If you're doing smoke from exhaust ports, it should apply it (I think) if you have multiple transforms with the same name.

Exactly. I'm toying around with the idea of a paddlewheeler and using ore for a fuel. Thot it would be kinda neat if I could replicate the twin stacks of old river boats and have the exhaust come out of them. The fx medium puts out enough smoke that it would look pretty decent. But, it's just not working.

I've tried them both with the same name, one animates.

Both with different transforms and names, one animates.

I've even rearranged the .cfg to look like this:


running_thrust
{

PREFAB_PARTICLE
{
prefabName = fx_smokeTrail_medium
transformName = exhaustport
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
}
running_thrust
{

PREFAB_PARTICLE
{
prefabName = fx_smokeTrail_medium
transformName = exhaustport
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
}

And still, only one animates.

Since stock water doesn't appear to be something they paid a lot of attention to, I highly doubt they would have thot of someone making a paddlewheel boat for a space sim.

Link to comment
Share on other sites

So I had this BRILLIANT idea on the way to work. I'd just make two smoke stacks they could place anywhere and have an FX on each of them. Right. So I did this.


MODULE
{
name = ModuleEnginesFX
thrustVectorTransformName = thrustTransform
exhaustDamage = False
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 0
heatProduction = 0
fxOffset = 0, 0, 0.125
powerEffectName = running_thrust
PROPELLANT
{
name = LiquidFuel
ratio = 0
DrawGauge = False
}
}
EFFECTS
{
running_thrust
{

PREFAB_PARTICLE
{
prefabName = fx_smokeTrail_medium
transformName = exhaustport
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
}

}

And THAT was a mistake. A visit from the Kraken that required the entire save game to be deleted was the result.

And I tried the MODEL_MULTI_PARTICLE, which does work. But I'm not looking for 2 different effects. I would like them to be the same. The problem there is, one uses a prefab, which I want, and the other uses a model. If I could use 2 models or 2 prefabs, that would be great. I don't see it working though.

I even tried 2 MODEL_MULTI_PARTICLE and again, one works, the other doesn't

Edited by Fengist
Link to comment
Share on other sites

So I had this BRILLIANT idea on the way to work. I'd just make two smoke stacks they could place anywhere and have an FX on each of them. Right. So I did this.


MODULE
{
name = ModuleEnginesFX
thrustVectorTransformName = thrustTransform
exhaustDamage = False
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 0
heatProduction = 0
fxOffset = 0, 0, 0.125
powerEffectName = running_thrust
PROPELLANT
{
name = LiquidFuel
ratio = 0
DrawGauge = False
}
}
EFFECTS
{
running_thrust
{

PREFAB_PARTICLE
{
prefabName = fx_smokeTrail_medium
transformName = exhaustport
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
}

}

And THAT was a mistake. A visit from the Kraken that required the entire save game to be deleted was the result.

And I tried the MODEL_MULTI_PARTICLE, which does work. But I'm not looking for 2 different effects. I would like them to be the same. The problem there is, one uses a prefab, which I want, and the other uses a model. If I could use 2 models or 2 prefabs, that would be great. I don't see it working though.

I even tried 2 MODEL_MULTI_PARTICLE and again, one works, the other doesn't

It's not precisely the same thing, I think this will work for you (Tiberions post specifically): http://forum.kerbalspaceprogram.com/threads/48222-2-nozzles-in-a-engine

I've done it with engines nozzles and the effects generate on each transform, so in theory it should work for what you're trying to do.

Edit: Here's my Unity hierarchy. The game searches each GameObject path for the transform name, and will only apply whatever it is it's trying to do to the first object with the correct name then ignores the rest by default. By putting the transforms with identical names but under different game objects, it applies to all of the transforms.

5Hz0VJZ.png

Edited by Randazzo
Link to comment
Share on other sites

It's also important to note that your prefab particles will need unique names. Something I just stumbled across.

PREFAB_PARTICLE
{
name = flamethrust2 // This
prefabName = fx_smokeTrail_light
transformName = smokePoint
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
}

Link to comment
Share on other sites

Ok, I spent 3 hours trying to get this right and still, one works the other doesn't. I've used multiple names, multiple hierarchies, multiple locations. I've added parts, taken off parts... I give up. Sorry, modding was fun at first. Now, the total lack of documentation from Squad is becoming rather aggravating. Any time you want to try to do something new you have to spend hours googling and experimenting and half the time, end up getting nowhere.

Link to comment
Share on other sites

Ok, I spent 3 hours trying to get this right and still, one works the other doesn't. I've used multiple names, multiple hierarchies, multiple locations. I've added parts, taken off parts... I give up. Sorry, modding was fun at first. Now, the total lack of documentation from Squad is becoming rather aggravating. Any time you want to try to do something new you have to spend hours googling and experimenting and half the time, end up getting nowhere.

I'm having the same issue now, trying to get this to work on another engine. It works on the other one I put up there, but it just uses regular particle effects and ModuleEngine. It's not wanting to work with ModuleEngineFX, but I don't see what the difference is. If I get lucky and figure it out, I'll put up here.

In the meantime, don't give up on it, your mod is way too cool man.

Link to comment
Share on other sites

Ok, I finally got it working but now, I've decided it's not what I really want. Imagine that. But, you were correct Rand, the name in the .cfg is how it separates them. I have 2 empty GameObjects in Unity, both are children of the PartTools root. I didn't have to put them on any mesh or add any mesh to them. They are their own objects. Under each is another empty object with the blue arrow pointing the direction of the prefab. Both have unique names. One is named exhaustport and the other exhaustport1.


ParttoolsObject
meshes & colliders
GameObject
exhaustport
GameObject
exhaustport1

In the .cfg, each prefab has it's own node and a unique name. Apparently the name does nothing except to identify them as separate entities. Without the names, it only recognizes the first one. I named them exhaust1 and exhaust2. Each transformName refers to the two object names in unity.

The .cfg looks like this:


running_thrust
{
AUDIO
{
channel = Ship
clip = sound_jet_deep
volume = 0.0 0.0
volume = 0.05 0.4
volume = 1.0 1.0
pitch = 0.0 0.6
pitch = 1.0 1.0
loop = true
}
PREFAB_PARTICLE
{
name = exhaust1
prefabName = fx_smokeTrail_medium
transformName = exhaustport
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
PREFAB_PARTICLE
{
name = exhaust2
prefabName = fx_smokeTrail_medium
transformName = exhaustport1
emission = 0.0 0.0
emission = 0.05 0.0
emission = 0.075 0.25
emission = 1.0 1.25
speed = 0.0 0.25
speed = 1.0 1.0
localOffset = 0, 0, 1
localRotation = 1, 0, 0, -90
}
}

And the proof.

2exhaust.jpg

I assume, using this method you could have as many prefabs as you wanted.

Now, I'm off to crash ksp some more and try to make this a particle effect tied to the throttle using FXModuleAnimateThrottle (I tried this once and the animation failed to load). While this 2 particles, one part works and may be my backup plan, it ties the particles to the part where the engine is. If, say I have an exhaust stack and I want the user to be able to place it wherever they want and still get a particle effect based on throttle, I'd have to place an engine on that part.

Which brings up the next question. Anyone have any experience with using either the unity or the ksp particle emitter. It would appear that simply adding the emitter to a gameobject doesn't work as KSP claims it can't find the model.

Edited by Fengist
Link to comment
Share on other sites

  • 2 weeks later...

Unity's shuriken particle system won't work in KSP at the moment. You have to use KSP particle. After Unity 5 part tools that might change.

KSP Particle is really the unity legacy particle system settings collected in one place. My engine tutorial covers some of KSP Particle tool. It should still apply since PartTools haven't changed so far with KSP 1.x.

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