Author Topic: [REQUEST] New tilefactor setting for beam weapons  (Read 1893 times)

0 Members and 1 Guest are viewing this topic.

Offline Aesaar

  • 210
[REQUEST] New tilefactor setting for beam weapons
Basically, a tilefactor setting for beam weapon segments that doesn't tile.  The segment appears for the first x meters of a beam and doesn't appear again.  So if you wanted a segment to only appear for the first 100m of a beam, you'd have +Tile Factor: 100, 3.

I have no idea how easy this would be to do, but it would allow a lot of possibilities for beam weapons.  This would allow for proper directional muzzleflashes on beam weapons, but could also be used for things like making jammed beam weapons in BP look like blowtorches rather than actual beams.

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: [REQUEST] New tilefactor setting for beam weapons
Scaled beam fade?
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 Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: [REQUEST] New tilefactor setting for beam weapons
There was at one time an ability to specify a maximum length for a section, it was either in meters or percentage, either way if it isn't there now it should be relatively easy to re-implement (and I can say that because I implemented it once).
though your implementation is not good, this has nothing to do with tiling, it should be +max length: or something like that.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Cobra

  • 212
  • Snake on a Cain
    • Minecraft
    • Skype
    • Steam
    • Twitter
Re: [REQUEST] New tilefactor setting for beam weapons
From an uneducated standpoint it looks like it got disabled because the beam tended to fade out too soon depending on the distance to its target.
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline Aesaar

  • 210
Re: [REQUEST] New tilefactor setting for beam weapons
That's why this needs to be defined on a per segment basis, not for the whole beam weapon.  It's specifically so the first x meters of a beam can look different from the rest by applying a segment only for that part.

Bobboau: I'm not a coder.  I have no idea how to implement this.  This seemed the easiest way to do it, but if there's another, easier way which'll give the same results, I certainly wouldn't mind.
« Last Edit: June 13, 2014, 03:41:25 pm by Aesaar »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: [REQUEST] New tilefactor setting for beam weapons
what would be really nice is the ability to specify this for start or end, you might want for instance a section that is visible only near the end, and we have enough data to allow that in that a negative max length could mean length from end, not start.
I have no development environment set up so I can't just do it and test it and post a proper patch, but if someone who does have such an environment  would like to give this a shot what you would have to change is...

weapons.h
    beam_weapon_section_info - you need to add a float, lets call it max_length

weapons.cpp
    parse_weapon - at the end of the section parse code (after stuff_float(&bsip->translation); before // if we are actually removing this index then reset it and we'l) add
Code: [Select]
if ( optional_string("+Max Length:") )
stuff_float(&bsip->max_length);
else
bsip->max_length = 0.0f;

beam.cpp
    beam_render -- find the chunk that looks like this:
Code: [Select]
// calculate the beam points
scale = frand_range(1.0f - bwsi->flicker, 1.0f + bwsi->flicker);
beam_calc_facing_pts(&top1, &bottom1, &fvec, &b->last_start, bwsi->width * scale * b->shrink, bwsi->z_add);
beam_calc_facing_pts(&top2, &bottom2, &fvec, &b->last_shot, bwsi->width * scale * scale * b->shrink, bwsi->z_add);

and change it to this

Code: [Select]
length = vm_vec_dist(&b->last_start, &b->last_shot); //this line is lower in the function, it needs to be moved above start/end point calculation, it actually could be moved out of the loop entirely

vec3d beam_section_start = b->last_start;
vec3d beam_section_end = b->last_shot;

if(bwsi->max_length > 0.0f){
vm_vec_scale_add2(&beam_section_end, &beam_section_start, &fvec, MIN(length, bwsi->max_length));
}
else if(bwsi->max_length < 0.0f){
vm_vec_scale_add2(&beam_section_start, &beam_section_end, &fvec, -MIN(length, -bwsi->max_length));
}

// calculate the beam points
scale = frand_range(1.0f - bwsi->flicker, 1.0f + bwsi->flicker);
beam_calc_facing_pts(&top1, &bottom1, &fvec, &beam_section_start, bwsi->width * scale * b->shrink, bwsi->z_add); //note beam_section_start
beam_calc_facing_pts(&top2, &bottom2, &fvec, &beam_section_end, bwsi->width * scale * scale * b->shrink, bwsi->z_add); //note beam_section_end
{grrrr... cannot add any formatting to code blocks, can't highlight changes}
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: [REQUEST] New tilefactor setting for beam weapons
Use quotes instead