Author Topic: fighter beams  (Read 35339 times)

0 Members and 1 Guest are viewing this topic.

Offline Setekh

  • Jar of Clay
  • 215
    • Hard Light Productions
Quote
Originally posted by Bobboau
HOLY **** IT WORKED!!!!1!!!111

the targetting beam now comes out of all weapon slots and uses energy!!!

I can't beleve it worked :jaw:
I am SO happy and exited
I'll do a little more testing then I'll post the EXE


:jaw: :jaw: :jaw:
- Eddie Kent Woo, Setekh, Steak (of Steaks), AWACS. Seriously, just pick one.
HARD LIGHT PRODUCTIONS, now V3.0. Bringing Modders Together since January 2001.
THE HARD LIGHT ARRAY. Always makes you say wow.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
one little bug, it still fire's when you're out of energy :)
it will only fire out of one bank at a time, but it will fire out of the entire bank
AI still won't use it


as soon as I fix the first two problems, I'll post the fix

and thanks Dave for pointing out that stupid little mistake of mine :)
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
I forgot to mention a little bit I had imediatly after the ship_start_targeting_laser(shipp); line 5121 or there abouts

Code: [Select]

polymodel *po = model_get( Ship_info[shipp->ship_info_index].modelnum );
int num_slots = po->gun_banks[shipp->targeting_laser_bank].num_slots;
shipp->weapon_energy -= num_slots*winfo_p->energy_consumed;
if(shipp->weapon_energy < 0.0f){
shipp->weapon_energy = 0.0f;


this is were I'm about to add the bit that says not to fire it if you're out of energy
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
I think I fixed the two bugs I'm likely to be able to fix anytime soon

were it called ship_start_targeting_laser(shipp);
I put this in,
Code: [Select]

if((winfo_p->wi_flags & WIF_BEAM) && (winfo_p->b_info.beam_type == BEAM_TYPE_C)){
polymodel *po = model_get( Ship_info[shipp->ship_info_index].modelnum );
int num_slots = po->gun_banks[shipp->targeting_laser_bank].num_slots;
shipp->weapon_energy -= num_slots*winfo_p->energy_consumed;
if(shipp->weapon_energy < 0.0f){
shipp->weapon_energy = 0.0f;
}
else{
ship_start_targeting_laser(shipp);
}
continue;
}



I'm sloppy I know, I'll try moving this into  the ship_start_targeting_laser() function latter

the processing function is now

Code: [Select]

void ship_process_targeting_lasers()
{
beam_fire_info fire_info;
ship_obj *so;
ship *shipp;
polymodel *m;

// interate over all ships
for ( so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so) ) {
// sanity checks

shipp = &Ships[Objects[so->objnum].instance];
polymodel *po = model_get( Ship_info[shipp->ship_info_index].modelnum );
int num_slots = po->gun_banks[shipp->targeting_laser_bank].num_slots;

if(so->objnum < 0){
continue;
}
if(Objects[so->objnum].type != OBJ_SHIP){
continue;
}
if(Objects[so->objnum].instance < 0){
continue;
}

// if our trigger is no longer down, switch it off
if(!(shipp->flags & SF_TRIGGER_DOWN)){
ship_stop_targeting_laser(shipp);
continue;
}

// if we have a bank to fire - fire it
if((shipp->targeting_laser_bank >= 0) && (shipp->targeting_laser_bank < 2)){
// try and get the model
m = model_get(shipp->modelnum);
if(m == NULL){
continue;
}

// fire a targeting laser
if (shipp->targeting_laser_bank != 2){

for ( int j = 0; j < num_slots; j++ ){
fire_info.accuracy = 0.0f;
fire_info.beam_info_index = shipp->weapons.primary_bank_weapons[shipp->targeting_laser_bank];
fire_info.beam_info_override = NULL;
fire_info.shooter = &Objects[shipp->objnum];
fire_info.target = NULL;
fire_info.target_subsys = NULL;
fire_info.turret = NULL;
fire_info.targeting_laser_offset = m->gun_banks[shipp->targeting_laser_bank].pnt[j];
shipp->targeting_laser_objnum = beam_fire_targeting(&fire_info);

// hmm, why didn't it fire?
if(shipp->targeting_laser_objnum < 0){
Int3();
ship_stop_targeting_laser(shipp);
}
}
}
if (shipp->targeting_laser_bank == 2){

for (int q = 1; q<0; q--)
for ( int j = 0; j < num_slots; j++ ){
fire_info.accuracy = 0.0f;
fire_info.beam_info_index = shipp->weapons.primary_bank_weapons[shipp->targeting_laser_bank];
fire_info.beam_info_override = NULL;
fire_info.shooter = &Objects[shipp->objnum];
fire_info.target = NULL;
fire_info.target_subsys = NULL;
fire_info.turret = NULL;
fire_info.targeting_laser_offset = m->gun_banks[q].pnt[j];
shipp->targeting_laser_objnum = beam_fire_targeting(&fire_info);

// hmm, why didn't it fire?
if(shipp->targeting_laser_objnum < 0){
Int3();
ship_stop_targeting_laser(shipp);

}
}
}
}
}
}



