Game Development Community

dev|Pro Game Development Curriculum

The Particle Editor

by Morrock · 08/04/2008 (12:48 pm) · 11 comments

Download Code File

I originally created this to be used in a seperate mission, but it works anywhere that the position "100 100 105" is free. The explosion editor isn't fully functional. Currently in v0.1

To add the Particle_editor unzip the .rar file and add both files: ParticleEditor.cs and ParticleEditor.gui into Creator/editor/ in your games directory, overwriting the pre-existing files. In Creator/main.cs add the line exec("./editor/particleEditor.gui"); . If it isn't already done, add a keybind to your client/config.cs to call "toggleParticleEditor" (this is the same function as the editor that uses F5, so you can skip this if you haven't changed that). Create a new folder in the Creator directory named "particles", this is where effects save to. This is really all that is needed to use the editor. But to use the editor as I originally planned I also suggest you copy the measurement_room.dif and the 2 textures into your interiors folder. Than create a new mission, placing the measurement_room interior at the position "92 99.5 99.7" to be able to view the editor and effects against a measured background where you can more easily judge things like size and duration. I also added a staticShape player model inside next to the center so I could compare sizes against an actual player model.

I created this Particle Editor because I was sick of editting particle effects in script, and the F5 editor was pretty lacking. It was made to use it's own mission so I could clearly view the effects I was editting in a static setting that was not 2 feet from my camera. My original plan was also to include an explosion editor, but after trying tens of different solutions and it still doesn't work, I'm sorry but I've given up on it right now. If anyone else wants to try and get it running I left all the code and GUI intact. The emitter and particle editors are perfect however.

If there are any bug fixes, or new features I feel like adding, I will update the Particle_Editor. And if anyone contributes to the editor (or is awesome and fixes the explosion editor) and shows me their work I will also update it here, with credit of course.

Some Notes:
-You can easily change the position of the effects by searching the .cs file for any instance of "100 100 105" and changing the position, or even copying code from the old particle editor if you'd like the effects to generate in front of your face.

-Changing the value of the particles assigned to an emitter (whether via the popup menu or not) will not change the particles used while showing the emitter effect. This apparently is due to the way the engine processes all of the particleData's for an emitter as a string and saves it into the emitter beforehand. The value cannot be changed at runtime, but it will still save as if it had.

-Showing editted particles while loop is checked off sometimes causes it not to show. I'm not sure why.

-While editting particles, the particles show in a default emitter, not one they would be attached to.

-Yes you can close the editor, move the camera around, and reopen without losing any work.

-Changes made in textboxes only take effect if you press Enter to apply.

-Why only 1 particle selector per emitter rather than 4 like the old one? I noticed that no matter how many particles you assigned to an emitter it would always choose the first one. This may have been due to some engine changes made or not. Either way I didn't feel it was needed.

-The Explosion Editor doesn't work because the global variables aren't being saved.

-You may notice quite a few of the values in the editor being slightly off of the values in your scripts. This is because the engine changes them to something more compatible (like changing times to multiples of 32, to be tick friendly) There is no easy way to fix this, but these are the ways the values appear in-game. The editor itself does not round or change values.

-I'll likely add more to this, but I've been working on this way too long, and am tired of it :P

Some Pictures:
i11.photobucket.com/albums/a176/iluin/screenshot_006-00001.pngi11.photobucket.com/albums/a176/iluin/screenshot_006-00003.pngi11.photobucket.com/albums/a176/iluin/screenshot_006-00004.png
Change log:
v0 The first version of this.
v0.1 Fixed ParticleData's not saving semicolons.

About the author

Recent Blogs


#1
08/03/2008 (12:23 pm)
The kind of resource that keeps us around; awesome work, Neil.
#2
08/04/2008 (6:37 pm)
good stuff!
#3
08/04/2008 (7:17 pm)
looks really cool..great work!!!
#4
08/04/2008 (9:56 pm)
many thanks ^^
#5
08/04/2008 (10:08 pm)
Hey! awesome work man.

I liked the text fields on the left, makes it more handy...

:)
#6
08/07/2008 (10:53 am)
Sweet!
#7
08/07/2008 (1:27 pm)
Excellent! I've been put off particle editing for a while because of the lack of a decent editor...
#8
08/15/2008 (2:46 pm)
Wow, I wonder I how I'd missed this after searching for such a resource all month! Awesome work, and thanks a ton :P
#9
08/16/2008 (9:32 am)
Thanks! Now I know there has to got to be some glitches in this, if so let me know and I'll fix them. I just notice the particle editor wasn't writing semi-colons at the end of each line in the effect save file. I'll be fixing and re-uploading this weekend.
#10
09/09/2008 (6:27 pm)
I dont seem to have a change in the Particle Editor, I replaced the previous files and such. However, It doesnt seem to change...
#11
09/11/2008 (2:40 pm)
Daniel, did you follow each of the steps at least up to adding the measurement room DIF? Make sure you correctly overwrote both the partcileEditor.cs and particleEditor.gui files, and not just one of the two. And make sure you are exec'ing the .gui file or else sometimes strange things happen with Torque, such as it loading an older version of a file that should not exist anymore. If this doesn't help, try deleting the particleEditor.cs.dso and particleEditor.gui.dso files.

I just downloaded a 100% fresh copy of Torque myself and installed this Editor with no problem, so double check that you haven't skipped a step. And I just updated the Particle_Editor to properly save particle datablocks if you want to re-download.