Jump to content

Anyone familiar with KSP Particle Emitter?


Recommended Posts

So basically i've been experimenting with the Particle emitter in Unity. It has two "modules". The Emitter(Script) and Particle System. 

As i managed to make a nice plume with the Particle System, when i export it, nothing shows up in game. I mean only when i make something with the Script "Module" plume shows up in game.

How can i make the plume in the Particle System component and get it to work in game?

Tenks ;)

 

I dunno if this help or not. 

http://prntscr.com/mnlogo

Link to comment
Share on other sites

On 2/20/2019 at 3:39 AM, KerboNerd said:

As i managed to make a nice plume with the Particle System, when i export it, nothing shows up in game.

Unfortunately, the PartTools used to build the .mu models does not support the new ParticleSystem used by Unity.  I recently hit upon this problem myself when trying to create and add new effects for one of my mods (Kerbal Foundries)...

The solutions that I devised all require custom plugin code, and none that I've envisioned would allow for the effect to be usable by any stock KSP PartModules (e.g. they could not be added to the EFFECTS block in the part config)

  • Create script in UnityEditor to export the ParticleSystem parameters to a text/.cfg file.  Use custom plugin code in KSP to parse this config file and create a prefab of the particle-emitter.  Yet more custom plugin code to add this emitter onto the models, and still more to enable activate/deactivate it.
  • OR In UnityeEditor, export the ParticleSystem prefab to an AssetBundle, use custom plugin code to load that asset bundle in KSP, and more custom plugin code to add the emitter to a part/model and control its state.
  • OR My 'chosen' solution was to create the ParticleSystem and set it up entirely from plugin code.  As I was already using a custom PartModule to manipulate stuff on the part, it was easy enough to add this loading code to the module.

An alternate solution, that I've not yet investigated, would be to use SmokeScreen to create the particles for you.  While I don't think it can load any sort of prefabs/precompiled objects, I do believe that it will allow you to define your particles via config files, AND will let you link those particles into the EFFECTS blocks to allow them to be used by engines/etc.

I'm honestly curious as on this myself as to what solutions others may have come up with.  I implemented the 'quick-and-dirty' loading through code, but would love to be able to create the particle in UnityEditor and export it somehow to be able to use in KSP (especially if it can be used in EFFECTS blocks and by stock KSP code).

Link to comment
Share on other sites

  • 5 months later...
On 2/21/2019 at 2:25 PM, Shadowmage said:

Unfortunately, the PartTools used to build the .mu models does not support the new ParticleSystem used by Unity.  I recently hit upon this problem myself when trying to create and add new effects for one of my mods (Kerbal Foundries)...

The solutions that I devised all require custom plugin code, and none that I've envisioned would allow for the effect to be usable by any stock KSP PartModules (e.g. they could not be added to the EFFECTS block in the part config)

  • Create script in UnityEditor to export the ParticleSystem parameters to a text/.cfg file.  Use custom plugin code in KSP to parse this config file and create a prefab of the particle-emitter.  Yet more custom plugin code to add this emitter onto the models, and still more to enable activate/deactivate it.
  • OR In UnityeEditor, export the ParticleSystem prefab to an AssetBundle, use custom plugin code to load that asset bundle in KSP, and more custom plugin code to add the emitter to a part/model and control its state.
  • OR My 'chosen' solution was to create the ParticleSystem and set it up entirely from plugin code.  As I was already using a custom PartModule to manipulate stuff on the part, it was easy enough to add this loading code to the module.

An alternate solution, that I've not yet investigated, would be to use SmokeScreen to create the particles for you.  While I don't think it can load any sort of prefabs/precompiled objects, I do believe that it will allow you to define your particles via config files, AND will let you link those particles into the EFFECTS blocks to allow them to be used by engines/etc.

I'm honestly curious as on this myself as to what solutions others may have come up with.  I implemented the 'quick-and-dirty' loading through code, but would love to be able to create the particle in UnityEditor and export it somehow to be able to use in KSP (especially if it can be used in EFFECTS blocks and by stock KSP code).

 

Any idea if one could use an old version of unity?  If so, which one, and where would I find a legacy version of part tools?

Link to comment
Share on other sites

13 hours ago, AzraelZephyrian said:

