Author Topic: fighter beams  (Read 36079 times)

0 Members and 3 Guests are viewing this topic.

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
Welcome r0nin I hope you have a good time here at HLP :nod:

 

Offline r0nin

  • 24
    • http://mywebpages.comcast.net/r0nin/
Quote
Originally posted by Maeglamor
Welcome r0nin I hope you have a good time here at HLP :nod:


Thanks! :D  I've been modding other stuff for a while (my C++ is a little rusty), but the Robotech Freespace2 Mod got me interested in modding for Freespace.

BTW, by changing the MC_CHECK_MODEL flag over to MC_CHECK_SHIELD, I got the beam to check for the presense of shields, but it would no longer do damage to the hull/subsystems (unfortunately, I have the Robotech mod on and none of those models HAVE shields... so someone with shielded ships let me know if the beam does damage to them with that flag).   I will be trying to write some code to check if no shield is hit, so that the beam will then check for model hits afterward...
"Have code, will travail..."
Member of the Robotech FS2 Mod.
http://www.robotechlan.com/freespace2/

 
Re: A little investigation on the shield problem...
Quote
Originally posted by r0nin
When the beam hits a ship it calls ship_apply_local_damage (line 2788 of code/Weapon/Beam.cpp).  If you check the parameters it passes, the beam passes a -1 to the function under shield quadrant.

In code/ShipHit/ShipHit.cpp on line 2284, the comment tells you that a -1 passed through in the shield quadrant parameter makes the hit ignore the shield.  It also tells you that the ship_apply_local_damage function assumes that whoever called the function knows if the shield got hit or not.

So what we need to do is find the shield facing that is hit.  Well, as _argv[-1] noted, the beam weapon passes the MC_CHECK_MODEL rather than the MC_CHECK_SHIELD flag.  Looking at mc_check_subobj (line 821 of code/Model/ModelCollide.cpp), there is code for both shield and model hits.  So the if the shield flag is sent, it MIGHT check the shield first.  However, I can't find anyplace that checks shield first, then model if no shield, so I'm not sure if more code is needed...

Anyway, we need to determine shield face struck before the ship_apply_local_damage is called...


I have determined that it will check the shield if there is one. I'm pretty sure it'll check the model if the shield wasn't hit (or there is no shield), but I'm not sure. Why not make the change (ie, pass MC_CHECK_SHIELD), test that it works on shields as expected, then make a mission in FRED where your target has no shields?

 
Quote
Originally posted by Maeglamor
Welcome r0nin I hope you have a good time here at HLP :nod:


Harumph. I didn't get that wonderful nice greeting when I started posting here a few weeks ago. :mad: :snipe: :headz:

(Just playing. :lol: )

 

Offline r0nin

  • 24
    • http://mywebpages.comcast.net/r0nin/
Re: Re: A little investigation on the shield problem...
Quote
Originally posted by _argv[-1]


I have determined that it will check the shield if there is one. I'm pretty sure it'll check the model if the shield wasn't hit (or there is no shield), but I'm not sure. Why not make the change (ie, pass MC_CHECK_SHIELD), test that it works on shields as expected, then make a mission in FRED where your target has no shields?


