Author Topic: Particle Emitters?  (Read 3259 times)

0 Members and 1 Guest are viewing this topic.

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
Particle Emitters?
Well, I'm working on my own campaign for Wing Commander Saga, and I want to add a new ship with smoke coming out of it like a smokestack, since it is a factory ship. :)

Is there any way you can force particles to be emitted from a specific point on the ship without shooting at it?
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline Solatar

  • 211
I know the SCP engine is capable of having particles emit from engines. Maybe you could fool around with using a glowpoint/whatever they used in BSG:BTRL/.ani file and seeing what you could come up with?


 

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
I'm not really sure if I want an engine flame coming out of a smokestack... :P

I was thinking of using glowpoints, but...  Are they capable of emitting particles?
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
could probibly script it.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
You could just make a separate engine set and have the glowpoint be an incredibly small radius (or 0 radius) or even make it like a secondary or tertiary thruster and have the corresponding bitmap be invisible.
"I only miss what I don't hit."
Show me something that beats 87 BF reds and I'll show you Hateful Lies!!!

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
you know what, the glowpoint chunk has a numeric type field i think. there are really only two possibilities to set it to, 0 and 1 which is sprite and beam, respectively. what about a type 2, which could be set to be a particle spewer. just an idea for the engine.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
Excellent idea. :pimp:
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Post sreenies when done :nod:........
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
im still working on pspew types, which has about a snowballs chance in hell of getting into the engine
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
:bump:

Anyone have ideas on this? Particle emitters on ships have some interesting possibilities.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline DahBlount

  • 29
  • Alpine ☆ Cancer Tribulation
    • Minecraft
    • Skype
    • Steam
$PSpew: is a thing. That's about as good as it gets at this point in time. There was also a particle script laying around somewhere but I haven't been able to find it in a few months.
<Axem> yet still more insightful than #hard-light

<Axem> jad2.23 will just be cat videos

<DahBlount> So
<DahBlount> JAD2.2 is like that
<Axem> maybe
<Axem> it can be whatever you like!
<DahBlount> A Chocolate Sundae?
<Axem> sure

My models: GTF Gilgamesh - GTD Nuadha [Redesigning] - Ningirama [WIP] - GTG Zephyrus

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
As said previously, it can be scripted. Shouldn't be anything particularly tricky about it.

 

Offline m!m

  • 211
I have been working on implementing generic particle effects for some time now and adding particle emitters on a ship is something it can do. It's working pretty well and should be ready to be tested soonTM. Until then a script based solution is probably the best you can do (but don't use my particle script, it's horribly inefficient).

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Guess I better head to the "introduction to scripting" page on the Wiki, seeing as I've never done anything like that before...
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Well it would be simple enough that someone (such as myself) could probably easily write one for you if you specified exactly what it should do.

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
OK, here's a test case for you then: let's say we wanted to make a ship act like the Reavers from Firefly.

Say there's a modified Fenris that's dangerously overpowered their reactor to fire BGreen from its main turret, maybe the NTF crew has committed themselves to a slow death from radiation poisoning rather than a dishonorable death at the hands of the Vasudans.

It's simple enough to swap the weapon in FRED, maybe a texture-replace too. But if we really wanted to sell this, let's add some billowing smoke venting from the exposed sides of the ship. Something similar to the MediaVPs pspew from the exit wound of a beam impact. Is this doable? If so, would it be built into the model, the table, or the mission?
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
OK, here's a test case for you then: let's say we wanted to make a ship act like the Reavers from Firefly.

Say there's a modified Fenris that's dangerously overpowered their reactor to fire BGreen from its main turret, maybe the NTF crew has committed themselves to a slow death from radiation poisoning rather than a dishonorable death at the hands of the Vasudans.

It's simple enough to swap the weapon in FRED, maybe a texture-replace too. But if we really wanted to sell this, let's add some billowing smoke venting from the exposed sides of the ship. Something similar to the MediaVPs pspew from the exit wound of a beam impact. Is this doable? If so, would it be built into the model, the table, or the mission?

