Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: IronBeer on November 02, 2009, 07:14:48 pm

Title: Negative weapons- Weapons that recharge, and/or repair
Post by: IronBeer on November 02, 2009, 07:14:48 pm
Quick question- I'm playing with .tbls and an idea struck me: "What if I made a secondary weapon that functioned in much the same way as a disposable energy cell? Players could load these cells in place of a missile, and be able to recharge a portion of their laser energy."

However, it would seem that simply setting the "energy used" field to negative on a secondary weapon has no effect. Is there any way to make a secondary weapon give back energy in some fashion, either on launch, on impact, or upon collision with the blast? If there's a way to do this, I'd really like to know.

Oh, on a related note, I'd wager that a method that makes "recharging" possible may make "repair beam" weapons possible as well. Would this be the case?

(Edit- Title)
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Topgun on November 02, 2009, 07:31:48 pm
you can make weapons that recharge your energy, they are great when paired with a gun that uses a lot of energy. you can also make a gun that heals, the problem is that the ai will still act like you are attacking them.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Droid803 on November 02, 2009, 08:13:32 pm
Hmm...that'd be a pretty cool idea.
How'd you get energy recharge to work?
I'm thinking that it'd have to be an ammo-based primary weapon as secondaries don't mess with power.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Topgun on November 02, 2009, 08:34:46 pm
negative energy consumption. its worked since retail, lol.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: IronBeer on November 02, 2009, 08:41:36 pm
I'm thinking that it'd have to be an ammo-based primary weapon as secondaries don't mess with power.
Ah.... see, that's the thing. I want it to be a secondary weapon, as a trade-off for missiles.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Droid803 on November 02, 2009, 08:48:44 pm
Hm...would making a shockwave that does negative shield damage recharge a quadrant of your shields?
(Make it remote-detonating, of course, so you can blow it up right near yourself)

I say one quadrant because apparently a shield-stripping (as in 9000+ shield damaging) only strips off one quad :(
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Nuke on November 03, 2009, 12:28:43 am
all that would be needed is a weapon flag to tell ai that theyre being repaired.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Sushi on November 03, 2009, 08:47:33 am
you can make weapons that recharge your energy, they are great when paired with a gun that uses a lot of energy. you can also make a gun that heals, the problem is that the ai will still act like you are attacking them.

I thought I tried this once and it didn't work for me...  :confused:

I was trying to make a "subsystem repair" gun.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Topgun on November 03, 2009, 09:06:09 am
I, personally, have only tried weapons with negative energy consumption, but I recall others making guns that can heal other ships, but, like I said, the only problem was that the ai considered it an attack.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: IronBeer on November 03, 2009, 03:20:58 pm
Ok, I've ran a few more tests, and here are the results-

Secondary weapons do not affect weapon or afterburner energy at all.

I'm now trying to create a sort of "instantly-exploding cluster bomb" that could hit the player with a bolt of "recharge laser", but I can't seem to make a secondary spawn any primaries. Whenever I set a secondary weapon to create a bolt of primary fire, I just get a generic "HL-7" looking bolt that doesn't seem to do anything. Is there any way to spawn primary weapons through the firing of a secondary?  :confused:

@Droid- This method of "blanketing" the player in explosions could get recharge across all shield quadrants, providing you hit the player fairly evenly.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Topgun on November 03, 2009, 04:41:53 pm
only a primary weapon can recharge energy.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: IronBeer on November 03, 2009, 04:58:00 pm
only a primary weapon can recharge energy.
Indeed. I've found that flak weapons can cause recharge even through their blasts.

Now, this is the last method I can think of- is there any way to spawn primary weapon shots from a secondary weapon. I've tried setting primaries as the children for a missile, but they don't seem to function properly. I just want to exhaust all avenues of approach before deciding that secondary "energy cells" are an impossibility.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Qent on November 03, 2009, 07:18:25 pm
Primaries can be set to detonate prematurely with Detonation Range, though I haven't tried it with child primaries. I think in general child primaries should work.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Aardwolf on November 03, 2009, 07:28:32 pm
Negative mass / blast force weapons can be amusing.
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: IronBeer on November 03, 2009, 08:14:15 pm
Primaries can be set to detonate prematurely with Detonation Range, though I haven't tried it with child primaries. I think in general child primaries should work.
I am managing to get child primaries to work for the most part, but some aspects seem to be misbehaving. Flak as a child doesn't seem to detonate, thus negating the usefulness of that solution.

The only other solutions I could think of revolve around directing a recharging bolt back at the player. This would have to be done at least as a secondary munition. I know there's a "spawn cone" field for secondary munitions, can that be set to direct a child back down the original line of approach?

And the other method would be as follows: Synaptic-type secondary detonates right on top of the player and launches a suitable number of child munitions in all directions. Each child munition would then saturate the area with tertiary recharging weapon bolts; the tertiary munitions would need to have their ranges carefully manged...

C'mon, there's gotta be a way (no matter how convoluted) to make a secondary weapon ultimately recharge gun energy!
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: FUBAR-BDHR on November 03, 2009, 08:27:19 pm
What about creating a dummy secondary and just using an event to do the recharge?  Something like

when
-->secondary-fired-since
-->set-shield-energy
----> +
------->shield-recharge-percentage
-------> whatever the rechared is
Title: Re: Negative weapons- Weapons that recharge, and/or repair
Post by: Qent on November 03, 2009, 08:53:36 pm
Have you tried a detonating non-flak primary?