Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: blowfish on February 03, 2009, 12:01:43 am

Title: A Peculiar Question of Beams and Subsystems
Post by: blowfish on February 03, 2009, 12:01:43 am
So, I was making this mission where I have these two capships fighting, one of which has a large main beam turret.  Now, I noticed that the other ship destroyed this turret far to often with its own beams (not good because this needs to be the player's job), so I created a variant of the beams it uses that do no subsystem damage.  After some experimentation, I found that the $Subsystem Factor: field in weapons.tbl has no effect on beams :(

Now, what I'm wondering, is how this should be addressed.  If there is an easy solution to this problem, I'd like to know.  As a last resort I'll use a repeating fire-beam SEXP that fires on a subsystem far from the main turret.  But I'm wondering if this should be classified as a bug/SCP feature request (and possibly submitted to mantis :nervous:).  I don't really think that making these values affect beams would really affect any beams that already exist, as I don't recall any beam (canon or not) that didn't have armor/shield/subsystem factors of all 1.0 :P
Title: Re: A Peculiar Question of Beams and Subsystems
Post by: Dilmah G on February 03, 2009, 02:42:26 am
So, I was making this mission where I have these two capships fighting, one of which has a large main beam turret.  Now, I noticed that the other ship destroyed this turret far to often with its own beams (not good because this needs to be the player's job), so I created a variant of the beams it uses that do no subsystem damage.  After some experimentation, I found that the $Subsystem Factor: field in weapons.tbl has no effect on beams :(

Now, what I'm wondering, is how this should be addressed.  If there is an easy solution to this problem, I'd like to know.  As a last resort I'll use a repeating fire-beam SEXP that fires on a subsystem far from the main turret.  But I'm wondering if this should be classified as a bug/SCP feature request (and possibly submitted to mantis :nervous:).  I don't really think that making these values affect beams would really affect any beams that already exist, as I don't recall any beam (canon or not) that didn't have armor/shield/subsystem factors of all 1.0 :P

You could have them start a larger distance from each other and have the player go in and disable it before they come in range, if that's viable. Otherwise I can't think of anything now
Title: Re: A Peculiar Question of Beams and Subsystems
Post by: FUBAR-BDHR on February 03, 2009, 02:58:13 am
You could try aligning the ships so that subsystem is out of the cone of fire of the attacking ships beams. 
Title: Re: A Peculiar Question of Beams and Subsystems
Post by: blowfish on February 03, 2009, 09:43:03 am
Neither are really viable options, considering how I want this mission to work out...
Title: Re: A Peculiar Question of Beams and Subsystems
Post by: Snail on February 03, 2009, 09:44:28 am
How about using the Armor Table?
Title: Re: A Peculiar Question of Beams and Subsystems
Post by: redsniper on February 03, 2009, 10:58:15 am
You could give the player a new job, or let him take the day off since he isn't needed here. ;)
Title: Re: A Peculiar Question of Beams and Subsystems
Post by: blowfish on February 03, 2009, 06:26:17 pm
How about using the Armor Table?

Tried that.  It has a tendency to make the beam do no damage to the ship (about 50% of the time)...


EDIT: I found out why beams' shield/subsystem factors are not applied:
Code: [Select]
if ((weapon_info_index >= 0) && (other_obj->type == OBJ_WEAPON)) {
if ( Weapon_info[weapon_info_index].wi_flags2 & WIF2_TRAINING ) {
return damage_left;
}
damage_left *= Weapon_info[weapon_info_index].subsystem_factor;
}

The object doing the damage must be flagged OBJ_WEAPON, however beams are flagged as OBJ_BEAM.  I guess it makes sense now...