Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: General Battuta on January 02, 2017, 12:47:58 pm

Title: Feasibility Study: FINISH HIM
Post by: General Battuta on January 02, 2017, 12:47:58 pm
Proposal: a slow ROF precision Archer-type weapon that deals damage equal to the target's hull damage.

Purpose: this is a cool finisher weapon that does no damage when the target is undamaged, but really hits hard once the target approaches 50% hull. It's useless against shields until the target has some hull damage. It has a maximum damage cap so it can't knock cruisers and destroyers from 50 to 0.

Fluff: the weapon exploits breaches in the target's defenses, but cannot penetrate even the most basic armor without an opening.

How tricky would this be to implement? Have we ever had a weapon with variable damage before?
Title: Re: Feasibility Study: FINISH HIM
Post by: The E on January 02, 2017, 02:09:34 pm
We do not have variable-damage weapons anywhere. This does sound something that we'd want to use lua for though.
Title: Re: Feasibility Study: FINISH HIM
Post by: Axem on January 02, 2017, 02:51:52 pm
Well there is damage attenuation with beams and damage time. I guess it works different in the code though?

Problem with doing that with lua is there's no real applyDamage function or a way to modify a weapon's damage on impact with a ship. That's not to say you couldn't find a way to do it with lua, but you'd be reinventing a lot of bits and pieces that the game is already doing, which to me sounds a bit wasteful.

Also the armor.tbl has some interesting calculation stuff to it. http://www.hard-light.net/wiki/index.php/Armor.tbl#.2BCalculation:

Maybe target's health could be added there? Might be able to twist something into what Battuta is suggesting.
Title: Re: Feasibility Study: FINISH HIM
Post by: The E on January 02, 2017, 02:56:37 pm
One of the things I want to do is to add a field to weapon definitions that's basically "if this weapon hits something, execute this script".

Yes, this is already supported, but I find the syntax for scripting tables to be pretty bad and unintuitive :)
Title: Re: Feasibility Study: FINISH HIM
Post by: krevett62 on January 02, 2017, 02:58:31 pm
One of the things I want to do is to add a field to weapon definitions that's basically "if this weapon hits something, execute this script".

Yes, this is already supported, but I find the syntax for scripting tables to be pretty bad and unintuitive :)

It would be a nice feature!
Title: Re: Feasibility Study: FINISH HIM
Post by: Axem on January 02, 2017, 03:30:15 pm
The E: That's cool, but we'd still need some sort of a applyDamage scripting function. Otherwise the script is going to need to check for shield hits, carry damage over from shields going down and ensure the right ship gets the kill (along with anything else the damage code does).
Title: Re: Feasibility Study: FINISH HIM
Post by: The E on January 02, 2017, 03:49:26 pm
You're absolutely right about that.
Title: Re: Feasibility Study: FINISH HIM
Post by: Rheyah on January 12, 2017, 05:34:35 pm
Is it possible to do > 1 armour multipliers?  I can't remember since it's been a while since I modded but you could set the Archer to a special damage type which does many times normal damage to an armour type, then manually change the armour type with SEXPs?

Failing that, you could set the damage to be unreasonably high, but set the armour multipliers to very low for every other damage type and then change the armour.