Hard Light Productions Forums

FreeSpace Releases => Scripting Releases => Topic started by: m!m on May 29, 2011, 03:28:20 am

Title: Particle trail script
Post by: m!m on May 29, 2011, 03:28:20 am
THIS SCRIPT IS DEPRECATED
The functionality of this script has since been integrated into the engine with much better performance and more direct inclusion in the relevant tables. The new system is documented in the wiki (https://wiki.hard-light.net/index.php/Particle_Effects).






script functionality ... checked
cool screenshots   ... checked
documentation      ... checked
all code in trunk     ... checked

I have a new script for you! :D
This time I cannot describe what it does but I have screeens! ;)

Death particles of an Orion:
(http://img22.imageshack.us/img22/7094/particletrail001.jpg)

Weapon impact effects:
(http://img832.imageshack.us/img832/4508/scripthiteffect.jpg)

Credit for script idea goes to Nighteyes.

Be sure to use a build that is revision 7736 or later

And here it is:
Script Download (http://www.mediafire.com/?u1nucv553thd44c)

Have fun!

Changelog:
Date: 1.12.2012
Date: 6.09.2012
Date: 4.11.2011
Date: 19.10.2011
Date: 14.9.2011
Date: 7.9.2011

For script users: If you change a configuration file you don't have to exit FreeSpace for the change to take effect just reload the current mission.
Title: Re: Particle trail script
Post by: Nighteyes on May 29, 2011, 06:43:15 am
well I'll just add some more information regarding what you can do with this awesome script...
If you know about my questions regarding "death particles", this is the answer for them, this script basically generates particles when a ship dies, you can control the size, speed, effect used, number of particles generated, and even stack multiple particle combinations on the same ship type.
a few cool things this can be used for:
adding more glowy particles when a capship dies
adding a few more big particles with an explosion effect with slow speed, giving more depth to normal explosions
burning trails of fire and smoke going in all direction, apart from the ones we already have on the debris
the latest addition is allowing particles to generate particles, this basically gives us real volumetric burning trails :D

*these screenshots are an overkill of the effect, but it gets the point across nicely  :yes:

m!m just wanted to thank you for all the time spent on this, now only thing left to do is getting into trunk, and making it possible to use with weapon impacts as well
Title: Re: Particle trail script
Post by: Darius on May 29, 2011, 06:59:08 am
BSG-style explosions! That Orion one looks amazing.
Title: Re: Particle trail script
Post by: m!m on May 29, 2011, 07:40:15 am
I added a "+Weapon" (expects a weapon class name) value to types "Ship" and "Weapon" that triggers the creation of weapons instead of particles. See documentation for more information.
Disclaimer: Creating too much weapons will result in game slowdown and possibly in reaching the maximum weapons number. Now nobody can say I didn't warn you  :p.
Title: Re: Particle trail script
Post by: Commander Zane on May 29, 2011, 07:49:44 am
Pretty. :eek:
Title: Re: Particle trail script
Post by: Nighteyes on May 29, 2011, 07:58:40 am
I added a "+Weapon" (expects a weapon class name) value to types "Ship" and "Weapon" that triggers the creation of weapons instead of particles. See documentation for more information.
Disclaimer: Creating too much weapons will result in game slowdown and possibly in reaching the maximum weapons number. Now nobody can say I didn't warn you  :p.

awesome, using this we can have sparks/burning parts that can actually interact with other ships, or even simulate a kind of shockwave, with enough "weapons" firing we can have a spherical ball of death shooting outwards from an explosion!
*please note excessive use of this script will kill your comp :D
Title: Re: Particle trail script
Post by: Dragon on May 29, 2011, 10:44:10 am
Looks nice, can't wait to see the patch integrated.
BTW, would that allow for real smoke trails (via scripting, I guess that getting them into table would take a while...) and things such as clouds to be done in FSO?
Title: Re: Particle trail script
Post by: Fury on May 29, 2011, 11:18:10 am
Can you clarify what these states are exactly?

Quote
A number specifying the state in which the
particles will emit. These states are engineintern values that give the current explosion
state. Valid values are 1, 2 and 3.

Also, I love you m!m.
Title: Re: Particle trail script
Post by: m!m on May 29, 2011, 11:23:12 am
To my knowledge:
but a coder might give you better information.
Title: Re: Particle trail script
Post by: Nighteyes on May 29, 2011, 12:29:51 pm
Looks nice, can't wait to see the patch integrated.
BTW, would that allow for real smoke trails (via scripting, I guess that getting them into table would take a while...) and things such as clouds to be done in FSO?

this specific script wont help with clouds and missile trails, but similar particle generating scripts are possible... a nice way I made a cloud was to make an invisible box with no collide flag, and place glow points with a cloud texture, try it out.

Fury: from testing it I didn't see any difference between the state values, so I usually use "2" as its when usually you would want the particles to emmit.

this might help, I'll add some table values I'm using to test(this is from Diaspora, my personal testing only):

$Class:          Battlestar Sobek Class  --  first effect for ship class, glowy particle going in all directions
   +Effect:       capparticles   -- a glowy particle type effect, time it lives is according to the effect EFF file, so if you want it to last a long time lower the FPS
   +Time:          1
   +Emitstate:    1
   +Number:       65, 125
   +Speed:       35, 105
   +Size:          0.15, 2
   +Box Min:       0,0,0
   +Box Max:       0,0,0
   +Spewcone:       90
   
   +Trail effect:    Particlesmoke01  -- I didn't test yet the trails...

$Class:          Battlestar Sobek Class  -- second effect, only generates a handful of particles, big size with an explosion effect on them
   +Effect:       Exp_Huge
   +Time:          0.05
   +Emitstate:    1
   +Number:       2, 4
   +Speed:       35, 85
   +Size:          35 , 55
   +Box Min:       0,0,0
   +Box Max:       0,0,0
   +Spewcone:       90
   
   +Trail effect:    Particlesmoke01
Title: Re: Particle trail script
Post by: Fury on May 29, 2011, 12:40:09 pm
Oh, there is a clear difference in state values. I prefer 1 personally, but it doesn't seem to trigger in all ships. I wonder what the underlying condition is. 3 is clearly different from the other two.
Title: Re: Particle trail script
Post by: Nighteyes on May 29, 2011, 12:53:04 pm
well as I said I was mostly testing older builds of the script, didn't have time yet to see the final version...
can you specify the different particle behavior?
Title: Re: Particle trail script
Post by: Fury on May 29, 2011, 01:14:39 pm
What m!m said earlier in this topic should be spot on.
Title: Re: Particle trail script
Post by: Shivan Hunter on May 29, 2011, 01:52:08 pm
THIS IS EPIC

I love the Orion one, the Raynor one looks kinda wonky though.

This will go very well with the flaming debris script
Title: Re: Particle trail script
Post by: Rodo on May 29, 2011, 01:56:53 pm
OMG, with this FSO is one step closer from making real my dreamy cap ship explotion thing!, It's just lacking the ability to define a "path" on top of the model from where particles need to be casted... figure out what I want to do with that :P
Title: Re: Particle trail script
Post by: m!m on May 29, 2011, 01:59:05 pm
Well, you can specify a very precise direction for the particles which may produce the intended effect :D
Title: Re: Particle trail script
Post by: Rodo on May 29, 2011, 02:03:04 pm
BURNING DECKS!!! SCREAMING CREWMAN!!! and then... a hulk, a burnt out hulk is all that's left.

Oh dreamy, dreamy drama.
Title: Re: Particle trail script
Post by: Spoon on May 29, 2011, 06:25:51 pm
I've been messing around with this sweet script for a bit now

I'm completely lost on how +Velocity X Off-set is suppose to work though

Also, I'd like to request +speed for the parent particle or life time min/max, whatever works. Right now all the particles pretty much fade out at the exact same moment (as if they hit an invisible sphere wall)
Title: Re: Particle trail script
Post by: m!m on May 30, 2011, 04:30:19 am
I'm completely lost on how +Velocity X Off-set is suppose to work though
Okay, for every one of those three values you can specify either one or two numbers. When a particle gets created a vector is created where every value of the vector (x, y, z) is randomized to be between the specified values or the exact value is used when only value was specified for an axis. After that the vector will be normalized to be of length one (standard mathematical operation) and after that multiplied by the "+Speed" value as specified before. This way you can force the particle to fly in one specific direction, especially useful for weapon-impacts where you want the particles fly in exactly one direction.
I hope that helped, I'm aware that the documentation is lacking at some points but I'm planing to improve the documentation :nervous:

Also, I'd like to request +speed for the parent particle or life time min/max, whatever works. Right now all the particles pretty much fade out at the exact same moment (as if they hit an invisible sphere wall)
These values are specific to a particle bitmap as these values are computed based on the number of frames and the specified FPS of an effect. I could modify "+Effect" to accept multiple effects where one will be chosen randomly thus creating some diversity.
Title: Re: Particle trail script
Post by: G0atmaster on May 30, 2011, 06:02:57 am
I can see a major use for something like this in a campaign like DEM or JAD. Can you make something like this for FRED? Like, scripted destruction particles/effects/debris?
Title: Re: Particle trail script
Post by: m!m on May 30, 2011, 06:33:59 am
Theoretically yes, but the problem is that you will hit the SEXP length limit when making the necessary function call. But I've been playing with this idea for some time and I'll put some work in it when someone needs is :nod:
Title: Re: Particle trail script
Post by: Deadly in a Shadow on May 30, 2011, 10:42:37 am
Will there be SSE1 builds?
Title: Re: Particle trail script
Post by: Nighteyes on May 30, 2011, 11:10:49 am
so, whats keeping this from going into trunk? I'd really like to use this in Diaspora... this script can create some nice looking fireworks :)

(http://img17.imageshack.us/img17/6048/screen1763.jpg)
Title: Re: Particle trail script
Post by: Fury on May 30, 2011, 11:16:34 am
Well, there is one outstanding issue with particles when game is paused (via pause or esc keys).
http://scp.indiegames.us/mantis/view.php?id=2446

For example, if you pause while a capship is exploding and you use this script, then wait a while and resume the game will take significant time before it gets from apprent freeze to jerky fps and finally to smooth fps as it tries to catch up the time that was spent while game was paused.

This is apparent with Wanderer's flashy explosion script as well. If you pause a game for a moment, you will see that upon resuming FSO attempts to create significant number of particles the next frame(s) to catch up. As far as I can tell, the issue happens with tabled particles as well.

Now, this is the first script that effectively can freeze a PC for very long time if you pause at the wrong moment. During testing this script I've had to kill FSO process many times because I couldn't be arsed to wait until it finally resumes for real.

I'd go as far as to say that this script is unusable beyond testing due to the problem with pause and particles.
Title: Re: Particle trail script
Post by: m!m on May 30, 2011, 11:20:40 am
so, whats keeping this from going into trunk?
Most likely just the not existing free time of a coder... :nervous:

I'd really like to use this in Diaspora... this script can create some nice looking fireworks :)

<snip>
:eek2:

Well, there is one outstanding issue with particles when game is paused (via pause or esc keys).
http://scp.indiegames.us/mantis/view.php?id=2446

For example, if you pause while a capship is exploding and you use this script, then wait a while and resume the game will take significant time before it gets from apprent freeze to jerky fps and finally to smooth fps as it tries to catch up the time that was spent while game was paused.

This is apparent with Wanderer's flashy explosion script as well. If you pause a game for a moment, you will see that upon resuming FSO attempts to create significant number of particles the next frame(s) to catch up. As far as I can tell, the issue happens with tabled particles as well.

Now, this is the first script that effectively can freeze a PC for very long time if you pause at the wrong moment. During testing this script I've had to kill FSO process many times because I couldn't be arsed to wait until it finally resumes for real.

I'd go as far as to say that this script is unusable beyond testing due to the problem with pause and particles.
I'm sorry to hear that (although I wasn't able to reproduce this myself) and I don't know any way to work around this bug :(

Also: First post updated with new Build for SSE2 and SSE1
Title: Re: Particle trail script
Post by: Deadly in a Shadow on May 30, 2011, 11:34:02 am
Lol, when the Orion (in the testing mission) is going to explode, it crashes. I thought due to my computer:D
Title: Re: Particle trail script
Post by: m!m on May 30, 2011, 11:36:14 am
Could you play with a debug build and post the log here? Maybe it's not your computer :nervous:
Title: Re: Particle trail script
Post by: Fury on May 30, 2011, 11:37:26 am
I further tested the pause problem and I have to correct myself. This doesn't occur with pause, only with esc menu.

You see, if you press pause, you get Got event GS_EVENT_PAUSE_GAME (6) in state GS_STATE_GAME_PLAY (2)
If you press it again, you get Got event GS_EVENT_PREVIOUS_STATE (7) in state GS_STATE_GAME_PAUSED (3)

But if you press esc instead, game state does not change. I suspect this means all scripts are left in running state and when you resume the game, everything that your scripts have been working while esc menu was on, is getting thrown in at once. No idea at this time if this is limited to scripts or whether it does affect tabled particle generation too.
Title: Re: Particle trail script
Post by: Commander Zane on May 30, 2011, 11:39:25 am
*BOOM*
:jaw:
Title: Re: Particle trail script
Post by: m!m on May 30, 2011, 11:47:52 am
I further tested the pause problem and I have to correct myself. This doesn't occur with pause, only with esc menu.

You see, if you press pause, you get Got event GS_EVENT_PAUSE_GAME (6) in state GS_STATE_GAME_PLAY (2)
If you press it again, you get Got event GS_EVENT_PREVIOUS_STATE (7) in state GS_STATE_GAME_PAUSED (3)

But if you press esc instead, game state does not change. I suspect this means all scripts are left in running state and when you resume the game, everything that your scripts have been working while esc menu was on, is getting thrown in at once. No idea at this time if this is limited to scripts or whether it does affect tabled particle generation too.
Confirmed, just ran a test and I can confirm that script execution does not stop when the ESC menu is opened. This way the script will continue to generate particles which leads to the mentioned slowdown.
Title: Re: Particle trail script
Post by: Deadly in a Shadow on May 30, 2011, 12:17:57 pm
Could you play with a debug build and post the log here? Maybe it's not your computer :nervous:

Here we go.

[attachment deleted by ninja]
Title: Re: Particle trail script
Post by: m!m on May 30, 2011, 12:20:35 pm
Could you play with a debug build and post the log here? Maybe it's not your computer :nervous:

Here we go.

Doesn't seem to be an error of the script, I'm sorry.
Title: Re: Particle trail script
Post by: Deadly in a Shadow on May 30, 2011, 12:27:22 pm
Could you play with a debug build and post the log here? Maybe it's not your computer :nervous:

Here we go.

Doesn't seem to be an error of the script, I'm sorry.
Ah, good to know. In this case, I hope there will be some improvements.(Especially in performance.)
BTW: I didn't used the revision 7217 because it crashes on startup. I used the Revision 7151.
Title: Re: Particle trail script
Post by: Fury on May 30, 2011, 12:27:55 pm
m!m, are you familiar with Wanderer's flashy explosions script and how it uses rays for collision detection and to spawn explosion effects on hull where rays have successfully collided? Could this be used to generate these particles effects as well?

http://www.hard-light.net/wiki/index.php/Script_-_Flashy_Deaths_(new)
Title: Re: Particle trail script
Post by: Fury on May 30, 2011, 12:29:07 pm
Ah, good to know. In this case, I hope there will be some improvements.(Especially in performance.)
BTW: I didn't used the revision 7217 because it crashes on startup. I used the Revision 7151.
Errr, you seem to have missed the point in the very first post in this topic that this feature is not supported by trunk builds and requires the build m!m provided in the same post. Unless you have had someone to compile builds for you.
Title: Re: Particle trail script
Post by: Nighteyes on May 30, 2011, 12:42:26 pm
I further tested the pause problem and I have to correct myself. This doesn't occur with pause, only with esc menu.

You see, if you press pause, you get Got event GS_EVENT_PAUSE_GAME (6) in state GS_STATE_GAME_PLAY (2)
If you press it again, you get Got event GS_EVENT_PREVIOUS_STATE (7) in state GS_STATE_GAME_PAUSED (3)

But if you press esc instead, game state does not change. I suspect this means all scripts are left in running state and when you resume the game, everything that your scripts have been working while esc menu was on, is getting thrown in at once. No idea at this time if this is limited to scripts or whether it does affect tabled particle generation too.
Confirmed, just ran a test and I can confirm that script execution does not stop when the ESC menu is opened. This way the script will continue to generate particles which leads to the mentioned slowdown.

so does this mean there is a problem with FSO not pausing correctly when pressing ESC? if so then its not the script fault, and we should look into a way of using the pause way of pausing(:P) instead of the ESC way...
as this affects all other scripts this problem is quite big, as with time weapons, thrusters and explosions are going to be using more and more particles, its just natural...

Fury: with the ray collision method, do you want the particles to emmit from the shape of the hull? if so then it would replace the BOX emmiter nicely, but I would still like the option to have them emmit from the center of the ship
Title: Re: Particle trail script
Post by: m!m on May 30, 2011, 12:44:56 pm
m!m, are you familiar with Wanderer's flashy explosions script and how it uses rays for collision detection and to spawn explosion effects on hull where rays have successfully collided? Could this be used to generate these particles effects as well?

http://www.hard-light.net/wiki/index.php/Script_-_Flashy_Deaths_(new)
That would be an option but how should it work? I would propose that the rays are sent from the center of the effect (can be moved) to the borders of the specified box (with +Box Min,...) or just in all direction when "+Box Min" is not set. Would that suit your needs?

BTW: I posted a patch for your bug report, Fury.
Title: Re: Particle trail script
Post by: Fury on May 30, 2011, 01:48:31 pm
That would be an option but how should it work? I would propose that the rays are sent from the center of the effect (can be moved) to the borders of the specified box (with +Box Min,...) or just in all direction when "+Box Min" is not set. Would that suit your needs?
I would rather have +Box optional, by default I think particles could spawn from impact outwards in 90 degree angle (or whatever is the default when none is given). It'd basically just provide some randomization without having to use +Box option.

BTW: I posted a patch for your bug report, Fury.
Cool, thanks. I've pointed it to The E on #scp. It's in 7219.
Title: Re: Particle trail script
Post by: Spoon on May 30, 2011, 02:36:13 pm
Okay, for every one of those three values you can specify either one or two numbers. When a particle gets created a vector is created where every value of the vector (x, y, z) is randomized to be between the specified values or the exact value is used when only value was specified for an axis. After that the vector will be normalized to be of length one (standard mathematical operation) and after that multiplied by the "+Speed" value as specified before. This way you can force the particle to fly in one specific direction, especially useful for weapon-impacts where you want the particles fly in exactly one direction.
I hope that helped, I'm aware that the documentation is lacking at some points but I'm planing to improve the documentation :nervous:
I think I somewhat understand.

These values are specific to a particle bitmap as these values are computed based on the number of frames and the specified FPS of an effect. I could modify "+Effect" to accept multiple effects where one will be chosen randomly thus creating some diversity.
Ah yeah thats how thruster particles work too, weapon particles have life time though so I figured it could be implented for this as well. Cause having to rely on the framerate for each file is kinda icky. If you want to have the same particlesmoke effect, you'd need to have duplicate file entries with different framerates assigned in the .eff files. slightly less than desirable.
Title: Re: Particle trail script
Post by: Nighteyes on May 30, 2011, 03:34:37 pm
Spoon is right, controlling the particle life through the EFF file is not very convenient, making the script decide at what FPS an EFF is played would allow for a lot of diversity...  :yes:
Title: Re: Particle trail script
Post by: m!m on May 31, 2011, 09:17:59 am
I took a look at the code and I think that I might be wrong as is seems to be possible to influence the lifetime of a particle after it has been created which would make it possible to randomize that. I'm currently testing this idea.

EDIT: First post has been updated with a new link. Now you have a new value called "+FPS" to (obviously) change the FPS of the particle effect.
Title: Re: Particle trail script
Post by: Reprobator on May 31, 2011, 12:18:41 pm
Hi, this looks awesome! i'll play with that with pleasure!
The script link seem dead however :'(
Title: Re: Particle trail script
Post by: m!m on May 31, 2011, 12:20:45 pm
Fixed :nervous:
Title: Re: Particle trail script
Post by: Reprobator on May 31, 2011, 12:27:47 pm
thanks !
Title: Re: Particle trail script
Post by: Colonol Dekker on May 31, 2011, 12:41:06 pm
I know someone MANY YEARS ago :nervous: recreated the capital flak weapons from Starlancer for FS2 Retail.

But this just cries out to me for it to be recreated. That with a weapon FWOOOM flyby sound and aa mssive Crsyis style blue KASHPLOW! fling blue flamey jetsom all over the shop.  It just makes me go all

[attachment deleted by ninja]
Title: Re: Particle trail script
Post by: Commander Zane on May 31, 2011, 12:49:50 pm
I'd have to see that.
Title: Re: Particle trail script
Post by: Shivan Hunter on May 31, 2011, 01:58:16 pm
particles.lua has a null pointer error on line 378 where it attempts to call createEmitter with a null value. This causes a crash but if I select "no" to go on anyway, I can see the "capflash" particles with, understandably, no particlesmoke01 trails. You most make an update

edit also they all appear to move at 75 m/s even though I have +Speed: 75, 250
Title: Re: Particle trail script
Post by: m!m on June 01, 2011, 06:58:38 am
Thanks for the report, already fixed it but no new upload yet as I have to test the raycasting that I got implemented :p
Title: Re: Particle trail script
Post by: Nighteyes on June 01, 2011, 08:05:25 am
Thanks for the report, already fixed it but no new upload yet as I have to test the raycasting that I got implemented :p

regarding raytrace, use it to replace the box emmiter method, but leave the center point emmiter in, as for some ships the raytracing method would look strange...
Imagine a basestar shaped ship, it needs particles emmiting only from the core, and not from the long arms...
Title: Re: Particle trail script
Post by: Spoon on June 01, 2011, 11:30:18 am
I updated my folders with the new files from the scripts and tables and kept the config file the same as the one I had before (just added +fps to two entries)
aaand then I got this

(http://img820.imageshack.us/img820/3727/63245172.jpg)
(http://img89.imageshack.us/img89/6334/66954378.jpg)
Ginormous explosions somewhere in the back where no ships actually are, needless to say this pretty much grinds the game down to a complete halt  :p
Title: Re: Particle trail script
Post by: m!m on June 01, 2011, 02:37:40 pm
Are you sure that you used the custom build I posted? Because that is exactly the "bug" it fixes :p
Title: Re: Particle trail script
Post by: The E on June 01, 2011, 02:41:19 pm
Nightly builds revision 7224 or higher will have the particle code changes necessary.
Title: Re: Particle trail script
Post by: m!m on June 01, 2011, 02:48:28 pm
Thank you! New version that has ray casting in it has been uploaded!
Title: Re: Particle trail script
Post by: Spoon on June 01, 2011, 05:43:16 pm
Buh, well I dunno. I'd test it but the latest nightly that is currently out is 7223...
Title: Re: Particle trail script
Post by: m!m on June 02, 2011, 06:39:13 am
New version with some fixes and additions.
Changelog:
Documentation has been updated to reflect these changes.

Current development focus:

Link in first post has been updated.
Title: Re: Particle trail script
Post by: Spoon on June 02, 2011, 02:25:54 pm
Works fine with 7226

Though I take it you changed a few things around cause I had to dramatically up the +numbers: and +time: numbers
Title: Re: Particle trail script
Post by: Shivan Hunter on June 02, 2011, 11:12:28 pm
Well I definitely love this script, it really makes explosions that much more awesome. Using 7226 though it seems like there are some things that don't work as intended.

+Speed and +Size both can take two integers, a Max and a Min value, and as I understand it the actual speed or size is supposed to be randomized for each particle-trail-emitter thingy. It's not; as far as I can tell only the minimum value is ever used.

Also, weapon creation... doesn't really work. I tried to have a simple near-invisible corkscrew weapon with a large trail attached, and so much stuff went wrong that I can barely describe it. Now that I scaled the particles down to a reasonable size, they're emitting downwards at a ridiculous velocity (I never specify any of the velocity or spewcone fields) on the first cruiser's explosion and dying after one frame in the second cruiser's explosion.

[EDIT] It seems weapon generation is screwed up for corkscrew or swarm weapons, and those are really one of only two reasons to emit weapons in the first place.

Also, these particles being rendered next to flaming debris shows that these are much denser than flaming debris trails. A way to customize particle density in emitters would be nice.
Title: Re: Particle trail script
Post by: m!m on June 03, 2011, 05:33:53 am
Works fine with 7226

Though I take it you changed a few things around cause I had to dramatically up the +numbers: and +time: numbers
Damn, I knew that I forgot something. I changed the +Number handling to emit the specified number per second. Before it was dependent on the frame rate which may not be intended.

Well I definitely love this script, it really makes explosions that much more awesome. Using 7226 though it seems like there are some things that don't work as intended.

+Speed and +Size both can take two integers, a Max and a Min value, and as I understand it the actual speed or size is supposed to be randomized for each particle-trail-emitter thingy. It's not; as far as I can tell only the minimum value is ever used.
I'll look into this as soon as possible.

Also, weapon creation... doesn't really work. I tried to have a simple near-invisible corkscrew weapon with a large trail attached, and so much stuff went wrong that I can barely describe it. Now that I scaled the particles down to a reasonable size, they're emitting downwards at a ridiculous velocity (I never specify any of the velocity or spewcone fields) on the first cruiser's explosion and dying after one frame in the second cruiser's explosion.

[EDIT] It seems weapon generation is screwed up for corkscrew or swarm weapons, and those are really one of only two reasons to emit weapons in the first place.
I never really tested the weapon creation. Can you post an example with configuration file and the needed weapons table? This will help me to track down this bug.

Also, these particles being rendered next to flaming debris shows that these are much denser than flaming debris trails. A way to customize particle density in emitters would be nice.
I think that shouldn't be too complicated.
Title: Re: Particle trail script
Post by: [Wolf]Maverick on June 03, 2011, 07:19:22 am
Hi,
i download the script and put it in the Freespace2 Folder and i use Nightly r7226 but i still don't have any particle effect, did i miss some settings in the launcher?
Title: Re: Particle trail script
Post by: m!m on June 03, 2011, 07:22:10 am
This script requires a configuration file to create particles and the download only has a test configuration that will create particles when an Orion dies. I included a documentation that lists all possible values so you could try and create your own configuration :nod:
Title: Re: Particle trail script
Post by: m!m on June 03, 2011, 08:11:28 am
Sorry for double post but I uploaded a new version that should hopefully fix the bug pointed out by Shivan Hunter.
Title: Re: Particle trail script
Post by: Deadly in a Shadow on June 03, 2011, 09:10:01 am
It's me again and I just ant to say it's working now (thanks to 7226).
But it's odd: The particle effect appears just before the Orion/another ship explodes. Shouldn't the particles appear during the explosion?
Despite that, there are no errors/crashes anymore.
Title: Re: Particle trail script
Post by: m!m on June 03, 2011, 09:12:13 am
It is intended to be that way, you can adjust the moment the particles will be emitted, look at the documentation at the value "+Emitstate"
Title: Re: Particle trail script
Post by: Spoon on June 03, 2011, 09:19:14 am
Quote
all code in trunk     ... fail

Time to update this?  :p
Title: Re: Particle trail script
Post by: m!m on June 03, 2011, 09:26:19 am
Fixed  :p
Title: Re: Particle trail script
Post by: Deadly in a Shadow on June 03, 2011, 10:00:50 am
It is intended to be that way, you can adjust the moment the particles will be emitted, look at the documentation at the value "+Emitstate"
Thanks, looks marvelous.
Title: Re: Particle trail script
Post by: [Wolf]Maverick on June 04, 2011, 06:03:46 am
Hi,
could someone upload their particle config so us noobs doesn't have to create them themself? :)

Thanx
Title: Re: Particle trail script
Post by: Deadly in a Shadow on June 04, 2011, 06:44:38 am
Hi,
could someone upload their particle config so us noobs doesn't have to create them themself? :)

Thanx

Configuring that is very easy.
1.Copy the testeffect entry (particle.cfg) and paste it under the testeffect
2. change the name GTD Orion to GTC Fenris (just an example)
3. modify it as you want
4. watch a Fenris-class cruiser exploding with nice, crispy particles.

The only variables that are important for you: Size (the size of the particles), number (the number of the particles), emitstate (when the particles have to appear) and time (duration of the particles). The other variables are for more advanced pyro's
Title: Re: Particle trail script
Post by: m!m on June 06, 2011, 01:30:48 pm
New version with density adjusting uploaded. Short summary: Now you can modify the density of the trail by adding "+Density" to the trail definition. This takes a value that it 0 > x >= 1 that will then specify the trail density (0.5 means that the trail is half a dense meaning that every second frame a particle is created).
Title: Re: Particle trail script
Post by: Deadly in a Shadow on June 06, 2011, 01:34:29 pm
New version with density adjusting uploaded. Short summary: Now you can modify the density of the trail by adding "+Density" to the trail definition. This takes a value that it 0 > x >= 1 that will then specify the trail density (0.5 means that the trail is half a dense meaning that every second frame a particle is created).
It's time to make more screenshots.....
This will make the fireworks even more awesome.

Uh, it seems that something isn't working. When I start the game, I got two errors and another one during the mission loading.
When the Orion explodes, there are no trails. Even on standard density. I used the fresh .cfg from the download.

Unfortunately, I can't post a log because the nearly every debug build crashes when I put something into the debugger...

Title: Re: Particle trail script
Post by: Spoon on June 06, 2011, 04:41:51 pm
Error while processing file "particles.lua". Errormessage:
[string "particles.lua"]:556: 'end' expected (to close 'if' at line 554) near 'elsee'
ntdll.dll! NtWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
ntdll.dll! RtlInitUnicodeString + 356 bytes
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
fs2_open_3_6_13r_INF_SSE2-20110602_r7226.exe! <no symbol>
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes


is what im getting with the latest particle build
Title: Re: Particle trail script
Post by: m!m on June 07, 2011, 01:48:44 am
 :banghead: Argh, stupid typo. Download link updated.
Title: Re: Particle trail script
Post by: Spoon on June 09, 2011, 10:35:40 am
Latest version works quite nicely  :nod:
Excellent work m!m  :yes:
Title: Re: Particle trail script
Post by: Luis Dias on June 09, 2011, 02:16:54 pm
Shots?
Title: Re: Particle trail script
Post by: Deadly in a Shadow on June 10, 2011, 12:57:58 am
Shots?
You mean screenshots?
Title: Re: Particle trail script
Post by: 666maslo666 on June 10, 2011, 03:22:39 am
Shots?

Yeah, you dont have to tell me twice!!   :nod:

(http://gb.fotolibra.com/images/previews/743895-fruit-vodka-shots.jpeg)
Title: Re: Particle trail script
Post by: Nighteyes on June 16, 2011, 06:04:00 am
some problems I found while using the latest version of the script:
density dosnt work right, before it looked nicer, even with density set to 0 it dosent give a nice full trail like before.
is it possible to go below 1? (0.25,0.5)
trail size calculation isnt right, it goes according to the ship its used on, meaning if a big ship and a small ship both use the same trail, the actual size will be much smaller on the smaller ship as opposed to the size of the big ships particles...
Title: Re: Particle trail script
Post by: Spoon on June 16, 2011, 06:49:11 am
All size calculation is based on the size of the ship that is exploding. Actually makes a lot of sense to me. In the very least it prevents needing to have a lot of seperate trail entries!
Title: Re: Particle trail script
Post by: Nighteyes on June 16, 2011, 11:25:58 am
All size calculation is based on the size of the ship that is exploding. Actually makes a lot of sense to me. In the very least it prevents needing to have a lot of seperate trail entries!

in theory it makes sense, but in practice it doesn't work right, what would look good for a trail on a destroyer sized ship would look tiny on a cruiser, even when you would probably want more or less the same size of fire trail for both ship types, thus, making you to have a lot of separate trail entries...
Title: Re: Particle trail script
Post by: Nighteyes on June 16, 2011, 12:27:50 pm
Shots?
You mean screenshots?

here are a few, still working on it to make it look right:
(http://img824.imageshack.us/img824/1484/screen1779.jpg)

(http://img840.imageshack.us/img840/714/screen1780.jpg)

(http://img43.imageshack.us/img43/1948/screen1781.jpg)
Title: Re: Particle trail script
Post by: General Battuta on June 16, 2011, 12:28:59 pm
hmknnnnnnnnnnnnnnnnnnnnnnnghghgh
Title: Re: Particle trail script
Post by: Spoon on June 16, 2011, 01:16:02 pm
Good job Nighteyes, you just gave Battuta a heart attack  :yes:
Title: Re: Particle trail script
Post by: Snail on June 16, 2011, 01:27:15 pm
Good job Nighteyes, you just gave Battuta a heart attack  :yes:
We should totally do this more often.
Title: Re: Particle trail script
Post by: Angelus on June 16, 2011, 01:50:41 pm
Good job Nighteyes, you just gave Battuta a heart attack  :yes:
We should totally do this more often.

Giving Battuta heart attacks?
If so, how many can he survive?
Title: Re: Particle trail script
Post by: Psychonaut on June 16, 2011, 03:46:25 pm
Just played around a bit with the script.

If you like, copy this into the particle.cfg:

$Type:             Ship
$Class:             GTC Leviathan
   +Name:            TestEffect
   +Effect:          capflash
   +Time:             3.5
   +Emitstate:       1
   +Number:          30
   +Speed:          130, 180
   +Size:             1.5
   +Box Min:          0, 0, 0
   +Box Max:          0, 0, 0
   +Spewcone:          90, 90, 90
   +FPS:            3
   +Creation raycast:   YES
   +Raycast retries:   5

   +Trail:       GenericTrail

$Type:             Ship
$Class:             GTCv Deimos
   +Name:            TestEffect
   +Effect:          capflash
   +Time:             3
   +Emitstate:       1
   +Number:          30
   +Speed:          150, 200
   +Size:             1.5
   +Box Min:          0, 0, 0
   +Box Max:          0, 0, 0
   +Spewcone:          90, 90, 90
   +FPS:            3
   +Creation raycast:   YES
   +Raycast retries:   5

   +Trail:       GenericTrail


Overwrite the GenericTrail with this:

$Type: ParticleTrail
$Name: GenericTrail
   +Effect: Particlesmoke01
   +Size: 170
   +Delay: 0
   +Time: 4.5
   +Density: 0.9

Looks pretty nice to me. A good mission to test is "the sixth wonder" for example. Have fun.

BTW i tried to get a good looking particle trail for fighter-explosions, but the right entrys are difficult to find and it seems, that they appear only randomly. Any ideas?
Title: Re: Particle trail script
Post by: Dragon on June 16, 2011, 06:01:32 pm
Wow, what mod is that, Nighteyes?
Diaspora?
Title: Re: Particle trail script
Post by: General Battuta on June 16, 2011, 06:08:45 pm
Wow, what mod is that, Nighteyes?
Diaspora?

Yes
Title: Re: Particle trail script
Post by: m!m on June 18, 2011, 01:09:15 pm
I updated the first post with a new link, see changelog for change information.

Warning: I changed some internal structures of the script which may cause different behavior or bugs.
Title: Re: Particle trail script
Post by: chief1983 on June 20, 2011, 02:19:43 pm
Giving Battuta heart attacks?
If so, how many can he survive?

I dunno, Todd the Superfan (http://www.evtv1.com/player.aspx?itemnum=6263) had quite a few if I recall.
Title: Re: Particle trail script
Post by: m!m on June 23, 2011, 08:34:21 am
Just a quick teaser of a feature I'm currently working on:
(http://img148.imageshack.us/img148/5430/thrusterparticles.jpg)
Title: Re: Particle trail script
Post by: Commander Zane on June 23, 2011, 08:43:10 am
Oh lol. Epic for what it is and funny from what it's coming from at the same time.
Title: Re: Particle trail script
Post by: m!m on June 24, 2011, 08:47:56 am
Ship/Weapon trails are done I just need to add it to the documentation, until then:
(http://img713.imageshack.us/img713/6549/afterburnertrail.jpg)
(http://img851.imageshack.us/img851/2642/weapontrail.jpg)
Title: Re: Particle trail script
Post by: Dragon on June 24, 2011, 12:10:11 pm
Does this also include damage trails (the ones I PMed you about)?
The effects you showed look great, BTW.
Title: Re: Particle trail script
Post by: m!m on June 24, 2011, 12:23:05 pm
No, currently not but I'm working on it :nod:

EDIT: Ok, it's working...
Title: Re: Particle trail script
Post by: Commander Zane on June 24, 2011, 01:02:32 pm
Ship/Weapon trails are done I just need to add it to the documentation, until then:
*Img*
*Img*
HNNNNNNNGGGGGGG

:jaw:
Title: Re: Particle trail script
Post by: m!m on June 25, 2011, 05:34:24 am
Ok everything done. First post has been updated with the new version!
Title: Re: Particle trail script
Post by: Dragon on June 25, 2011, 06:38:57 am
Fantastic work, M!M.
Now I found at least two interesting functions that could be added to this script.
1. Ejection seats, allowing defining the seat model, it's thruster effects, ejection likelihood,  amount of seats and their spawning location on a per-ship basis (it'd also allow making ejection pods on capships).
2. Debris trails, as a replacement for the current, limited system. It'd be great to be able to set them on a per-ship basis.
Are these things possible to incorporate into this script?
Title: Re: Particle trail script
Post by: m!m on June 25, 2011, 06:44:28 am
Fantastic work, M!M.
Now I found at least two interesting functions that could be added to this script.
1. Ejection seats, allowing defining the seat model, it's thruster effects, amount of seats and their spawning location on a per-ship basis (it'd also allow making ejection pods on capships).
2. Debris trails, as a replacement for the current, limited system. It'd be great to be able to set them on a per-ship basis.
Are these things possible to incorporate into this script?
1. I don't think that this script would be suited to have this feature but I could very well think of a separate script that could do this.
2. Could be done but I currently don't know how to get the required values (shipclass of the debris original object) , I may need to check the existing medivps script.
Title: Re: Particle trail script
Post by: Dragon on June 25, 2011, 08:01:18 am
FSO displays information about ship class in targetbox if you target a piece of debris, so the info should be accessable.
Title: Re: Particle trail script
Post by: Nighteyes on July 03, 2011, 07:15:19 am
another idea I have is generating particles when a specific type of weapon hits, the particles would generate from the hull of the ship flying outwards to space, with option to adjust speed, life, spread... I'm not sure how possible it is to make the generating point stick on the ship where the weapon impacted...
can be used to have smoke and fire emmit for a few seconds/minutes after a ship got hit by a massive warhead
Title: Re: Particle trail script
Post by: m!m on July 03, 2011, 07:24:56 am
another idea I have is generating particles when a specific type of weapon hits, the particles would generate from the hull of the ship flying outwards to space, with option to adjust speed, life, spread... I'm not sure how possible it is to make the generating point stick on the ship where the weapon impacted...
can be used to have smoke and fire emmit for a few seconds/minutes after a ship got hit by a massive warhead
That would be possible but a major problem I see is that there is no possibility to get
This information is available but adding the required functions to the scripting interface is something I can't do with my very limited C++ experience :(
Title: Re: Particle trail script
Post by: Nighteyes on July 03, 2011, 07:37:54 am
I also just tested the +Fixed Size, and it looks like its only implemented on the ship particles, and not(more importantly) on the trail particles, can it also be added on trail particles please?
Title: Re: Particle trail script
Post by: mjn.mixael on July 03, 2011, 08:18:10 am
I coulda sworn we already had a script that does that.
Title: Re: Particle trail script
Post by: m!m on July 03, 2011, 09:12:50 am
I also just tested the +Fixed Size, and it looks like its only implemented on the ship particles, and not(more importantly) on the trail particles, can it also be added on trail particles please?
Link in first post updated, should be working now :nod:

I coulda sworn we already had a script that does that.
That does what?
Title: Re: Particle trail script
Post by: Commander Zane on July 03, 2011, 09:41:56 am
If it's in reference to engine trails, there was something shown on the celebration thread with a Lao'Tze before WiH was released for particles emitted with afterburner enabled, but it never went past those screenshots. At least I imagine that's what is being mentioned.
Title: Re: Particle trail script
Post by: m!m on July 03, 2011, 10:15:54 am
Ah I remember that. I never thought about that but it seems that it does exactly what this script does :lol:
Title: Re: Particle trail script
Post by: Nighteyes on July 03, 2011, 11:58:50 am
I tested the fixed size for the trail particles and it still doesnt work :/
also for reference of impact particles maybe you can take a look at the code that generates the small particles when you fire on a ship? the script im asking for does exactly that, just with option to use different effects other than particlesmoke01, with size and amount of particles...
Title: Re: Particle trail script
Post by: m!m on July 03, 2011, 12:21:01 pm
I uploaded a new version where the fixed size should work.
Also I know exactly where the needed information is saved but I just don't have the coding ability to add the needed interface functions :blah:
Title: Re: Particle trail script
Post by: Reprobator on July 17, 2011, 04:05:54 pm
Can someone upload the script please? the link in the first page is dead.
Title: Re: Particle trail script
Post by: m!m on July 18, 2011, 01:46:32 am
I already uploaded a new version of the script only to notice that it required a custom FSO build. I already posted the patch (http://www.hard-light.net/forums/index.php?topic=44821.msg1532010#msg1532010) to be committed to SVN so please wait until the patch has been committed :nod:
Title: Re: Particle trail script
Post by: Reprobator on July 18, 2011, 01:48:32 am
Ok m!m i'll wait for the green light!
Title: Re: Particle trail script
Post by: Luis Dias on July 18, 2011, 12:16:54 pm
How are the explosions right now? Still one single salvo of multiple trails, or is there a more complex beautiful design?
Title: Re: Particle trail script
Post by: m!m on July 18, 2011, 12:20:15 pm
How are the explosions right now? Still one single salvo of multiple trails, or is there a more complex beautiful design?
I'm not exactly sure what you mean with "more complex beautiful design" but think I must disappoint you as I haven't changed anything but you can create quite complex effects by stacking multiple effects on top of each other and adding custom time offsets and lengths. :nod:
Title: Re: Particle trail script
Post by: Luis Dias on July 18, 2011, 12:29:48 pm
Yes, I thought of that as well. It sucks that I understand zip about these script things. They don't seem overtly complicated however (at least to read them and to make some copy pastes :)). When I get the time, I would enjoy tweaking them to my own pleasure, and I'll ask for help then ;). Anyways, lots of amazing possibilities arise due to this awesomeness, so thanks!
Title: Re: Particle trail script
Post by: The E on July 18, 2011, 12:59:00 pm
I already uploaded a new version of the script only to notice that it required a custom FSO build. I already posted the patch (http://www.hard-light.net/forums/index.php?topic=44821.msg1532010#msg1532010) to be committed to SVN so please wait until the patch has been committed :nod:

Patch is in as of revision 7354.
Title: Re: Particle trail script
Post by: m!m on July 18, 2011, 12:59:54 pm
Thank you very much :)

EDIT: First post updated with new link
Title: Re: Particle trail script
Post by: Dragon on July 18, 2011, 03:13:56 pm
One complaint about documentation. The code for defining custom config files is split between two pages, making copypasting it impractical.
Title: Re: Particle trail script
Post by: Luis Dias on July 18, 2011, 04:52:12 pm
I'm ready to lose my virginity on scripts. Is there any kind of written guidelines where I should start, i.e., where should I download the scripts (I mean, where should I put them, how should I arrange them), how they work (heads up), etc.? Or is there an intended vacuum to prevent noobs like me to **** up their installation?
Title: Re: Particle trail script
Post by: m!m on July 19, 2011, 01:52:43 am
I'm ready to lose my virginity on scripts. Is there any kind of written guidelines where I should start, i.e., where should I download the scripts (I mean, where should I put them, how should I arrange them), how they work (heads up), etc.? Or is there an intended vacuum to prevent noobs like me to **** up their installation?
When I started to do lua scripting I read through this wiki page (http://www.hard-light.net/wiki/index.php/FS2_Open_Lua_Scripting) but I don't know if the tutorial is still up to date.

One complaint about documentation. The code for defining custom config files is split between two pages, making copypasting it impractical.
I'll upload an updated version later today :nod:
EDIT: Done :P
Title: Re: Particle trail script
Post by: Reprobator on July 19, 2011, 02:26:23 am
i can't wait for the nightly to be released :D
Title: Re: Particle trail script
Post by: Luis Dias on July 19, 2011, 09:36:32 am
Thank you m!m I'll give it a look in the eve
Title: Re: Particle trail script
Post by: Trivial Psychic on July 19, 2011, 09:50:10 am
I don't do scripting... in fact when I tried to wrap my brain around it a couple of years ago, it gave me insomnia.  In any case, while I have thus avoided trying to make sense of this child board, I was impressed with the ship explosion effects as displayed earlier in this thread, so I downloaded the scripts.  After browsing through them for recognizable keywords, I have concluded that these scripts allow the inclusion of some fields to ship and weapons table files with which to create these impressive effects, rather than enable them for each ship by default, scaled based on ship size.  Is this a correct assumption?
Title: Re: Particle trail script
Post by: Spoon on July 19, 2011, 10:15:45 am
The nice part about this forum is that the scripting is done by people who actually know how to script (quite unlike me!)
Actually editing and adding to this script is as easy as doing weapons or ship tables.
Title: Re: Particle trail script
Post by: m!m on July 19, 2011, 10:29:14 am
I don't do scripting... in fact when I tried to wrap my brain around it a couple of years ago, it gave me insomnia.  In any case, while I have thus avoided trying to make sense of this child board, I was impressed with the ship explosion effects as displayed earlier in this thread, so I downloaded the scripts.  After browsing through them for recognizable keywords, I have concluded that these scripts allow the inclusion of some fields to ship and weapons table files with which to create these impressive effects, rather than enable them for each ship by default, scaled based on ship size.  Is this a correct assumption?
Yes that assumption is correct and the rest of the creation code is also quite trivial. I also appreciate that someone else takes a look at my code and I'll gladly answer any code-related question :nod:

The nice part about this forum is that the scripting is done by people who actually know how to script (quite unlike me!)
Actually editing and adding to this script is as easy as doing weapons or ship tables.
For the record: I actually hate the programming language Lua but you can make so many awesome stuff with it an FSO and when you know how to add to the existing scripting API you can do virtually anything that is not already implemented in the engine  :cool:
Title: Re: Particle trail script
Post by: Luis Dias on July 19, 2011, 04:07:05 pm
noob question: the only thing I have to do in order to get the script going is to treat it like a mod, that is, download it to a folder and then select it in the launcher? The wiki underestimates noobiness in this regard....

(Edit: yes, it seems to work this way....)
Title: Re: Particle trail script
Post by: m!m on July 20, 2011, 05:19:23 am
Yes, it will work that way but you can also just unzip it into a mod folder of your choice if you want that this mod can have these effects.

EDIT: Oh, and I would like to leave a note here that I got back to the hit normal feature and got it working with a few changes to the FSO code. Still testing it but it looks very promising :p
Title: Re: Particle trail script
Post by: m!m on July 21, 2011, 12:29:18 pm
I have a quick preview of what I'm currently working on:
(http://img832.imageshack.us/img832/4508/scripthiteffect.jpg)
Nothing too spectacular but it's essential for some very cool effects :cool:
Title: Re: Particle trail script
Post by: Commander Zane on July 21, 2011, 12:33:53 pm
Projectile backblast? Do want.
Title: Re: Particle trail script
Post by: Trivial Psychic on July 21, 2011, 07:22:23 pm
Are those part of the death-roll or due to weapon impacts or subsystems being destroyed?
Title: Re: Particle trail script
Post by: Spoon on July 21, 2011, 07:41:58 pm
Particle spawning on weapon impacts? sweet
Title: Re: Particle trail script
Post by: Trivial Psychic on July 22, 2011, 01:33:56 am
Some time ago, I made a suggestion in the SCP forum for what I called "Persistent Damage Explosions", which is a fancy way of saying that when a ship gets hit (particularly with something heavy), rather than simply having the weapon explosion followed by some thin particles spewing from the impact area, it would also have almost continuous explosion effects that hug the hull in the region of the impact.  That way, severely damaged ships would actually LOOK like they're in that state, rather than just damage lightning.  Think of Babylon 5, Season 3, "Severed Dreams", with either the Churchill or Roanoke spewing fire from heavily damaged sections as they're about to go down.  I'm not talking about flames rising away from the ship like they would in an atmosphere... that'd be just plain stupid.  I suggested that for large weapon impacts, the effect would consist of a series of large inter-meshing explosion effects, with smaller ones along the perimeter.  Over time, the total effect of the fire area would shrink as the oxygen from the ship in that area is used up.  Any chance you guys could simulate that with scripting... or has it already been done?
Title: Re: Particle trail script
Post by: m!m on July 22, 2011, 05:20:30 am
Are those part of the death-roll or due to weapon impacts or subsystems being destroyed?
Those effects have been created for weapon impacts which is nothing overly new but the new thing is that now it is possible to use normal of the polygon where the projectile impacted.

I'm not talking about flames rising away from the ship like they would in an atmosphere... that'd be just plain stupid.  I suggested that for large weapon impacts, the effect would consist of a series of large inter-meshing explosion effects, with smaller ones along the perimeter.  Over time, the total effect of the fire area would shrink as the oxygen from the ship in that area is used up.  Any chance you guys could simulate that with scripting... or has it already been done?
Something like that was the actual intention I had when I implemented that new feature and I plan to do implement that kind of effects next.
Title: Re: Particle trail script
Post by: Trivial Psychic on July 27, 2011, 10:12:20 pm
So I've been doing some experimentation with the scripts pack, testing out some settings to make a plausible effect.  For a number of FS2 cap-ships, I've given them each two explosion effects, one using emitstate 3 for an eruptive explosion when the ship blows, and another using state 2 for the deathroll.  Unfortunately, I can't seem to simulate the effect that I'd like for the later.  I'd like it so explosions spawn from all over the ship, but I may be miss-interpreting the min and max box parameters, which is leading to the particles being generated from the ship's center only.  If I try to expand the size, it starts spawning particles from outside the hull, or worse spawning them outside the hull but them shooting them back towards the hull and out the other side.  It makes it look quite silly for a ship such as the Hades, which is quite thin compared to its overall length, so the explosions are being generated from only one small area of the hull.  Am I not interpreting the box controls properly or is this something that can't be controlled in the scripts present state?  Ideally, I'd like to have the particles spawned from the random and hardcoded deathroll surface explosions.
Title: Re: Particle trail script
Post by: m!m on July 28, 2011, 04:47:29 am
Ideally, I'd like to have the particles spawned from the random and hardcoded deathroll surface explosions.
Surface explosions can't be accessed by the current scripting interface but you can achieve a similar effect by using "+Creating raycast" with "+Offset" set to some interesting part of the ship and then using "+Box Min/Max" to specify the boundaries of the ray check. You may want to add more of these effects for different parts of the ship.
I could also add an option that would change the velocity of the particles so they always move away from the specified center which would prevent the particles from moving back through the hull.
Title: Re: Particle trail script
Post by: Trivial Psychic on July 28, 2011, 06:22:43 pm
So I'd have to set up multiple effects entries?  I was hoping that there was an option to increase the box controls to encompass the entire model, but have the effects only spawned from within the actual model's perimeter.  Would the offset option always use the same distance and direction from the center or would it choose a random direction offset with the selected distance.  Also, I think that I could use some more explanation of what the raycast option does... if you please.
Title: Re: Particle trail script
Post by: Reprobator on July 29, 2011, 02:20:21 am
i wonder if we could use this script to make death ray beam style like we see in the following video @ 0:48 ?

http://www.youtube.com/watch?v=C9WcsZF4Peg&feature=relmfu
Title: Re: Particle trail script
Post by: Nighteyes on July 29, 2011, 04:22:29 pm
So I'd have to set up multiple effects entries?  I was hoping that there was an option to increase the box controls to encompass the entire model, but have the effects only spawned from within the actual model's perimeter.  Would the offset option always use the same distance and direction from the center or would it choose a random direction offset with the selected distance.  Also, I think that I could use some more explanation of what the raycast option does... if you please.

a small explenation, make the box size really big, so it will cover the entire ship for sure, than use raycast option with YES...
basically this will send "rays" to collide with the hull of the ship, the collision is where the particles will spawn, so use this feature together with a big bounding box and you will get particles spawning from all parts of the ship.
Title: Re: Particle trail script
Post by: Trivial Psychic on July 29, 2011, 06:17:08 pm
The config I'm using had +Creation raycast set to "YES" by default with +Raycast retries set to 5.  Should I set this number to something insanely high to prevent the explosions-outside-the-ship effect?  Also, for the box settings, do the three figures represent xyz distances for the box diameter?  So if I used 50 60 70, then the box would be 100 wide, 120 tall, and 140 long, right?  Also, the config file I started with had the max box set to 200 200 0, and the min box set to -200 -200 0.  Will this cause the effects to be created on the surface of a 400 by 400 by 0 box, and not within it?
Title: Re: Particle trail script
Post by: m!m on July 31, 2011, 07:50:46 am
The config I'm using had +Creation raycast set to "YES" by default with +Raycast retries set to 5.  Should I set this number to something insanely high to prevent the explosions-outside-the-ship effect?  Also, for the box settings, do the three figures represent xyz distances for the box diameter?  So if I used 50 60 70, then the box would be 100 wide, 120 tall, and 140 long, right?
The Box values describe a volume that is defined by the two vectors you specify. So if you specify "100, 100, 100" and "-100, -100, -100" is would mean that the real position of the created particle will be inside the volume which is defined by the two vectors. That means that the X, Y and Z values of the resulting position vector will be randomized where each value will be between the vector values of the specified box vectors.
You also don't need to add the "+Raycast retries" option unless you see a message inside your fs2_open.log which says that no position for a particle could be found which will only happen if you have a very complicated model where a random ray is likely to miss.

Also, the config file I started with had the max box set to 200 200 0, and the min box set to -200 -200 0.  Will this cause the effects to be created on the surface of a 400 by 400 by 0 box, and not within it?
Actually if you use these values the particles will be created on a plane rather than inside a box as the resulting position of the particle can only have a Z value if 0.
Title: Re: Particle trail script
Post by: Spoon on August 01, 2011, 09:38:33 am
Not completely related but I figured this would be as good of a place as any to ask.
m!m do you have any clue if its easy/possible to spawn particles on weapon fire (muzzleflashes)?

If yes to both and if you are feeling bored/have too much free time. Would you be willing to take a shot at that?  :D
Title: Re: Particle trail script
Post by: Dragon on August 01, 2011, 09:51:55 am
This could indeed come in handy, for example for a large torpedo takeoff with smoke coming out of the launcher.
Title: Re: Particle trail script
Post by: Spoon on August 01, 2011, 11:27:50 am
If you could define a negative velocity for it, it could be used for backlash from rocketlaunchers too.
Title: Re: Particle trail script
Post by: m!m on August 01, 2011, 12:06:17 pm
Not completely related but I figured this would be as good of a place as any to ask.
m!m do you have any clue if its easy/possible to spawn particles on weapon fire (muzzleflashes)?

If yes to both and if you are feeling bored/have too much free time. Would you be willing to take a shot at that?  :D
Yes and it's even quite simple to do, sadly I won't be able to extend the script for the next three weeks as I'm not at home and I'm still waiting for my patch (http://www.hard-light.net/forums/index.php?topic=44821.msg1533160#msg1533160) to be reviewed. But in general it rather easy to detect if a weapon has been created in the current frame and then create the specified effect.

If you could define a negative velocity for it, it could be used for backlash from rocketlaunchers too.
The script doesn't differentiate between negative and positive velocity entries so it should work just fine.
Title: Re: Particle trail script
Post by: Spoon on August 01, 2011, 12:16:13 pm
Sweet sauce

I'll just be patiently waiting until you return home and eventually get around to it (:
Title: Re: Particle trail script
Post by: Trivial Psychic on August 01, 2011, 10:43:25 pm
The config I'm using had +Creation raycast set to "YES" by default with +Raycast retries set to 5.  Should I set this number to something insanely high to prevent the explosions-outside-the-ship effect?  Also, for the box settings, do the three figures represent xyz distances for the box diameter?  So if I used 50 60 70, then the box would be 100 wide, 120 tall, and 140 long, right?
The Box values describe a volume that is defined by the two vectors you specify. So if you specify "100, 100, 100" and "-100, -100, -100" is would mean that the real position of the created particle will be inside the volume which is defined by the two vectors. That means that the X, Y and Z values of the resulting position vector will be randomized where each value will be between the vector values of the specified box vectors.
You also don't need to add the "+Raycast retries" option unless you see a message inside your fs2_open.log which says that no position for a particle could be found which will only happen if you have a very complicated model where a random ray is likely to miss.

Also, the config file I started with had the max box set to 200 200 0, and the min box set to -200 -200 0.  Will this cause the effects to be created on the surface of a 400 by 400 by 0 box, and not within it?
Actually if you use these values the particles will be created on a plane rather than inside a box as the resulting position of the particle can only have a Z value if 0.
OK.  I decided to adjust the figures that I had to try to expand the area where the particles were being spawned from.  I took the -200, -200, 0 and 200, 200, 0 that I had started with (which were in the config file that shipped with the scripts package) and replaced the "0"'s with -900 and 900 respectively.  At first things looked good, and from a side view the explosions were coming from most of the length of the Orion.  Unfortunately, when I chose an overhead view, I saw that explosions were spawning well out to the sides of the ship.  If the third figure in each set is the Z figure, then this shouldn't affect the left-to-right positioning of the spawn space.  What am I doing wrong?  :confused:
Title: Re: Particle trail script
Post by: m!m on August 02, 2011, 04:17:15 am
OK.  I decided to adjust the figures that I had to try to expand the area where the particles were being spawned from.  I took the -200, -200, 0 and 200, 200, 0 that I had started with (which were in the config file that shipped with the scripts package) and replaced the "0"'s with -900 and 900 respectively.  At first things looked good, and from a side view the explosions were coming from most of the length of the Orion.  Unfortunately, when I chose an overhead view, I saw that explosions were spawning well out to the sides of the ship.  If the third figure in each set is the Z figure, then this shouldn't affect the left-to-right positioning of the spawn space.  What am I doing wrong?  :confused:
The left-to-right positioning is caused by the X range of -200 to 200. If you don't the particles to spawn to the sides of the ship then you have to set both coordinates to 0 to avoid this effect.
Also, do you have "+Creation raycast" set to YES?
Title: Re: Particle trail script
Post by: Nighteyes on August 02, 2011, 07:56:25 am
IMO a small change to the script is needed here, remove the bounding boxs completely, and leave us only with 2 options:
1. particles emmit from the  center(or a specific location, set by coordinates, 0,0,0 would mean the center of the ship) of the ship(raycast set to NO)
2. particles emmit from all over the hull(raycast set to YES)

I cant really see a point in emmiting particles from a place outside the ship... and I doubt anyone will ever use this to emmit particles only from a certain point of a ship...
Title: Re: Particle trail script
Post by: Dragon on August 02, 2011, 12:04:26 pm
I think that this could be usefull, for ships like Hades for instance, if you'd want particles to spew from engine blocks.
Title: Re: Particle trail script
Post by: m!m on August 02, 2011, 12:32:29 pm
IMO a small change to the script is needed here, remove the bounding boxs completely, and leave us only with 2 options:
1. particles emmit from the  center(or a specific location, set by coordinates, 0,0,0 would mean the center of the ship) of the ship(raycast set to NO)
2. particles emmit from all over the hull(raycast set to YES)

I cant really see a point in emmiting particles from a place outside the ship... and I doubt anyone will ever use this to emmit particles only from a certain point of a ship...
I don't think that removing that option is a good idea as it can still be used to limit the raychecks to a specific area of the ship. What could be useful is a new option that would set the bounding box options automatically to the bounding box of the ship essentially causing the effects to be spawned from all over the hull when raycast is set to YES or just out of space when it is unspecified or set to NO.
Title: Re: Particle trail script
Post by: Trivial Psychic on August 02, 2011, 06:10:45 pm
My name is The Trivial Psychic and I support this idea... which means that I think that its good and useful but can't actually do anything to further its creation or development.  :yes:

[Edited rather than posting again]
I have done further experimentation with increasing the Z figure (again, assuming that the 3rd figure in each box line is the Z distance) and have concluded that the code automatically tries to make the spawning area into a square, overriding the X distance that has been inputted.  Now, I say a "square", rather than a "cube", as it appears to respect the designated Y figures.  I even tried to make two spawn regions, one that extended 900-Z forward and 200 aft, and another that was 200 forward and 900 aft, and it still had the same result.  I'm hoping that the proposed auto-surface-explosions option becomes a reality, as I really think that combined deathroll mini-bangs and moment-of-death mega-bang particle spawning would make a welcome graphical addition to the Media VPs... if a way can be found to make them less memory-taxing.  :yes:
Title: Re: Particle trail script
Post by: Dragon on August 07, 2011, 05:11:25 pm
With this entry:

$Type:                Ship
$Class:             DD Ranger
   +Name:            Ranger
   +Effect:          ExpFlash
   +Time:             3
   +Emitstate:          2
   +Number:          80, 120
   +Speed:          35, 105
   +Size:             0.5, 2
   +Box Min:          -200, -200, -400
   +Box Max:          200, 200, 400
   +Spewcone:          90, 90, 90
   +FPS:            1, 3
   +Creation raycast:      YES
   +Raycast retries:      5
   +Trail:          ExplosionTrail
   
I've seen particles spawning outside the ship's hull.
The ship in question is about 250m tall, 250m wide and 700m long.
Also, "weapon" type doesn't seem to work,it always randomly spew dinky particles flying in corkscrew pattern (really!), regardless of actual settings.
EDIT: These dinky particles I mentioned turned out to be trails from tiny debris spawn when hitting ship's hull. So, "weapon" type simply does nothing.
Title: Re: Particle trail script
Post by: m!m on August 08, 2011, 08:23:13 am
With this entry:

$Type:                Ship
$Class:             DD Ranger
   +Name:            Ranger
   +Effect:          ExpFlash
   +Time:             3
   +Emitstate:          2
   +Number:          80, 120
   +Speed:          35, 105
   +Size:             0.5, 2
   +Box Min:          -200, -200, -400
   +Box Max:          200, 200, 400
   +Spewcone:          90, 90, 90
   +FPS:            1, 3
   +Creation raycast:      YES
   +Raycast retries:      5
   +Trail:          ExplosionTrail
   
I've seen particles spawning outside the ship's hull.
The ship in question is about 250m tall, 250m wide and 700m long.
The entry looks fine so the only reason I could imagine that particles spawn outside the ship could be that there is a bug in the script but I couldn't find anything that could cause your problems after a quick look at the script. I'm sorry but you will have to wait until I have a properly working FreeSpace install again which will in in less than two weeks.

Also, "weapon" type doesn't seem to work,it always randomly spew dinky particles flying in corkscrew pattern (really!), regardless of actual settings.
EDIT: These dinky particles I mentioned turned out to be trails from tiny debris spawn when hitting ship's hull. So, "weapon" type simply does nothing.
It worked when I did the last updates to the script which are still unreleased and it could be that the type could be broken in the version that is available to download. I will release the update as soon as possible as the necessary code is in trunk already.
You could post your entry here maybe there is a mistake inside it which prevents that the particles spawn properly
Title: Re: Particle trail script
Post by: Dragon on August 08, 2011, 08:30:22 am
The entry was identical to one you provided in example config.
Title: Re: Particle trail script
Post by: m!m on August 08, 2011, 10:21:54 am
:banghead: You are right. In the current version the number of particles to be spawned still is calculated as particles per second which means that the specified 1 to 8 particles per second won't spawn as the effect is only active for one frame. You could try to increase the "+Number" value that should, at least temporary, fix this issue. It will also be fixed in the next version.
Title: Re: Particle trail script
Post by: Dragon on August 10, 2011, 09:18:45 am
Code: [Select]
$Type: Weapon
$Class: MDU-57
+Effect: ExpFlash
+Time: 1
+Number: 9, 10
+Speed: 600, 800
+Size: 5, 10
+Spewcone: 90, 90, 90
+Add Velocity: NO
+Trail: ExplosionTrail

This still doesn't spew any particles.
Also, when one of multiple engines is disabled and thruster glow extinguishes, the particles remain.

BTW, could you add an option to define offset of a ship trail?
I also thought about a +contrail field, which would allow a trail to be enabled only if contrails are enabled in mission. It could have 3 possible values: NO (no dependancy) YES (when contrails are on) and DISABLE (enabled by default, disabled the contrails are enabled).
Title: Re: Particle trail script
Post by: m!m on August 10, 2011, 11:30:02 am
Code: [Select]
<snip>
This still doesn't spew any particles.
With a framerate of 60 FPS you would need to set the number to 60 so one particle would be created. As noted before this will be fixed in the next version.

Also, when one of multiple engines is disabled and thruster glow extinguishes, the particles remain.
I noticed that too but I currently don't know how get the associated engine subsystem but I can change the script so the particles stop spawning when all engine subsystems are destroyed.

BTW, could you add an option to define offset of a ship trail?
Yes, that's possible.

I also thought about a +contrail field, which would allow a trail to be enabled only if contrails are enabled in mission. It could have 3 possible values: NO (no dependancy) YES (when contrails are on) and DISABLE (enabled by default, disabled the contrails are enabled).
I don't know if the scripting interface offers access to this kind of information but it could be possible to be added.
Title: Re: Particle trail script
Post by: Dragon on August 10, 2011, 01:28:39 pm
It would be great if this was added, as this would allow particle contrails, like in FreeFalcon. Also, contrails is just about the only thing this script can't yet replace with particle trails. One of my new ideas for Aces High reboot would be to ditch bitmap trails almost completely, at least in the "advanced" version (if everything goes as planned, the only use for trail bitmaps would be cannon tracers).
BTW, the script would also benefit greatly from allowing +Density: to be used on ship and weapon trails.
Title: Re: Particle trail script
Post by: m!m on August 11, 2011, 05:16:11 am
It would be great if this was added, as this would allow particle contrails, like in FreeFalcon. Also, contrails is just about the only thing this script can't yet replace with particle trails. One of my new ideas for Aces High reboot would be to ditch bitmap trails almost completely, at least in the "advanced" version (if everything goes as planned, the only use for trail bitmaps would be cannon tracers).
BTW, the script would also benefit greatly from allowing +Density: to be used on ship and weapon trails.
You must be careful with the excessive use of particles as the performance of particles if FSO is awful. The script can be configured so it won't spawn new particles and cuts down the calculations of the script if the framerate is below a given value.
Density manipulation will be added when I'm back home :nod:
Title: Re: Particle trail script
Post by: Dragon on August 11, 2011, 05:22:34 am
I know about performance issues, that's why I said it'd be in advanced version. Also, particles in FSO tend to look bad at lower framerates. I think that bitmap trails could be used "under" particles, which will stop spewing once framerate drops to the "ugly" point.
Title: Re: Particle trail script
Post by: Dragon on August 12, 2011, 12:53:46 pm
I've just found that when using large thruster flames for ships, they look weird.
(http://img806.imageshack.us/img806/754/strangeflame.th.png) (http://imageshack.us/photo/my-images/806/strangeflame.png/)
It looks as if instead spawning in the center of the thruster point, particles are created in random points in the entire radius, resulting in them sometimes being created at the very edge of the point, which looks weird. Could you implement some way to prevent them from doing that? I'd like to create a more or less uniform thruster flame, without an occasional particle "escaping" from the main flow.
Title: Re: Particle trail script
Post by: m!m on August 12, 2011, 02:02:53 pm
I was aware of this bug for some time but never got around to add way of "fixing it". I'll add an option to modify the radius in which the particles are created so you could set it to 0.5 and the particles will be created in only half the thruster radius. Would that be enough?
Title: Re: Particle trail script
Post by: Dragon on August 12, 2011, 02:15:38 pm
That'll do, it'd be nice to have yet another value to customize.
Title: Re: Particle trail script
Post by: m!m on August 19, 2011, 04:16:38 am
New version is in first post, please make sure that you have a correct nightly build but that shouldn't be a problem anymore just use the latest.
Title: Re: Particle trail script
Post by: m!m on August 22, 2011, 04:45:30 am
Double post! :D
The new version should have all requested features that don't require large code changes. If you want to use "+Use Ray normal" you have to use a build with the patch in the changelog.
Title: Re: Particle trail script
Post by: Dragon on August 23, 2011, 06:06:43 pm
You forgot about the offset for a ship engine trail (wouldn't hurt for weapon and particle trails, too).
BTW, would it be possible to define if the weapon needs to hit for particles to spawn (I.E. if the self-destruction emits particles)?
If you could add that and an ability to define an absolute normal for particle emission (as in, regardless of how and where the weapon explodes, particles will use the same, absolute normal), I'd be able to make a real mushroom cloud effect. Of course, they'd be useful not only for that, the former being great for making sure that if a missile self-destructs, fiery shards (supposed to come from the hull) won't appear, while the latter could be used for a lot of atmospheric explosion effects, where particles are supposed to go up even when they hit on the side of a hill, instead of sideways.
Title: Re: Particle trail script
Post by: m!m on August 24, 2011, 03:16:35 am
+Offset has been added. I'm sorry but AFAIK there is no way to tell whether the weapon self-destructed or impacted. Scripting only gets notified that a weapon got removed from the game or that it impacted so I'm not sure if that is possible.
I'll look into your absolute orientation request but I'm currently working on another script so that will have to wait until I come back to the ParticleScript.
Title: Re: Particle trail script
Post by: Dragon on August 24, 2011, 06:15:21 am
OK, I'm looking forward to it.
Good to know about +Offset, as it's neither in changelog nor documentation.
Title: Re: Particle trail script
Post by: m!m on August 24, 2011, 01:16:45 pm
Well, ok I came back to the script :rolleyes:
Added "+Absolute Normal" and a few global options. There is now an easy way to add additional configuration files to the config. You just specify "$Include: <filename>" and that file gets parsed too.
Warning: There is no check for recursion!
Title: Re: Particle trail script
Post by: Dragon on August 24, 2011, 02:37:58 pm
Awesome, expect either screens of a nuke explosion working in FS, or another feature request soon.  :)
EDIT: I've installed the new version of the script and tried to add a nuke, but an error popped up (on release build) and I don't know what I did wrong.
Code: [Select]
Invalid input type "number" should be "string"
stack traceback:
[string "zmisc-sct.tbm - On Game Init"]:14: in function 'stackError'
[string "zmisc-sct.tbm - On Game Init"]:30: in function 'stackErrorf'
[string "converter.lua"]:54: in function '__doConvert'
[string "converter.lua"]:78: in function 'convert'
[string "parser.lua"]:49: in function 'convert'
[string "particleParser.lua"]:1003: in function 'func'
[string "parser.lua"]:216: in function 'handle'
[string "parser.lua"]:248: in function 'handleKeyValue'
[string "particleParser.lua"]:46: in function 'handleKeyValue'
[string "parser.lua"]:239: in function 'processLine'
[string "parser.lua"]:124: in function 'parseFile'
[string "deathPart-sct.tbm - On Game Init"]:61: in function '__doParse'
[string "deathPart-sct.tbm - On Game Init"]:41: in function 'parseConfigFiles'
[string "deathPart-sct.tbm - On Mission Start"]:1: in main chunk

ntdll.dll! KiFastSystemCallRet
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
<no module>! <no symbol>
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
Only these entries had really been changed/added.
Code: [Select]
$Type: Weapon
$Class: MDU-42
+Effect: ExpFlash
+Time: 1
+Number: 3, 5
+Speed: 600, 800
+Size: 5, 10
+Spewcone: 90, 90, 90
+Add Velocity: NO
+Trail: ExplosionTrail
+Use Normal: YES
+Emit Vector: 0, 0, 1
+Emit Variance: 0.3


$Type: Weapon
$Class: AG-132
+Weapon: NukeCloud
+Time: 1
+Number: 1
+Speed: 10000
+Size: 100
+Add Velocity: NO
+Trail: NukeTrail
+Use Normal: YES
+Absolute Normal: 0, 1, 0
+Emit Vector: 0, 0, 1
$Type: Weapon
$Class: NukeCloud
+Effect: ParticleSmoke01
+Time: 10
+Number: 200
+Speed: 1000
+Size: 100
+Spewcone: 90, 90, 90
+Add Velocity: NO
+Trail: NukeTrail
+FPS: 94

$Type: Ship
$Class: DD Ranger
+Name: Ranger
+Effect: ExpFlash
+Time: 1
+Emitstate: 2
+Number: 80, 120
+Speed: 200, 400
+Size: 0.5, 2
+Box Min: -100, -100, -300
+Box Max: 100, 100, 300
+Spewcone: 30, 30, 30
+FPS: 20, 30
+Emit from hull
+Use Ray normal
+Move Outwards
+Trail:
 
The log looks like that:
Code: [Select]
LibraryManager: Reloading all loaded libraries
LibraryManager: Loaded file "class.lua"
LibraryManager: Loaded file "objectWrapper.lua"
LibraryManager: Loaded file "particles.lua"
LibraryManager: Loaded file "strings.lua"
LibraryManager: Loaded file "parser.lua"
LibraryManager: Loaded file "converter.lua"
LibraryManager: Loaded file "util.lua"
LibraryManager: Loaded file "trailInfo.lua"
LibraryManager: Loaded file "particleParser.lua"
LibraryManager: Loaded file "effectManager.lua"
PARTICLE SCRIPT: Parsing file "particles.cfg"
BMPMAN: Found EFF (ExpFlash.eff) with 86 frames at 24 fps.
BMPMAN: Found EFF (WhiteSmoke.eff) with 24 frames at 30 fps.
ERROR: Invalid input type "number" should be "string"
stack traceback:
[string "zmisc-sct.tbm - On Game Init"]:14: in function 'stackError'
[string "zmisc-sct.tbm - On Game Init"]:30: in function 'stackErrorf'
[string "converter.lua"]:54: in function '__doConvert'
[string "converter.lua"]:78: in function 'convert'
[string "parser.lua"]:49: in function 'convert'
[string "particleParser.lua"]:1003: in function 'func'
[string "parser.lua"]:216: in function 'handle'
[string "parser.lua"]:248: in functiFreeing all existing models...
Size of bitmap info = 760 KB
Size of bitmap extra info = 52 bytes
ASSERTION: "be->type != BM_TYPE_NONE" at bmpman.cpp:1640
Title: Re: Particle trail script
Post by: Dragon on August 25, 2011, 04:56:49 am
This is getting frustrating. I've changed a few things I suspected to be the cause, but nothing worked.
Code: [Select]
LibraryManager: Reloading all loaded libraries
LibraryManager: Loaded file "class.lua"
LibraryManager: Loaded file "objectWrapper.lua"
LibraryManager: Loaded file "particles.lua"
LibraryManager: Loaded file "strings.lua"
LibraryManager: Loaded file "parser.lua"
LibraryManager: Loaded file "converter.lua"
LibraryManager: Loaded file "util.lua"
LibraryManager: Loaded file "trailInfo.lua"
LibraryManager: Loaded file "particleParser.lua"
LibraryManager: Loaded file "effectManager.lua"
PARTICLE SCRIPT: Parsing file "particles.cfg"
PARTICLE SCRIPT: Parsing file "ranger.cfg"
BMPMAN: Found EFF (ExpFlash.eff) with 86 frames at 24 fps.
ERROR: Invalid input type "number" should be "string"
stack traceback:
[string "zmisc-sct.tbm - On Game Init"]:14: in function 'stackError'
[string "zmisc-sct.tbm - On Game Init"]:30: in function 'stackErrorf'
[string "converter.lua"]:54: in function '__doConvert'
[string "converter.lua"]:78: in function 'convert'
[string "parser.lua"]:49: in function 'convert'
[string "particleParser.lua"]:1003: in function 'func'
[string "parser.lua"]:216: in function 'handle'
[string "parser.lua"]:248: in functiFreeing all existing models...
Size of bitmap info = 760 KB
Size of bitmap extra info = 52 bytes
ASSERTION: "be->type != BM_TYPE_NONE" at bmpman.cpp:1640
The config "ranger.cfg" looks like that:
Code: [Select]
$Type: Ship
$Class: DD Ranger
+Name: Ranger
+Effect: ExpFlash
+Time: 1
+Emitstate: 2
+Number: 80, 120
+Speed: 200, 400
+Size: 1, 2
+Box Min: -100, -100, -300
+Box Max: 100, 100, 300
+Spewcone: 30, 30, 30
+FPS: 20, 30
+Emit from hull
+Use Ray normal
+Move outwards
+Trail: ExplosionTrail
$Type: ShipTrail
$Class: DD Ranger
+Effect: ThrusterFed
+Speed: -30, 0
+Size: 95, 105
+Number: 9, 11
+Use thrusters: YES
+Emitstate: Normal
+Use Thruster Strength: YES
+Density: 2
$Type: ShipTrail
$Class: DD Ranger
+Effect: ParticleSmoke01
+Speed: -30, 0
+Size: 130, 150
+Number: 5, 15
+Use thrusters: YES
+Variance: 9
+Emitstate: Always
+Use Thruster Strength: NO
+Damage Trails: YES
+Damage Start Level: 80
+Damage Maximum Level: 40
+FPS: 118
Title: Re: Particle trail script
Post by: m!m on August 25, 2011, 05:06:48 am
Can you try to redownload the script? I hope that my changes fix the error.
Spoiler:
Also that version contains an experimental If-Then-Else feature to enable effects on a per-mission basis but that requires a code change...
Title: Re: Particle trail script
Post by: Dragon on August 25, 2011, 06:39:15 am
I'm using the latest build. After redownloading, I'm getting this:
Code: [Select]
LUA ERROR: [string "particleParser.lua"]:1058: attempt to compare number with nil

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
And the script doesn't do anything.
Title: Re: Particle trail script
Post by: m!m on August 25, 2011, 06:42:25 am
 :banghead: :banghead: :ick:
Please redownload...
Title: Re: Particle trail script
Post by: Dragon on August 25, 2011, 07:01:42 am
It did help (trails seem to work OK), though there's another warning and weapon particles don't seem to work.
Code: [Select]
LUA ERROR: [string "particleParser.lua"]:1058: attempt to compare number with string

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
Using this weapon, I didn't get any visible impact particles OK, not really. Particle trails seem to have stopped working. While the particles themselves are there, trails are not created (and thus I didn't notice these particles):
Code: [Select]
$Type: Weapon
$Class: MDU-42
+Effect: ExpFlash
+Time: 1
+Number: 3, 5
+Speed: 600, 800
+Size: 5, 10
+Spewcone: 90, 90, 90
+Add Velocity: NO
+Trail: ExplosionTrail
+Use Normal: YES
+Emit Vector: 0, 0, 1
+Emit Variance: 1

Title: Re: Particle trail script
Post by: m!m on August 25, 2011, 07:42:20 am
I'm epic fail...
Please try if it is working now.
Title: Re: Particle trail script
Post by: Dragon on August 25, 2011, 07:59:33 am
From epic fail to epic win. The effect not only works, it's completely awesome.  :)
Title: Re: Particle trail script
Post by: Spoon on August 25, 2011, 08:50:42 am
Oh dear, is it time for me to update the particle script again?
How am I going to keep up with all this awesome? :p
Title: Re: Particle trail script
Post by: Trivial Psychic on August 26, 2011, 06:31:51 pm
Have any of the recent changes and updates included support for the issues I reported associated with ship explosions and the spawn box controls?  Did you have a chance to evaluate if the proposed automatically-spawn-the-particles-from-all-over-the-model's-surfce-in-deathroll-mode change?
Title: Re: Particle trail script
Post by: Dragon on August 27, 2011, 02:36:58 am
Yes, there's +Emit from hull flag in the latest version.
Title: Re: Particle trail script
Post by: m!m on August 27, 2011, 03:01:44 am
Also, I'm not 100% percent sure but I think that I fixed a problem that was preventing the creation ray cast from happening which means that that feature was never really working :nervous: :snipe:
Title: Re: Particle trail script
Post by: Droid803 on September 02, 2011, 04:31:22 pm
...could i get some non retarded documentation that actually lists what each of the values actually does (or what each of the types are)?...

something like the xxx.tbl pages on the wiki >.>

EDIT: wtf nvm must have been looking at an old version. somehow the description field is now filled in! disregard.
Title: Re: Particle trail script
Post by: m!m on September 04, 2011, 06:32:47 am
I have uploaded a new version which mostly contains new options to create more complex configuration files. It's now possible to control the definition of specific definitions via an If-Then-Else construct. I also added functionality to include lua code and files in the parsing process if you have to initialize some important things.
The documentation contains information about built-in functions for the $If construct. Currently there is only the "inMission" function which does not work as it depends on this patch (http://www.hard-light.net/forums/index.php?topic=44821.msg1543333#msg1543333) (the second one) but when the patch is present it will be possible to add effects on a per-mission basis :nod:
Title: Re: Particle trail script
Post by: StargateSpankyHam on September 04, 2011, 02:53:53 pm
Oooooh, I will definitely be keeping an eye on this! Great work!

 :D :yes:

Who else wants to see this in a future mediavps release?
Title: Re: Particle trail script
Post by: m!m on September 06, 2011, 06:08:45 am
I added a "+Reflection" option to type "Weapon" to get better visuals and to simulate the way it works in the real world™.It only works when you have set "+Use normal"  to YES as that vector is required to compute the resulting reflection vector.
Have fun :p
Title: Re: Particle trail script
Post by: m!m on September 07, 2011, 07:04:31 am
Again there's a new version in the first post, it's now possible to better specify the time when particles are spawned for a weapon as you can now specify the emistate (meaning that you can now also trigger the effect when the weapon gets intercepted) and you can control whether the weapon has to be armed or not so you can create little explosions when a bomb gets intercepted before it is armed and a bigger explosion when it impacts or you can change the effect when the weapon impacts unarmed.
Title: Re: Particle trail script
Post by: Dragon on September 12, 2011, 02:31:16 pm
It seems that I've encountered a problem with applying your script to high-speed mods.
Namely, it seems that maximum density of a trail is one particle per frame. This is not enough, as mods like Wings make their missiles go several meters each frame (at 60FPS, a dogfight missile moves about 40m each frame). If, say, smoke particle radius is less than 60m (unlikely in case of dogfight missiles), the trail looks really bad.
Could you find some solution to get around this problem? Ideally, particle emission would be completely detached from the framerate (like it seems to be in ArmAII), so the appearance of trails wouldn't change at all, regardless of framerate.
Title: Re: Particle trail script
Post by: Aardwolf on September 12, 2011, 07:16:50 pm
Problem then is that unless the particles have a very short lifetime, you get way too many particles at once.
Title: Re: Particle trail script
Post by: Dragon on September 13, 2011, 12:11:34 am
Well, of course you'd have to be careful with this feature. For example, a smoke trail done that way will consist of 1-2 particles spewed multiple times per frame. Short lifetime is another solution, but trails should last a while before vanishing.
Title: Re: Particle trail script
Post by: m!m on September 13, 2011, 10:16:10 am
Well, your request may (that is a huge may) be possible to implement. Maybe as something like "+PPS" (particles per second) option that overrides density settings. I have a theoretical solution that should be able to allow a trail density that is higher than one particle per frame but I don't know how it will affect the performance as I will have have to do a few more mathematical steps which shouldn't be too expensive but I really don't want to disappoint you in case it doesn't work.
Title: Re: Particle trail script
Post by: Dragon on September 13, 2011, 01:08:08 pm
That sounds amazing. This would actually eliminate a major drawback of all particle spewers I ever seen in FSO, namely dependency on framerate (currently, particle trails tend to start looking ugly at high speeds or in big battles where there's an FPS drop, even one not normally problematic).
Title: Re: Particle trail script
Post by: m!m on September 14, 2011, 06:23:26 am
There is a new version which has experimental support for sub-frame particle creation™ which can be enabled for both Ship and weapon trails. As this is a experimental feature I haven't documented it but you just need to specify the absolute number of particles spawned per second using the "+PPS" option and it should work fine. I have tested it and it seemed to work fine but please test it and say if it works (also with enabled time compression). When it proves to work then I'll also add it to the particle and debris trails.
Title: Re: Particle trail script
Post by: Nighteyes on September 14, 2011, 02:56:41 pm
does this new PPS thing also works for normal spews on weapons? like missile trails? or only for the death particles? this script has so much data in it now its hard to keep track of it all... I haven't had the chance to test the latest builds, but it seems promising, I knew this kind of script would spread its wings  :yes:
Title: Re: Particle trail script
Post by: Dragon on September 14, 2011, 03:11:44 pm
So far, it's implemented on ship engine and weapon engine trails.
Title: Re: Particle trail script
Post by: Nighteyes on September 14, 2011, 03:58:03 pm
what I mean it dosent affect stuff in weapons.tbl right? it needs its own table file to add it to weapons...

I strongly suggest you take the burning debris script and incorporate it into this one(with wanderer's permission of course), and add some easy optimizing functions such as effect to use, FPS for effect(basically lifetime for effect), size and how dense it should spew the particles, this would make it possible to have different burning debris effects for different species, and having it all in one big script makes it easier to mod and manage.

same for the explosion script, the one generating the bright flash as a ship dies, and all the particles on the hull of the ship when its in its death roll.

another suggestion is to split the different functions of the script to different named tbms, with a naming scheme like: prt-deathroll.tbm, prt-explosion, prt-engine.tbm, prt-weapons, prt-debris.tbm(did I forget any other functions of the script?)

and lastly, add for each a PDF file with instructions of use, if possible include a part of a working table file to start with.

having an all in one particle script, all using the new PPS would change the way particles look and help the moddability of particles tremendously, I don't know if its too much to ask one person, but I'm sure if such a thing would happen it would go straight into the newest mediavps.

sorry for the long post, its just that I was thinking about this for a while now, keep up the great work  :)
Title: Re: Particle trail script
Post by: Dragon on September 14, 2011, 04:02:27 pm
Heh heh heh...  :)
Maybe you should update your copy of the script before posting?
ALL you described is already in (minus Wanderer's flashes).
Title: Re: Particle trail script
Post by: Dragon on September 15, 2011, 11:17:36 am
EDIT: After some testing, I found that PPS doesn't work as intended, or at least works really strange.
This config:
Code: [Select]
$Type: WeaponTrail
$Class: AIM-92 Talon
+Effect: exp_smoke
+Speed: 0
+Size: 120, 125
+Number: 1
+Use thrusters: YES
+Variance: 0
+Emitstate: Normal
+FPS: 1
+PPS:                480
Causes the trail to look like this:
(http://img809.imageshack.us/img809/7042/screen0027p.th.png) (http://imageshack.us/photo/my-images/809/screen0027p.png/)
You can clearly see "packets" of smoke bitmaps, their "inner" density is right, but the gaps shouldn't be there.

BTW, when we're be done with PPS, I already have another idea. When I started to play around with the feature, I found how enormous the amount of particles on-screen needs to be for missiles in hi-speed mods. So, I'd like to know if it's possible to make use of single bitmap particles usable with your script. Ideally, I'd like an option to use a single bitmap (or looping anim, after having thought about that a bit) and define lifetime separately. Maybe you could also make it possible for particles slowly fade at the end of their lifetime (an effect which would take an enormous amount of frames to pull off with an anim). Also, I'd like to see an option to make particles rotate around their center axis, with a randomized speed (for instance, you could enter negative and positive speed values, positive would rotate clockwise), like they do in modern games. These effects would help adding a lot of variety and realism to particles, without the need to make multiple large effect files (and thus clog the memory).
Title: Re: Particle trail script
Post by: m!m on September 16, 2011, 05:23:50 am
Ok...
@Nighteyes:
As Dragon pointed out the pps feature is currently only active on ship and weapon trails and you can specify the debris effect on a per shipclass basis (also works for debris from subsystems) but a per species setup could also be possible.

Incorporating the explosion script is most likely not going to happen as the effort to porting Wanderers setup to the internal structures of this script would not be worth the effort, sorry for this one.

Concerning splitting it to individual tables: The scripting table this script uses is actually mostly the bare minimum as it only includes the main script file particleScript.lua and then notifies the global instance of the script of the things that happen. This means that splitting the tables to the parts you pointed out is not possible but I'd still like to hear why you want to do it, maybe I can offer another solution if there is a problem :nod:.

The PDF splitting is something I should have done some time ago, will happen.

I hope that answers your questions :nervous:

@Dragon:
I attached a patch which may fix your problem put it into data/scripts and see if it changes anything. Overwrite the existing file by renaming the extension to "lua", I'm not allowed to upload lua files :blah:.

Sadly the your feature request are simply not possible with the current particle system. Animated particles will just play their frames and the vanish, there is not possibility to make it loop. Also fading the particles out at the end of their lifetime requires rather big code and maybe also a custom shader to get it working. Rotating particles is also not possible as currently the particles are simply planes that are rotated to face the camera and to face upwards. No possibility to specify a custom orientation, I'm sorry.
But if you go get the coders to implement a system that is capable of doing this I will add it to the script :nod:.

[attachment deleted by ninja]
Title: Re: Particle trail script
Post by: Dragon on September 16, 2011, 09:20:28 am
Ok. Maybe someday we'll have that (I'll ask Valathil if such things are among his plans).
Allowing not animated particles would still come in handy, especially for long-lasting smoke trails (making them animated usually either looks dodgy, is barely noticeable or requires an atrocious number of frames, since we're talking about 15 second or longer lifetimes).
Title: Re: Particle trail script
Post by: m!m on September 16, 2011, 09:39:35 am
You can still have an effect with two (or even one frame I'm not sure if that works) and set the FPS in the effect definition to something very low which will results in longer lasting particles.
Title: Re: Particle trail script
Post by: Dragon on September 16, 2011, 09:47:06 am
I don't think one frame anims work, and two frames mean that there's still one unnecessary thing in memory (which could start to matter with such loads of particles trails can require). Also, it'd be easier for the end user to customize lifetime of such particle with a singe, intuitive parameter, instead of fiddling with FPS.
Title: Re: Particle trail script
Post by: Dragon on September 16, 2011, 04:39:35 pm
Also, your fix works.
Title: Re: Particle trail script
Post by: Nighteyes on September 18, 2011, 06:37:38 pm
Also, your fix works.

post a screen please :)

torc has pointed out something cool after testing the script in Diaspora, how easy will it be to add this script to activate for subsystems explosions?
Title: Re: Particle trail script
Post by: m!m on September 19, 2011, 03:27:24 am
torc has pointed out something cool after testing the script in Diaspora, how easy will it be to add this script to activate for subsystems explosions?
It will be a more complicated but it should be possible.
Title: Re: Particle trail script
Post by: Nighteyes on September 19, 2011, 02:48:42 pm
torc has pointed out something cool after testing the script in Diaspora, how easy will it be to add this script to activate for subsystems explosions?
It will be a more complicated but it should be possible.

some more brain storming on that subject, would it be possible also to tell the script to continue generating particles at the subsystem location? possibly first to use the script for awesome subsystem explosion, and after generate particles with a fire/smoke effect on them for a specified amount of seconds, the ship can move leaving behind it a smoke trail from the damaged subsystem.
Title: Re: Particle trail script
Post by: m!m on September 20, 2011, 02:27:34 am
I think a system that would simply be based on a "+Subsystem" option would be the best approach so you just specify the subsystem name with that option which would simply be a modifier put on the top of the different types (Ship, and ShipTrail) which would then use this subsystem as a starting point.
Title: Re: Particle trail script
Post by: Dragon on September 20, 2011, 11:45:01 am
If you do that, could you also add an option to assign damage checks to a subsystem instead of hull? I just realized it would be great if you could make damaged engines emit smoke on larger ships, with every engine having it's smoke amount set individually. In that case, an option to start/stop emitting when subsystem is down would also be helpful.
Title: Re: Particle trail script
Post by: Nighteyes on September 20, 2011, 03:07:30 pm
and lets not forget, we need adjustable speed, and if possible to emit the particles towards the normal of the subsystem, as in shoot the particles out from the ship hull...

IMO the hardest thing would probably be to "stick" the emmit location to the subsystem as the ship keeps moving.

and just throwing this out in the air, is it at all possible to have particles collide with a ships hull? so smoke for instance wont just clip through the ship as it moves?
Title: Re: Particle trail script
Post by: Nighteyes on September 20, 2011, 03:11:38 pm
and on further testing of the script, I still think that the main particles.cfg file should be split by default to ships, weapons, trails, explosions, subsystems and the like, as well as splitting the PDF file.
having it all under one config file makes no sense, it can be extremely long if you have different trail types, lots of ships and weapons with trails and special explosions, one specific config file for each particle creation type would be much more user friendly.

*I know its possible already to do, but I'm saying that by default it should be set up like that, so that people won't have to edit script lines...
Title: Re: Particle trail script
Post by: Dragon on September 20, 2011, 04:46:30 pm
They don't have to edit the script.
You could use $Include to add any number of new configs you wish, with only one line for each in particles.cfg .
Remember: First update the script and read it's docs, then complain.  :)
Title: Re: Particle trail script
Post by: Nighteyes on September 20, 2011, 07:15:54 pm
*I know its possible already to do, but I'm saying that by default it should be set up like that, so that people won't have to edit script lines...

I know this, I'm talking about how the script comes, with these config files already set up by default
Title: Re: Particle trail script
Post by: m!m on September 21, 2011, 05:53:42 am
I already splitted the configuration files and I will split the PDF files after I have implemented the subsystem things.
Also subsystems have no normal which could be used as an emit normal so you would have to specify that yourself.
It's also no problem to have the emit position stick to the subsystem position as that information is available at any point.

But that will have to wait as I'm currently tracking some parse error which I can't explain... :sigh:
Title: Re: Particle trail script
Post by: Nighteyes on September 21, 2011, 08:11:01 am
can't you use the hull normal behind the subsystem? anyway glad your working on this, cant wait to test it out :)
Title: Re: Particle trail script
Post by: Nighteyes on September 21, 2011, 09:24:50 am
some more bugfixing: the set size function for the trail particles didn't get fixed, its still using the old way of calculating it as part of a percentage of a ships hull...

some more: debris trail as it is implemented right now is inferior to the version in the mediavps, the particles should grow smaller over time untill the fire completely burns out, it should also generate particles on a few different points on the debris hull, and have them at a randomized size so they don't all look the same
Title: Re: Particle trail script
Post by: Nighteyes on September 22, 2011, 12:27:27 pm
after quite a bit of trail and error, I take my word back regarding the set size function for the trail particles, it kind of works, but not like I imagined it, currently when a trail particle has a set size, it will use the size from the parent particle that is generating it, basically disregarding the size set it the trail particle field.
can they be unlinked please? its much easier to have 2-3 trail types that you know how they will look in-game than to relay on a percentage from the size of a ship... I might also want to have a really small parent particle and a rather large trail behind it, currently, this is not possible...
Title: Re: Particle trail script
Post by: m!m on September 22, 2011, 12:43:08 pm
some more: debris trail as it is implemented right now is inferior to the version in the mediavps, the particles should grow smaller over time untill the fire completely burns out, it should also generate particles on a few different points on the debris hull, and have them at a randomized size so they don't all look the same
Alright, I'll include an option to specify the lifetime of a particle plume which will be used to let the generated particles get smaller over time. But the two other things you mentioned are already possible by using the "+Size" and "+Number" options.

after quite a bit of trail and error, I take my word back regarding the set size function for the trail particles, it kind of works, but not like I imagined it, currently when a trail particle has a set size, it will use the size from the parent particle that is generating it, basically disregarding the size set it the trail particle field.
can they be unlinked please? its much easier to have 2-3 trail types that you know how they will look in-game than to relay on a percentage from the size of a ship... I might also want to have a really small parent particle and a rather large trail behind it, currently, this is not possible...
I'll include an options that will let you control whether you want to have a fixed size or a dynamic (similar to the existing ones)
Title: Re: Particle trail script
Post by: StargateSpankyHam on September 25, 2011, 04:24:53 pm
Quick question about the +Trail entry...
Code: [Select]
$Type: Ship
$Class: GTD Orion
+Name: TestEffect
+Effect: capflash
+Time: 1
+Emitstate: 2
+Number: 20, 20
+Speed: 1600, 2200
+Size: 4, 5
+Box Min: 0, 0, 0
+Box Max: 0, 0, 0
+Spewcone: 90, 90, 90
+FPS: 15
+Trail: GenericTrail
I am having trouble finding any asset named 'GenericTrail' in the VP files. Where does this come from? Does something special need to be done to set up another particle trail? Specifically, I want to find the necessary files and alter them, to produce similar effects with altered hues (for different colors).

Will any .eff file with a string of properly-named images work in place of 'GenericTrail', so long as it is present in the effects folder?
Title: Re: Particle trail script
Post by: m!m on September 26, 2011, 04:18:35 am
The trail is a separate definition in the configuration file, see section "Type 'ParticleTrail'" in the documentation for information on how you define them. There should also be an example definition with name "GenericTrail" be present in the configuration file that comes with the download.
Title: Re: Particle trail script
Post by: torc on September 27, 2011, 01:00:50 pm
m!m just wanna thank you for the great script you did... keep it up :)
Title: Re: Particle trail script
Post by: m!m on October 19, 2011, 06:26:08 am
I uploaded a new version which now has a function to add trails to subsystems. The documentation has been updated accordingly.
Title: Re: Particle trail script
Post by: Dragon on October 19, 2011, 11:22:13 am
I've only seen this after I sent you that PM.  :)
It's a great feature, engine trails can be finally assigned to subsystems.
Also, PPS seem to work OK, you could add it to other places where it could be useful.
Title: Re: Particle trail script
Post by: Crybertrance on October 23, 2011, 01:08:13 am
N00b question....

How do I install it? *ducks for cover*
Title: Re: Particle trail script
Post by: m!m on October 23, 2011, 02:45:21 am
The download contains a packaged directory which can be used as a mod or you can just drop the files inside that folder into an existing mod folder.
Title: Re: Particle trail script
Post by: Crybertrance on October 23, 2011, 05:04:24 am
The download contains a packaged directory which can be used as a mod or you can just drop the files inside that folder into an existing mod folder.
I get this Error

Code: [Select]

LUA ERROR: [string "parser.lua"]:80: attempt to perform arithmetic on field 'currentLine' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
Title: Re: Particle trail script
Post by: m!m on October 23, 2011, 05:06:59 am
Yes, that will work but you will have to modify the existing configuration files as those only contain some testing entries (look at the PDF file inside the docs directory for information on what to do).
Title: Re: Particle trail script
Post by: Crybertrance on October 24, 2011, 02:17:10 am
Yes, that will work but you will have to modify the existing configuration files as those only contain some testing entries (look at the PDF file inside the docs directory for information on what to do).

Still getting the above error...
Title: Re: Particle trail script
Post by: m!m on November 04, 2011, 09:39:35 am
I updated the link in the first post. This time I added particle collision detection to particles that are generated from a weapon explosion. Be careful with this option as it might lead to performance issues when to many particles have to be checked. The collision detection is only enabled for the target of the weapon to minimize the performance hit.
Title: Re: Particle trail script
Post by: petar91 on November 11, 2011, 08:52:10 am
@cybertrance : remove the raynor entry in the ships.cfg

it work for me.
Title: Re: Particle trail script
Post by: petar91 on November 12, 2011, 08:50:06 am
Hi,

i'm playing with the configuration file but the "speed" value also modify the expansion size of the effect (higher value, higher is the speed and the expansion size), i want to apply a medium expansion sized effect ( with a more slowly expansion effect. Did i miss an option ?


$Type:                Ship
$Class:             GTC Leviathan
   +Name:            TestEffect
   +Effect:          capflash
   +Time:             1,9
   +Emitstate:          1
   +Number:          30,30
   +Speed:          10,350
   +Size:             7, 8
   +Box Min:          0, 0, 0
   +Box Max:          0, 0, 0
   +Spewcone:          90, 90, 90
   +FPS:            15
   +Trail:          GenericTrail


Title: Re: Particle trail script
Post by: m!m on November 12, 2011, 08:59:45 am
If I understand you correctly then you want to have fast particles which don't go too far away from the center of the emission?
You can achieve this effect by increasing the "+FPS" value so the particles don't live as long as they do currently.
Title: Re: Particle trail script
Post by: petar91 on November 12, 2011, 09:31:52 am
not exactly :

i want to decrease speed value to make the visual effect longer in time , more i decrease speed value, more the particle are not going as far as i want from the center.

i want : particles going far from the center but at low speed
Title: Re: Particle trail script
Post by: m!m on November 12, 2011, 09:35:51 am
Then you will need to decrease the "+FPS" value so the particles live for a longer time.
Title: Re: Particle trail script
Post by: petar91 on November 12, 2011, 09:46:55 am
it works ! thanks. Time to modify the trail conf....
Title: Re: Particle trail script
Post by: petar91 on November 12, 2011, 10:39:54 am
Ok there is my first attempt to make the GTC Leviathan explosion more epic :

add this in "ships.cfg"

Code: [Select]
$Type: Ship
$Class: GTC Leviathan
+Name: TestEffect
+Effect: capflash
+Time: 3.5
+Emitstate: 1
+Number: 70
+Speed: 50
+Size: 4
+Box Min: 0, 0, 0
+Box Max: 0, 0, 0
+Spewcone: 90, 90, 90
+FPS: 1.1
+Trail: Leviathantrail

and this in "trails.cfg"

Code: [Select]
$Type: ParticleTrail
$Name: Leviathantrail
+Effect: Particlesmoke01
+Size: 80
+Time: 11


and play the six wonder...


Title: Re: Particle trail script
Post by: Fury on February 01, 2012, 12:55:38 pm
Has someone actually accomplished good looking particle effects when ships die without it utterly tanking fps?
Title: Re: Particle trail script
Post by: Dragon on February 01, 2012, 04:32:31 pm
I've tried and reached some degree of success. Maybe Nighteyes too. This script isn't really suited to use effects from Mediavps, it needs custom ones.
Title: Re: Particle trail script
Post by: m!m on September 06, 2012, 06:16:07 am
After a rather long period here is another maintenance update, this time fixing some bugs, improving compatibility with other scripts (thanks Spoon for finding those errors) and this update possibly improves performance but requires a recent trunk build (Not a 3.6.14 build!). I thank Swifty for his profiling efforts here.
Title: Re: Particle trail script
Post by: torc on September 06, 2012, 03:52:53 pm
that's great! (you know what i mean M|M) :D
Title: Re: Particle trail script
Post by: mjn.mixael on September 07, 2012, 09:55:01 pm
Looks like some files may have been removed or changed names? Any chance for a quick list?
Title: Re: Particle trail script
Post by: m!m on September 10, 2012, 04:34:11 am
:nono: I should have started using GIT earlier...
The best way I see here is that you just post a list of the files in the script folder and the scripting tables (*-sct.tbm) here if you are unsure if the file belongs to the particle script.
I'll start posting differences in the 7z file from now on, that should make it easier to upgrade to a newer version.
Title: Re: Particle trail script
Post by: Spoon on September 10, 2012, 07:21:20 am
Tracking down redundant files have never given us problems before, right m!m?  :lol:  ;)
Title: Re: Particle trail script
Post by: Slasher on November 30, 2012, 02:08:58 am
I'm having some trouble specifying a debris trail as the default trail for ships.  To do this, do I just remove the "$Class" parameter entirely and replace it with "+Default: YES"?
Title: Re: Particle trail script
Post by: m!m on November 30, 2012, 11:20:09 am
Yes, I think that should work.
Title: Re: Particle trail script
Post by: Slasher on November 30, 2012, 02:12:30 pm
I'm getting a crash trying this with TBP and FS2 3.6.14 Final.  I can specify effects for individual ships and they show up in game and look great, but if I try to use the same data for a "default" trail by doing what I said in the above post, I get this:

Code: [Select]
LUA ERROR: [string "trailInfo.lua"]:328: attempt to index global 'deathParticleScript' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: checkDebris
Name of: method
Function type: Lua
Defined on: 314
Upvalues: 0

Source: trailInfo.lua
Short source: [string "trailInfo.lua"]
Current line: 328
- Function line: 15
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
checkDebris
doObjectInfoRun
------------------------------------------------------------------

------------------------------------------------------------------



[attachment deleted by a basterd]
Title: Re: Particle trail script
Post by: m!m on November 30, 2012, 02:38:42 pm
That looks like it's an error in the script, I'll post an update tomorrow.

EDIT: New version uploaded the error should hopefully be fixed now.
Title: Re: Particle trail script
Post by: Slasher on December 01, 2012, 11:55:32 pm
Thanks for the rapid response.