by Xaser » Sun Feb 19, 2012 8:18 pm
So, I decided to flex my coding muscle and finish up this feature. It's got a few changes from the original version and some new additions since, so I'll go ahead and list all the stuff the patch adds:
New Flags:
- RGF_FULLBRIGHT: Makes all spawned particles fullbright.
New A_RailAttack/A_CustomRailgun Parameters:
- range: Maximum distance (in map units, as fixed-point) the rail shot will travel before vanishing.
- duration: Lifetime of spawned particles, in tics. Default is 35, and a value of '0' means "use default."
- sparsity: Distance between individial particles. Implemented as a float multiplier, with 1.0 as the default.
- driftspeed: Speed at which particles "drift" away from their initial spawn point. Implemented as a float multiplier, with 1.0 as the default.
- spawnclass: Actor to spawn in place of trail particles. If non-null, the specified actor will be spaced sparsity units apart instead of the usual trail. Particle-specific properties such as duration, driftspeed, and rail color are naturally ignored in such a case.
There's still one thing missing: actor spawning doesn't yet respect maxdiff yet, but I haven't added that yet because I first want to play around with improving maxdiff's behavior a bit (which I see as a separate code submission altogether). Otherwise, this should be submit-worthy, parameter names subject to change of course. I've also cleaned up the code a bit since kg's patch, so there's no more passing the entire Flags variable to P_RailAttack or hiding the fullbright information in the color attribute of particle_t (it has its own variable in the struct now).
Anyhow, the patch:
xa-rails.zip
- Railgun upgrade. See xa-rails.txt for test wad documentation.
- (28.06 KiB) Downloaded 72 times
The zip contains a TortoiseSVN .patch along with a test wad for the curious (based on kgsws's work). Let me know if there are any issues with it -- first time making a patch here but Tortoise makes it easy enough to hopefully be Xaserproof.
Thanks for kickstarting this, kgsws. Something I've been wanting to see for a while, myself.

So, I decided to flex my coding muscle and finish up this feature. It's got a few changes from the original version and some new additions since, so I'll go ahead and list all the stuff the patch adds:
[b]New Flags:[/b]
[list][*][b]RGF_FULLBRIGHT[/b]: Makes all spawned particles fullbright.[/list]
[b]New A_RailAttack/A_CustomRailgun Parameters:[/b]
[list][*][b]range[/b]: Maximum distance (in map units, as fixed-point) the rail shot will travel before vanishing.
[*][b]duration[/b]: Lifetime of spawned particles, in tics. Default is 35, and a value of '0' means "use default."
[*][b]sparsity[/b]: Distance between individial particles. Implemented as a float multiplier, with 1.0 as the default.
[*][b]driftspeed[/b]: Speed at which particles "drift" away from their initial spawn point. Implemented as a float multiplier, with 1.0 as the default.
[*][b]spawnclass[/b]: Actor to spawn in place of trail particles. If non-null, the specified actor will be spaced [i]sparsity[/i] units apart instead of the usual trail. Particle-specific properties such as duration, driftspeed, and rail color are naturally ignored in such a case.[/list]
There's still one thing missing: actor spawning doesn't yet respect maxdiff yet, but I haven't added that yet because I first want to play around with improving maxdiff's behavior a bit (which I see as a separate code submission altogether). Otherwise, this should be submit-worthy, parameter names subject to change of course. I've also cleaned up the code a bit since kg's patch, so there's no more passing the entire Flags variable to P_RailAttack or hiding the fullbright information in the color attribute of particle_t (it has its own variable in the struct now). ;)
Anyhow, the patch:
[attachment=0]xa-rails.zip[/attachment]
The zip contains a TortoiseSVN .patch along with a test wad for the curious (based on kgsws's work). Let me know if there are any issues with it -- first time making a patch here but Tortoise makes it easy enough to hopefully be Xaserproof.
Thanks for kickstarting this, kgsws. Something I've been wanting to see for a while, myself. :P