Okay... well, basically I'd write that so that it'd be built into a script, which would run during that particular mission and keep picking random locations on the hull of that particular ship (or fixed locations, if that'd be better) to spew streams of particles from every couple of seconds in an $On Frame hook. However, it wouldn't be much harder to generalize it so that any mission could just use the script-eval SEXP to call a Lua function which would trigger the effect on any ship, if needed.

I can try writing at least a prototype of that tomorrow, shouldn't be anything awfully tricky about it.

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Let's say there's fixed locations: those two big, red bullseyes centered on each side of the hull.

Suppose NTC Fenris#reaver is a ship class that's used enough in the campaign to warrant its own table entry. Does this mean all we need is to include the script with the modpack, and then use the script-eval sexp in each mission? Forgive me, I'm totally unfamiliar with scripting.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
All you need to do is include the script in a -sct.tbm. The script-eval SEXP would only need to be used if the effect needed to be triggerable per-ship, rather than automatically affecting all occurrences of the ship class.

Anyway, here's the simplest kind of version of it:

Code: [Select]
#Conditional Hooks

$Application: FS2_Open

$On Game Init: [

    last_particle_time = 0
    next_particle_time = -1

]

$State: GS_STATE_GAME_PLAY

$On Frame: [

    local currenttime = mn.getMissionTime()

    if currenttime > 0.1 then
        local num = #mn.Ships

        for i=1,num do
            local ship = mn.Ships[i]

            if ship.Class.Name == "GTC Fenris" then
                if currenttime > next_particle_time then
                    local ppos, pdir, pvel, plife, prad

                    ppos = ship.Position + ship.Orientation:unrotateVector(ba.createVector(35, 0, 0))
                    pdir = ba.createVector(10.0 + math.random() * 5.0, math.random() * 3.0 - 1.5, math.random() * 3.0 - 1.5)
                    pvel = ship.Physics.Velocity + ship.Orientation:unrotateVector(pdir)
                    plife = 1.0 + math.random() * 2.0
                    prad = 5.0 + math.random() * 5.0
                    ts.createParticle(ppos, pvel, plife, prad, PARTICLE_SMOKE)
                    -- Use PARTICLE_SMOKE, PARTICLE_SMOKE2 or PARTICLE_FIRE

                    ppos = ship.Position + ship.Orientation:unrotateVector(ba.createVector(-35, 0, 0))
                    pdir = ba.createVector(-10.0 - math.random() * 5.0, math.random() * 3.0 - 1.5, math.random() * 3.0 - 1.5)
                    pvel = ship.Physics.Velocity + ship.Orientation:unrotateVector(pdir)
                    plife = 1.0 + math.random() * 2.0
                    prad = 5.0 + math.random() * 5.0
                    ts.createParticle(ppos, pvel, plife, prad, PARTICLE_SMOKE2)
                    -- Use PARTICLE_SMOKE, PARTICLE_SMOKE2 or PARTICLE_FIRE

                    last_particle_time = currenttime
                    next_particle_time = currenttime + 0.1 + math.random() * 0.1
                end
            end
        end
    else
        next_particle_time = -1
    end
]

#End

Automatically spews smoke/fire plumes from both sides of all Fenrises (so change the ship class name reference). It wouldn't be hard to make it fancier and more customizable and more optimized, but as said, it's a prototype. The particle direction/radius/velocity/lifetime randomizations should be somewhat self-explanatory and easy to tweak.

If that's all you need for your particular usecase and it doesn't have any visible drawbacks then great; if you need more customization (custom smoke bitmap, or for it to work on different ship classes with different emitter locations, etc) then I could easily add those.

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Very interesting. I'll have to try this later and see what I can learn from it! I do have a particular use in mind but it's still in the concept art stages... perhaps I'll follow up with you once there's a POF we can play with. :)
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...