Actually, I have. :( The Robotech mod (way cool, btw) has no ships with any shields (not even the shield mesh in the pofs).  Since I pretty much picked up FS2 in order to play around with those guys' mod, I would hate to have to uninstall and reinstall in order to test out a ship that has shields.

As for the ship without shields, the beam weapons have NO effect on the ship when I change the flag to MC_CHECK_SHIELD.  This leads me to believe (though I haven't tested it) that the beam would do damage to shields but needs some additional coding to have it check for both.  Still working on it...
"Have code, will travail..."
Member of the Robotech FS2 Mod.
http://www.robotechlan.com/freespace2/

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
Quote
I would hate to have to uninstall and reinstall in order to test out a ship that has shields.

D00d...if I had to uninstall to check something on another MOD, I would have to do that several times a day!

Just rename your /data directory to /data_RT (Robo Tech or whatever) and start the game and it will make you a new data directory.  Then you can test yourself.
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Quote
Originally posted by _argv[-1]


Harumph. I didn't get that wonderful nice greeting when I started posting here a few weeks ago.

"Gunnery control, commence plasma injection-"
-C

 

Offline Grey Wolf

Have you tryind copying and pasting from one of the other files that is similar to the original setup?
You see things; and you say "Why?" But I dream things that never were; and I say "Why not?" -George Bernard Shaw

 

Offline r0nin

  • 24
    • http://mywebpages.comcast.net/r0nin/
Hmmm.  Well, I've found out several things.  First off, the flags don't seem to do what I thought.  They just deterime the collision model tested against, but they don't generate the hit facing.  

What is interesting is that all that I needed to do was change the final number in line 2788 of code/Weapon/Beam.cpp from -1 to any other number corresponding to a shield face (1-6 or 0-5, I believe):

ship_apply_local_damage(&Objects[target], &Objects[b->objnum], &b->f_collisions[idx].cinfo.hit_point_world, beam_get_ship_damage(b, &Objects[target]), -1);

Then, the target takes damage to #2 (or whatever number you choose) shield every time it is hit, until the shield drops.  Then it takes damage to the hull, etc., as usual.  The only trick now is to figure out what the correct code is that represents the shield facing hit.

Unfortunately, the beam functions use a radically different code structure than the other weapon functions, so cutting-and-pasting doesn't work (and believe me, I've tried!)...

More later (when my brain stops hurting)...:sigh:
"Have code, will travail..."
Member of the Robotech FS2 Mod.
http://www.robotechlan.com/freespace2/

 

Offline r0nin

  • 24
    • http://mywebpages.comcast.net/r0nin/
Quote
Originally posted by IceFire

D00d...if I had to uninstall to check something on another MOD, I would have to do that several times a day!

Just rename your /data directory to /data_RT (Robo Tech or whatever) and start the game and it will make you a new data directory.  Then you can test yourself.


Thanks a ton!  That makes things muuuch easier...:yes:
"Have code, will travail..."
Member of the Robotech FS2 Mod.
http://www.robotechlan.com/freespace2/

 

Offline Edwin

  • 27
have you found a way to make it count the kills you make?
last time i played it refused to count kills when i used a beam weapon.  And can the color be made something NOT blue?  Like say green.

 

Offline Grey Wolf

Easily. Just change the name of the beam texture file in the TBL.
You see things; and you say "Why?" But I dream things that never were; and I say "Why not?" -George Bernard Shaw

 

Offline Edwin

  • 27
I have tried that. the beam stays blue or it instead fires little red pulses.

And how do you make it record kills?

 

Offline Grey Wolf

Quote
; Targeting Laser
;
$Name: @Targeting Laser
+Title: XSTR("Targeting Laser", 3306)
+Description:
XSTR(
"", 3307)
$end_multi_text
+Tech Description:
XSTR(
"", 3308)
$end_multi_text
$Model File:               none
;
;
;
@Laser Bitmap:               newglo6
@Laser Color:               190, 150, 250
@Laser Length:               10.0
@Laser Head Radius:            0.90
@Laser Tail Radius:            0.30
$Mass: 0.2
$Velocity: 450.0         ;; speed of the weapon (initially) -- may or may not change
$Fire Wait: 0.2            ;; in seconds
$Damage: 0
$Armor Factor:               0.9
$Shield Factor:               0.7
$Subsystem Factor:            0.3
$Lifetime: 0.0            ;; How long this thing lives
$Energy Consumed:            0.20         ;; Energy used when fired
$Cargo Size:               0.0            ;;
$Homing: NO
$LaunchSnd: 115            ;;
$ImpactSnd: 27            ;;
$Flags: ("beam")
$Icon: iconKayser
$Anim: Kayser
$Impact Explosion:            none
$BeamInfo:                              
   +Type:                  2            
   +Life:                   0.0            
   +Warmup:                0            
   +Warmdown:               0            
   +Radius:                1.0            
   +PCount:               0            
   +PRadius:               0            
   +PAngle:               0.0            
   +PAni:                  particleexp01   
   +Miss Factor:            0.0 0.0 0.0 0.0 0.0         
   +BeamSound:               115            
   +WarmupSound:            0            
   +WarmdownSound:            0            
   +Muzzleglow:            thrusterglow01      
   +Shots:                  0            
   +ShrinkFactor:            0.0         
   +ShrinkPct:               0.0         
   $Section:                        
      +Width:               0.5            
      +Texture:            beam-white      
      +RGBA Inner:         255 255 255 255   
      +RGBA Outer:         150 150 150 10   
      +Flicker:            0.1            
      +Zadd:               2.0            
   $Section:                        
      +Width:               0.75         
      +Texture:            beam-dblue2      
      +RGBA Inner:         160 160 0 255   
      +RGBA Outer:         60 60 0 10      
      +Flicker:            0.1            
      +Zadd:               1.0            
   $Section:                        
      +Width:               1.0            
      +Texture:            beam-dblue
      +RGBA Inner:         255 0 0 255
      +RGBA Outer:         60 0 0 10
      +Flicker:            0.1   
      +Zadd:               0.0
Change the things in bold to change the look.
You see things; and you say "Why?" But I dream things that never were; and I say "Why not?" -George Bernard Shaw

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
But you have to specify another color and be sure to look through the VP effects folder to make sure you get it right...OR....specify your own.
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
I totaly reworked the way I am handeling the fighter beams and got it to work, as in got I it to work on AI fighters,
damn I need to get the sheild hitting code to work now, cause it's insane!! you go after the lead fighter and you get all these beams and they all just converge on you're ass,
and makes 1 on 1 fights with AI ships an actual chalenge

this also has the glowpoint code, with the default blinking values I put in untill I get a POF editor capable of makeing the necisary data

oh, and this is almost untested, so ther'll probly be some bugs, and I am going to rework the way it handels energy usage
« Last Edit: June 29, 2002, 02:32:34 pm by 57 »
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 Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
case sensitive...
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 Anaz

  • 210
usually is...

something to do on case sensitive stuff is to convert whatever your gettting in from the file (as text) to upper case. If your using charachter arrrays than just use toupper on each array possition.
Arrr. I'm a pirate.

AotD, DatDB, TVWP, LM. Ph34r.

You WILL go to warpstorm...

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
no I meant my url, I had to edit my post
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 Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
k... maybe you didn't cach it the first time,
so here is a bit of intel the GTVI has just receved on new weapons the shivans have started useing







seems were screwed, but wait Alpha 1 has them too

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