Author Topic: Particle trail script  (Read 29193 times)

0 Members and 1 Guest are viewing this topic.

Offline Luis Dias

  • 211
Re: Particle trail script
Thank you m!m I'll give it a look in the eve

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Particle trail script
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?
The Trivial Psychic Strikes Again!

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Particle trail script
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.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Particle trail script
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:

 

Offline Luis Dias

  • 211
Re: Particle trail script
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....)
« Last Edit: July 19, 2011, 04:12:31 pm by Luis Dias »

 

Offline m!m

  • 211
Re: Particle trail script
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
« Last Edit: July 20, 2011, 07:38:16 am by m!m »

 

Offline m!m

  • 211
Re: Particle trail script
I have a quick preview of what I'm currently working on:

Nothing too spectacular but it's essential for some very cool effects :cool:

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Particle trail script
Projectile backblast? Do want.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Particle trail script
Are those part of the death-roll or due to weapon impacts or subsystems being destroyed?
The Trivial Psychic Strikes Again!

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Particle trail script
Particle spawning on weapon impacts? sweet
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Particle trail script
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?
The Trivial Psychic Strikes Again!

 

Offline m!m

  • 211
Re: Particle trail script
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.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Particle trail script
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.
The Trivial Psychic Strikes Again!

 

Offline m!m

  • 211
Re: Particle trail script
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.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Particle trail script
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.
The Trivial Psychic Strikes Again!

 
Re: Particle trail script
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
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1

 

Offline Nighteyes

  • 211
Re: Particle trail script
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.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Particle trail script
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?
The Trivial Psychic Strikes Again!

 

Offline m!m

  • 211
Re: Particle trail script
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.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
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
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them