I'm sure there is a more eligent way of doing this, actualy I know there is becase I realised it a few seconds after I started the build, but it's 5:00 am and this isn't ever going to be used in anything but me playing around (I'm sure Kaz will have REAL beams, that being a new type with warmup and down and everything in a few days) so to hell with it

now I'm gona look at the AI code and see if there is something simple like
if(WIF_BEAM)
then_don't_fire_stupid()
that I can alter
don't think it'll be that simple though
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
oh, and I made a small change to the starting func
Code: [Select]

void ship_start_targeting_laser(ship *shipp)
{
int bank0_laser = 0;
int bank1_laser = 0;

// determine if either of our banks have a targeting laser
if((shipp->weapons.primary_bank_weapons[0] >= 0) && (Weapon_info[shipp->weapons.primary_bank_weapons[0]].wi_flags & WIF_BEAM) && (Weapon_info[shipp->weapons.primary_bank_weapons[0]].b_info.beam_type == BEAM_TYPE_C)){
bank0_laser = 1;
}
if((shipp->weapons.primary_bank_weapons[1] >= 0) && (Weapon_info[shipp->weapons.primary_bank_weapons[1]].wi_flags & WIF_BEAM) && (Weapon_info[shipp->weapons.primary_bank_weapons[1]].b_info.beam_type == BEAM_TYPE_C)){
bank1_laser = 1;
}

// if primary banks are linked
if(shipp->flags & SF_PRIMARY_LINKED){
[b] if(bank0_laser && bank1_laser){
shipp->targeting_laser_bank =2;
return;
}
[/b] if(bank0_laser){
shipp->targeting_laser_bank = 0;
return;
}
if(bank1_laser){
shipp->targeting_laser_bank = 1;
return;
}


}
// if we only have 1 bank selected
else {
if(bank0_laser && (shipp->weapons.current_primary_bank == 0)){
shipp->targeting_laser_bank = 0;
return;
}
if(bank1_laser && (shipp->weapons.current_primary_bank == 1)){
shipp->targeting_laser_bank = 1;
return;
}
}
}
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 Shrike

  • Postadmin
  • 211
    • http://www.3dap.com/hlp
Quote
Originally posted by Bobboau
I'll take a look at that

and

HOLY **** IT WORKED!!!!1!!!111
See, that's why I didn't enable the language filters.  You can't have 'oh ****' moments without the ****. ;)

And Bobboau?  Nice work.  :)  I'm gonna post the news.
WE ARE HARD LIGHT PRODUCTIONS. YOU WILL LOWER YOUR FIREWALLS AND SURRENDER YOUR KEYBOARDS. WE WILL ADD YOUR INTELLECTUAL AND VERNACULAR DISTINCTIVENESS TO OUR OWN. YOUR FORUMS WILL ADAPT TO SERVICE US. RESISTANCE IS FUTILE.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
I would post a pic, but the VW servers are down
do you want me to mail you a few and have you upload them some were
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 Shrike

  • Postadmin
  • 211
    • http://www.3dap.com/hlp
WE ARE HARD LIGHT PRODUCTIONS. YOU WILL LOWER YOUR FIREWALLS AND SURRENDER YOUR KEYBOARDS. WE WILL ADD YOUR INTELLECTUAL AND VERNACULAR DISTINCTIVENESS TO OUR OWN. YOUR FORUMS WILL ADAPT TO SERVICE US. RESISTANCE IS FUTILE.

 

Offline Setekh

  • Jar of Clay
  • 215
    • Hard Light Productions
Quote
Originally posted by Shrike
See, that's why I didn't enable the language filters.  You can't have 'oh ****' moments without the ****. ;)


:D:ha: Noted.
- Eddie Kent Woo, Setekh, Steak (of Steaks), AWACS. Seriously, just pick one.
HARD LIGHT PRODUCTIONS, now V3.0. Bringing Modders Together since January 2001.
THE HARD LIGHT ARRAY. Always makes you say wow.

 

Offline Shrike

  • Postadmin
  • 211
    • http://www.3dap.com/hlp
This was sent to me by Bobbau.  Very cool stuff.

WE ARE HARD LIGHT PRODUCTIONS. YOU WILL LOWER YOUR FIREWALLS AND SURRENDER YOUR KEYBOARDS. WE WILL ADD YOUR INTELLECTUAL AND VERNACULAR DISTINCTIVENESS TO OUR OWN. YOUR FORUMS WILL ADAPT TO SERVICE US. RESISTANCE IS FUTILE.

 

Offline Shrike

  • Postadmin
  • 211
    • http://www.3dap.com/hlp