Any idea if one could use an old version of unity?  If so, which one, and where would I find a legacy version of part tools?

This discussion was regarding the use of the newer particle system; so no, an older version of Unity would not help.

If you are looking for information on creation and use of the legacy particle system, sorry I can't really offer any assistance there as I've never used it myself.  There might be some links around in one of the forum sections, or perhaps even try contacting one of the authors of the mods who has used the system.  Check the authors list of the legacy RealPlume particle models.

Link to comment
Share on other sites

8 hours ago, Shadowmage said:

This discussion was regarding the use of the newer particle system; so no, an older version of Unity would not help.

If you are looking for information on creation and use of the legacy particle system, sorry I can't really offer any assistance there as I've never used it myself.  There might be some links around in one of the forum sections, or perhaps even try contacting one of the authors of the mods who has used the system.  Check the authors list of the legacy RealPlume particle models.

Sorry, I was asking for my own purposes.  I was trying to figure out how to get *any* custom effects in game.  I ought to have prefaced it with that. 

Thanks, by the way, for the pointers.

Finally figured it out, but the scale is all wrong and I can't seem to change it... very vexing. 

Link to comment
Share on other sites

16 hours ago, AzraelZephyrian said:

Finally figured it out, but the scale is all wrong and I can't seem to change it... very vexing. 

Yeah, stock does some funny things with transform scales and effects.  Never could figure it out myself.

SmokeScreen supports scaling though, and should be able to load whatever models/prefabs you are using with the stock system :)

Link to comment
Share on other sites

9 hours ago, Shadowmage said:

Yeah, stock does some funny things with transform scales and effects.  Never could figure it out myself.

SmokeScreen supports scaling though, and should be able to load whatever models/prefabs you are using with the stock system :)

Well, I got it figured out well enough (though I'll be using smokescreen for my Z-pinch fusion drives).  Now I just need to figure out why mechjeb won't recognize my "docking port" that I'm using (in conjunction with docking autopilot) to guide a satellite interceptor.

Link to comment
Share on other sites

  • 8 months later...

So, i got with this kind of problem when i need to made a custom particle for the Jet state of my VTOL dualmode engines.

First, i see in my pre  KSP 1.7.3 Unity project, where i did already on Earlier Unity versions with older PartTools, the particles i already use in Rocket mode for the VTOL and my custom RCS for the mode I'm making, Omicron, that it lost all the Unity configs with the new Unity and new Parttools ( KSP 1.9.1).

It lost and show where it had to be the particle config, a missing (mono script) message. Since i did it a long time ago, i do not remember the name of it and Unity won't show it for me, i presume that was the older version of KSP Particle plugin.

 

So i start to dig and test here, and find a not optimal, but practical solution.

In Unity Hierarchy i create an empty game object with another one inside it, both with zero translate and rotation and default scale.

vtol_particle_jet -> vtol_particle_jet

On the root one, i put PartTools script (in inspector)to export Model Name: O_vtol_particle_jet, and fill up where i wanna to put then in my mod (Omicron/FX), with uncompressed TGA.

Then, in Inspector again but on child one, i  added KSP Particle Emitter (Script). It add Particle System automatically after it, but after some tests, besides the Particle System show cool animations, the in game test with it won't work, so i just discard those settings completely.

I keep my focus on KSP Particle Emitter, that won't show any preview in Unity, neither the Setup ParticleSystem do any thing, the list bellow work almost perfectly to control the behave of the particle in KSP.

So i keep editing it, exporting and testing in game, edit, export, test, edit export test. Take some time, put i got to the results i expect.

Is not perfect because you won't see it in Unity, and when  you close unity, it lost all the setting you changed in KSP Particle Emitter Script and go back to default state of it, so, i need to retype all my change if i close Unity and need to update again the particles.

The way i did to go around this bug, is to print screen my settings every time i close Unity, and then retype it to change.

Here how it get for the Jet.

49830689971_0f7d7e9059_b.jpgParticle jet Unity Config by Rafael Valle, on Flickr

It's not so practical, but it works.

Then i manage the config part of it and it's done.

Will do the work  until they manage to update Parttools to work with it again or better, they make the new Unity Particle System work with KSP.

Hope to be usefull.

Cheers.

 

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