Very cool, well done! I can see this being very useful. You could go a step further with the saved output and save it to a class inheriting from Particular.
Example = class(Particular)
Example.settings = {}
function Example:init(x,y,strSprite)
Particular.init(self,x,y,strSprite,Example.settings)
end
@Briarfox, this is awesome! You may, however, want to check the inputted particle name for illegal characters (like spaces). That’s if you want to make it idiot-proof. For instance, I used “Space Debris” as the name of my first saved particle. It saved fine, but it gave me an error when I tried to run it again–it didn’t like the space between the two words. I guess you could also just warn people.
@Briarfox, I’m having a problem with the new version. When I load a particle parameter set and then save it again, I receive an error. It says, Error: … 379: Attempt to concatenate field ‘texture’ (a userdata value). Is this a bug or user error?
This issue is with readImage() in SavedOutput. I added readImage() to make texture selection easier. However this converts the spritekey which breaks if you reload it. To keep any previous saves remove readImage() in SavedOutput but leave the spritekey string.
@Briarfox - this looks really cool - so what am I doing wrong?
I have it loaded and I run it, and I get all the parameters at left, nothing on the screen. If I choose Random, the screen flashes occasionally. If I set Draw_Emitters to 1, I get a blue dot on the screen, but nothing else.
I presume I’m supposed to be seeing a preview of how it will look, but for some reason, that’s not happening. Any suggestions? (It’s interesting that when I flick between full screen and parameter view, I glimpse the particle effect briefly!).
Also, it’s not clear to the first timer (ie me) what happens after you output a result. I presume you need to copy that class, plus the Particular tab, to your own project, then create instances of your class (the only difference between them being x,y position) and just draw them. That process works, when I try it (and I do see the effect on screen), so I think I answered my own question.
@Thwapp I’m not following you, can you post a video of the result?
@Ignatz I have no idea why it wouldn’t be working correctly. Can you try installing it again? To use the particle include Particular Particle as a library. Then copy and saved particles from SavedOutput into a tab in your project. Then create an instance of your particle and add its draw to draw()
I just pulled the project and it’s running. Not sure why you have an issue with displaying.
@Ignatz, the blue dot on the screen, when Draw_Emitters is set to 1, is correct behavior. I presume it’s telling you where the particles are starting from. However, the fact that no particles show up is strange. Do you think there’s a problem with your textures? For instance, in the Function PresetSmoke(), the texture assigned is: emitter.ParticleMesh.Texture = “Cargo Bot:Smoke Particle”. If your Cargo Bot graphics are bad, you wouldn’t see the preview.