Now, make a tag that makes allows non shield piercing beams....  I wonder if that's even possible (without some major work that is)
WE ARE HARD LIGHT PRODUCTIONS. YOU WILL LOWER YOUR FIREWALLS AND SURRENDER YOUR KEYBOARDS. WE WILL ADD YOUR INTELLECTUAL AND VERNACULAR DISTINCTIVENESS TO OUR OWN. YOUR FORUMS WILL ADAPT TO SERVICE US. RESISTANCE IS FUTILE.

 

Offline Setekh

  • Jar of Clay
  • 215
    • Hard Light Productions
That is nice!! :D
- Eddie Kent Woo, Setekh, Steak (of Steaks), AWACS. Seriously, just pick one.
HARD LIGHT PRODUCTIONS, now V3.0. Bringing Modders Together since January 2001.
THE HARD LIGHT ARRAY. Always makes you say wow.

 

Offline Shrike

  • Postadmin
  • 211
    • http://www.3dap.com/hlp
Obviously, fighter beams will have to be carefully balanced.... they are extremely powerful due to their shield-piercing abilities.
WE ARE HARD LIGHT PRODUCTIONS. YOU WILL LOWER YOUR FIREWALLS AND SURRENDER YOUR KEYBOARDS. WE WILL ADD YOUR INTELLECTUAL AND VERNACULAR DISTINCTIVENESS TO OUR OWN. YOUR FORUMS WILL ADAPT TO SERVICE US. RESISTANCE IS FUTILE.

 

Offline an0n

  • Banned again
  • 211
  • Emo Hunter
    • http://nodewar.penguinbomb.com/forum
Quote
Originally posted by Shrike
Now, make a tag that makes allows non shield piercing beams....  I wonder if that's even possible (without some major work that is)

Uh, can't you just edit the Targetting Lasers tbl entry to do that?
"I.....don't.....CARE!!!!!" ---- an0n
"an0n's right. He's crazy, an asshole, not to be trusted, rarely to be taken seriously, and never to be allowed near your mother. But, he's got a knack for being right. In the worst possible way he can find." ---- Yuppygoat
~-=~!@!~=-~ : Nodewar.com

 

Offline Shrike

  • Postadmin
  • 211
    • http://www.3dap.com/hlp
AFAIK there is no way to make a beam non shield piercing, currently anyhow.
WE ARE HARD LIGHT PRODUCTIONS. YOU WILL LOWER YOUR FIREWALLS AND SURRENDER YOUR KEYBOARDS. WE WILL ADD YOUR INTELLECTUAL AND VERNACULAR DISTINCTIVENESS TO OUR OWN. YOUR FORUMS WILL ADAPT TO SERVICE US. RESISTANCE IS FUTILE.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
I'm sure it would be one of the easier things to do, but well beond my abilitys,
I barely have any idea what I'm doing realy
I'll take a look at it though
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 an0n

  • Banned again
  • 211
  • Emo Hunter
    • http://nodewar.penguinbomb.com/forum
Quote
Originally posted by Shrike
AFAIK there is no way to make a beam non shield piercing, currently anyhow.

Can't be that hard. Just steal the code from the normal weapons and tweak it.
"I.....don't.....CARE!!!!!" ---- an0n
"an0n's right. He's crazy, an asshole, not to be trusted, rarely to be taken seriously, and never to be allowed near your mother. But, he's got a knack for being right. In the worst possible way he can find." ---- Yuppygoat
~-=~!@!~=-~ : Nodewar.com

 

Offline Shrike

  • Postadmin
  • 211
    • http://www.3dap.com/hlp
The problem is, beams might have the code ignore shields completely integral to their operation.  Again, it might be fairly easy, it might not.

What would be nice would be a simple tag 'shield piercing' that makes any weapon go through shields..... weapons without it do not ignore shields.
WE ARE HARD LIGHT PRODUCTIONS. YOU WILL LOWER YOUR FIREWALLS AND SURRENDER YOUR KEYBOARDS. WE WILL ADD YOUR INTELLECTUAL AND VERNACULAR DISTINCTIVENESS TO OUR OWN. YOUR FORUMS WILL ADAPT TO SERVICE US. RESISTANCE IS FUTILE.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
looks like I could add a "ignore sheild" flag fairly easily, for pulse weapons
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 Setekh

  • Jar of Clay
  • 215
    • Hard Light Productions
Quote
Originally posted by Bobboau
looks like I could add a "ignore sheild" flag fairly easily, for pulse weapons


That'd be pretty flash. :) But I have a feeling that the initial problem of the beam would still be a problem... man, I really gotta get into this code summore. :)
- Eddie Kent Woo, Setekh, Steak (of Steaks), AWACS. Seriously, just pick one.
HARD LIGHT PRODUCTIONS, now V3.0. Bringing Modders Together since January 2001.
THE HARD LIGHT ARRAY. Always makes you say wow.