Author Topic: Shivan Comm Node particle spew  (Read 3403 times)

0 Members and 1 Guest are viewing this topic.

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Shivan Comm Node particle spew
When the Shivan Comm Node is in its death throes, it spews out a LOT of big fluffy particles. I've looked at the model and at the table and I can't figure out where this effect is coming from. Does anyone have any idea how it was implemented, and if we can reproduce it in other models?
"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 Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Re: Shivan Comm Node particle spew
According to the wiki:
"the mission designer progammed the CommNode to self-destruct when the crystal is destroyed; this is not a hard-coded feature."

Self destruct causes the crazy particle spew AFAIK.
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Shivan Comm Node particle spew
I assume it's because it's got the "knossos" flag.  IIRC, the only function for this flag is to change the explosion behavior.

EDIT: Okay, having just searched in the code base, I take that back.  One of the functions is to change the explosion.  The other (naturally) is to handle special warpin/warpout.

But here's the code you're probably looking for:
Code: [Select]
// create little fireballs for knossos as it dies
if (knossos_ship) {
if ( timestamp_elapsed(shipp->next_fireball)) {
vec3d rand_vec, outpnt; // [0-.7 rad] in plane
vm_vec_rand_vec_quick(&rand_vec);
float scale = -vm_vec_dotprod(&objp->orient.vec.fvec, &rand_vec) * (0.9f + 0.2f * frand());
vm_vec_scale_add2(&rand_vec, &objp->orient.vec.fvec, scale);
vm_vec_normalize_quick(&rand_vec);
scale = objp->radius * frand() * 0.717f;
vm_vec_scale(&rand_vec, scale);
vm_vec_add(&outpnt, &objp->pos, &rand_vec);

float rad = objp->radius*0.2f;
int fireball_type = FIREBALL_EXPLOSION_LARGE1 + rand()%FIREBALL_NUM_LARGE_EXPLOSIONS;
fireball_create( &outpnt, fireball_type, OBJ_INDEX(objp), rad, 0, &objp->phys_info.vel );
// start the next fireball up in the next 50 - 200 ms (2-3 per frame)
shipp->next_fireball = timestamp_rand(333,500);

// emit particles
particle_emitter pe;

pe.num_low = 15; // Lowest number of particles to create
pe.num_high = 30; // Highest number of particles to create
pe.pos = outpnt; // Where the particles emit from
pe.vel = objp->phys_info.vel; // Initial velocity of all the particles
pe.min_life = 2.0f; // How long the particles live
pe.max_life = 12.0f; // How long the particles live
pe.normal = objp->orient.vec.uvec; // What normal the particle emit around
pe.normal_variance = 2.0f; // How close they stick to that normal 0=on normal, 1=180, 2=360 degree
pe.min_vel = 50.0f;
pe.max_vel = 350.0f;
pe.min_rad = 30.0f; // * objp->radius;
pe.max_rad = 100.0f; // * objp->radius;
particle_emit( &pe, PARTICLE_SMOKE2, 0, 50 );

// do sound - maybe start a random sound, if it has played far enough.
do_sub_expl_sound(objp->radius, &outpnt, shipp->sub_expl_sound_handle);
}
}
« Last Edit: May 22, 2008, 10:29:53 pm by Goober5000 »

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Shivan Comm Node particle spew
IIRC, the only function for this flag is to change the explosion behavior.

It also sets the deathroll time.

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Shivan Comm Node particle spew
It also sets the deathroll time.
That kind of falls under the "explosion behavior" concept, doesn't it? :p

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Shivan Comm Node particle spew
I guess so...

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Shivan Comm Node particle spew
id love to add particle spewers as part of the glowpoint code. set glowpoint to type 2 and set pspew in the ship table and it would use the glowpoint position/normal as the spew point. then you can turn them on and off with sexps.
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 Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Shivan Comm Node particle spew
Couldn't you just script them?
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Shivan Comm Node particle spew
yea, probably. but doing it in c you could do it with greater speed, and i find that sometimes when dealing with particles you need all the speed you can get.
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 shiv

  • Don't forget Poland!
  • 211
  • FRED me!
    • http://freespace.pl
Re: Shivan Comm Node particle spew
I have a nice idea. SCP Team could code table-defined explosions so in tables so user could define explosions (like particle spew and particle animation) in tables. Also other things like particle smoke (when ship's damaged) would be definable.
http://www.sectorgame.com/vega
The Apocalypse Vega - Join the battle! A campaign for FreeSpace 2 Open

http://www.game-warden.com/earthdefence
Earth Defense project - Coming soon...

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Shivan Comm Node particle spew
Good luck getting that to happen anytime soon...

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: Shivan Comm Node particle spew
I have a nice idea.

Ideas are cheap. Give 'em an actual way to make it happen and put some effort into it.
"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 Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Shivan Comm Node particle spew
Well if the changes are limited and simple we could see a test build in no time, right? :D
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Shivan Comm Node particle spew
Well if the changes are limited and simple we could see a test build in no time, right? :D

Learn to code before you make assumptions like that :rolleyes:

  

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Shivan Comm Node particle spew
I can't code but changes like this are obviously easier to do than many others...just look at the requests...
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito