Jump to content

Display particles in partless mod


Recommended Posts

Hello everyone!

I am trying to figure out how to display particles/a particle system in a partless mod (e.g. display dust zooming by the vessel during flight or other funny things). It seems that gameObject has a particleSystem property of type ParticleSystem – sounds good and there are Unity tutorials on how to make it work with that. However, this property is null. So AddComponent won't work because it already exists and instantiating it doesn't work because it's read-only.

Of course this might not be the best approach altogether, maybe there is a better solution to tackle this.

[KSPAddon( KSPAddon.Startup.Flight, false )]
public class CanIHazParticles : MonoBehaviour {

// Step 1: create mod dummy
// Step 2: ???
// Step 3: sup3r fLy p4rt!cleZ

}

This question may come from my lack of knowledge of the Unity engine so please forgive me if the answer is rather easy. I tried to look at a few different mods to see if I can find anything, but without any luck.

Link to comment
Share on other sites

Sorry that it took me so long – I've just been too busy at work. I finally got around to try this and with small modifications it works just fine in a partless mod. Thank you!

However, I have a follow-up question. I found this overview of available effects. However, I'd like to make a custom one – but how? The effects seem to come from the (binary) file KSP_Data/ressources.assets, so I'm assuming this is where I'll have to actually use Unity. Before I get started with that, is it really the case that I can just create the effect in there and export a custom assets file or are there limitations with KSP?

Link to comment
Share on other sites

You could just make your own particle system directly via Unity (I know it's possible since Majiir does it--check out the recently released particle mod of his). Not sure how the FX in ModuleEnginesFX work; that's like a "half custom" system. Haven't dug into it more, but I likely will soon.

EDIT: Linky. http://forum.kerbalspaceprogram.com/threads/65364-OpenParticleEmitter-Kethane-derived-alternate-particles-module

Link to comment
Share on other sites

You could just make your own particle system directly via Unity (I know it's possible since Majiir does it--check out the recently released particle mod of his). Not sure how the FX in ModuleEnginesFX work; that's like a "half custom" system. Haven't dug into it more, but I likely will soon.

EDIT: Linky. http://forum.kerbalspaceprogram.com/threads/65364-OpenParticleEmitter-Kethane-derived-alternate-particles-module

I know this might de-rail the thread a bit, but i want to know whether you have plans for Real Fuels so that those fuel tanks especially cryogenic ones will emit water steam particle fx to give more immersion? it will also work as a hint for us to know what tanks will slowly lose fuel inside I guess...

Link to comment
Share on other sites

That is a great resource, too, thanks. I do need moving emitters, though, but any code that gets me started is good – nothing preventing me from expanding it :) I might use the FXGroup for a proof-of-concept of my idea and then when I get into having to use custom particles I'll look more into it.

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