Author Topic: Pspew Types  (Read 5373 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
i was thinking about redoing my lua based railgun particle trails in c, to improve its performance and make it easier to mod in. i always wanted more variety in my particle spewer so i thought of adding a type field to the entry and possibly a couple more parameters. since most of the parameters for my railgun effect are the same as the existing pspew entry ( see this post ).

what i want to do is add a type field to the pspew parameters, its default will be the standard pspew effect as its implemented, and it can have other options like helical, star, ring, ect. this would add alot more variety to particles. i know how to do the helical effect so the rest would be fairly easy to do the others i mentioned.

most of these effects share similar parameters. so i think this is the best way to go about different particle spew types. id be willing to code this myself if you guys could point me in the right direction.
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 Solatar

  • 211
That'd be something nice to add. We've all been effectively shooting the same weapons for ten years or so...just with different and better colors. I'm always a supporter of new options for visual variety.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
didnt i say that like several years ago?
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 Solatar

  • 211
If you did, it's still every bit as true now as it was back then.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
none the less i need some input from coders, a crash course in how tables are parsed would be a good start.
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 WMCoolmon

  • Purveyor of space crack
  • 213
optional_string returns if that string exists in the table. required_string kills the exe if the string isn't found (don't use it except for section names). stuff_* pulls the specified type from the tables and puts it in the specified buffer. Adding a field looks like:

Code: [Select]
if(optional_string("$Subsystem Factor:")) {
stuff_float(&wip->subsystem_factor);
}

Comments and whitespace are handled internally.
-C

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Also remember to add the new entry (or rather the variable) to the ship_info structure and also make sure you give it some value when tables are initialized.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
optional_string returns if that string exists in the table. required_string kills the exe if the string isn't found (don't use it except for section names). stuff_* pulls the specified type from the tables and puts it in the specified buffer. Adding a field looks like:

Code: [Select]
if(optional_string("$Subsystem Factor:")) {
stuff_float(&wip->subsystem_factor);
}

Comments and whitespace are handled internally.

ok i saw something like that for pspew parameters in weapons.cpp. i figured id use optional_string. so is this

stuff_float(&wip->subsystem_factor);

the function that stores the variable? and i take it &wip->subsystem_factor is a reference to a structure element? im abit rusty in old skool c, and i never really got this far in that language. most ive done is quake c.

Also remember to add the new entry (or rather the variable) to the ship_info structure and also make sure you give it some value when tables are initialized.

ok, wouldnt have thought to look at ship_info for a weapon parameter, or would there also be a weapon_info struct?
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
lols... I wrote that when i was too tired and without reading the previous posts accurately enough... Yeah.. the weapon_info not ship_info

Basically you just need to add the new entry to struct weapon_info in weapon.h like for example using int to get the info which 'special particle type' is in use
Code: [Select]
      int particle_spew_type;
Then add to the void init_weapon_entry in weapon.cpp the initial data like
Code: [Select]
      wip->particle_spew_type = -1;
And then add the actual parsing stuff thing with the optional_string under the $Pspew: entry
Code: [Select]
      if(optional_string("+Type:"))
      {
         stuff_int(&wip->particle_spew_type);
      }

And then adding the rest of stuff (the floats etc needed for the additional types) as needed
« Last Edit: May 13, 2008, 05:02:24 am by Wanderer »
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
looks pretty straight forward then. il update and try to code it up later tonight.

anyone know what the default pspew values are? im thinking about making everything optional (using the default value). oh never mind i found em :D
« Last Edit: May 12, 2008, 10:39:38 pm by Nuke »
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 Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
i think i got it to parse the new type field. the hard part is learning all of freespace's wierd ass math funcs. il finish the particle code tomorrow maybe.
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 Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
:bump:

i sorta got my c implementation of the effect working. its an order of magnitude faster than the lua version. i can do a gapless trail without slowing down the engine! see the results:


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 Aardwolf

  • 211
  • Posts: 16,384
looks like the d3 omega cannon

 

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
This looks great! Please go on :)

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
How bout a tail with gaps?
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
can be done by reducing the number of particles. right now none of the information in the table makes any since, like +count: seems to be backwards, as in lower numbers mean more particles. for sanity im gonna need to rethink some of the math so that the pspew properties make more sense to modders. but it shouldnt be that hard.

thin again this is supposed to be pspew types, thats one type, i need ideas for more spew patterns. il probably do some variations on the helix type, one with a counter rotating core perhaps. or a solid core, or a double helix. i might see about multiple spewers per weapon. add an offset value to the spawn origin. so you can do things like missiles with multiple particle trails.
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 JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
How about spew'd groups or patterns?

Um.. star shaped... circles.. hexagonal...triangular...
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
could probibly do all those. just a matter of whether they would look good or not. also can do one that throws particles in all directions. sorta like what you have with some weapons in freelancer. to give them that sparkly energetic look.
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 JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
I had a weird issue with a missile particle trail, it was creating fireworks-esque particle balls
the size of moons, and they'd follow the player's ship everywhere.
For the longest time thought it was my afterburners...

But just an idea...

Perhaps a sword of particles?

Let me know when you've got all the kinks out of the current version, I'd like to stick it in my mod now
that I've got most of the railgun worked out finally.
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
-C