Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

How to Make Salvo-Fire Rockets/Missiles

The general place to discuss MOD''ing Freelancer!

Post Sat Apr 02, 2005 10:26 am

How to Make Salvo-Fire Rockets/Missiles

Hi there folks. I recently thought of something, and I'd like to share it with y'all.

I've figured out how to make salvo-fire rocket-launchers- y'know, like you see in anime or RL, instead of the "all-or-nothing" fire sequence currently used. Here's how it works- it's very simple, but it requires that you think about things a little differently than the average bear

To make things fire in a sequence, what we need is two timers for a weapon. To do this... we're going to use the Energy level of a ship as the second timer. This has advantages and disadvantages, which I'll explain.

So. First off, we'll need an energy supply that recharges very quickly- as quickly as we want the rockets to fire. So, for example, if we have an energy supply with 1000 units, the recharge rate should be set to 1000 to recharge it every second, 2000 for a half-second, and so forth. With me here? Energy recharges every tick- the recharge rate is the total per second, not the total per tick. FL seems to round things up, if that's a fractional number, but I digress.

So... let's say that we want to build something with a missile system that fires once every quarter-second. We could give it an energy supply of 1000, and a recharge rate of 4000.

The next part is simple- we need to make our rockets/missiles/torpedoes. These are easy to do. All we need to do is have it use up the Energy in the ship... and its refire rate should be quite low- in fact, it should be a multiple of how many rockets are allowed to be fired in each "salvo" + 1, at a minimum.

So, for example... let's say that we want to have a six-missile launcher cluster, that fires six small missiles, once per quarter of a second, and then waits 5 seconds. So... the refire rate should be 6.5.

Lastly... the energy used by the missiles must be half or more of the energy reserve in the ship. This means that only ONE missile will be allowed to fire at one time- the FL game engine will always check and see which weapons are "waiting", and then it will fire as many weapons as can draw from the available energy reserves. So... to keep it simple in this case... we'll make the missiles use 1000 energy a shot.

Now... all we've gotta do is add 6 hardpoints... mount the appropriate launchers... and there you go

Now, before anybody starts playing with this... one small warning. Those of us who... you know... search the Forums here once in awhile... will know that the maximum number of weapons that can be on a ship is 32. Each missile in a given salvo system's going to use 1... so bear that in mind- you can do some pretty huge salvo-fire weapons this way, but pass 32, and it's CTD time. Not to mention the lag

And, of course, this idea isn't terribly suitable for "vanilla" FL. While there are plenty of ways to deal with an energy supply that's effectively unlimited (so far as regular FL weapons are concerned), it would involve changes to the energy consumption rates of every weapon in the game- or a much simpler compromise (imho)... just ignoring it, and letting people fire their weapons without running out've energy.

@sw: didn't realize those worked, until I came back through here... at any rate, np.

Edited by - Argh on 4/2/2005 12:25:27 PM

Post Sat Apr 02, 2005 5:46 pm

So, someone could make an Apache mod that fired Stinger missiles lke in real life? Thats cool.

//INTERCEPTED TRANSMISSION//
//LOCATION= HALO PULSE GENERATOR, FACILITY A5//
You wanna keep you brain inside you head I'd tell those boys to CHILL
from Halo 2

Post Sat Apr 02, 2005 6:55 pm

Erm... well... you're getting the specifics wrong, but yes... there are a lot've RL weapon systems that use salvo-fire. Mainly, they do so so that rounds in a given salvo won't interfere with one another, but that's besides the point, at least to me- it just looks much cooler than firing one big burst

I'm sure that there are other areas where this technique of using multiple things as timers could also work, too.

Post Sat Apr 02, 2005 11:25 pm

there are also some gun models that fire two munitions at once, and i think one of them fires more than two. shotgun .3ds ones i believe. thats how i made my one-shot-kill gun. you could half the number of hardpoints needed to be made.

Post Tue Apr 05, 2005 3:23 am

I simply made a missile-launcher that fires 4 missiles at once. That´s not so good as your idea but much easier to do. The only problem is that you can´t fire if you have less than 4 missiles.

Post Thu Apr 07, 2005 9:32 pm

I tried this and it didn't work. Would only fire one weapon at the set refire rate. Are you sure about the energy check? The behaviour I am seeing suggests that the other weapons fire at the same time but produce no projectile if there is not enough energy. This means that they all wait on the reload time before the process is repeated.

On the other hand I did make a three-pronged torpedo attack that looks pretty cool so my time was not wasted.. completely

PS. The continuous 'fire' button for missiles is Q, if you use the mouse then you have to click like a madman.

Check out the latest beta's of the Freelancer S.D.K. 1.5 and Freelancer Explorer v2.x

Post Fri Apr 08, 2005 8:28 am

Hmm. Previous experiments showed that weapons would check energy status and "cool down" times. That's why, when you run out've energy with rapid-fire guns, you never know for certain which guns will continue to fire sporadically.

But you're right, it's not random- once that state occurs, it tends to stay on the same guns. Lemme build a test-case here, and I'll check it out.

<builds some code>

Hmmmmph.

You're right. Guns with the same cool-down status will all fire at the same rates, period- so you either get a full salvo, or the same gun firing at the same time.

BUT!!!

If you make multiple guns, with different fire-rates, it'll work. The only bummer is... when you hold down the trigger, the first shot is always going to be a singleton, until the entire group has recharged. If you give it a long enough refresh (let's say... 1 second, 1.1 seconds, etc.), then this looks cool... after that first solitary projectile, which looks kind've lame.

But... waitaminute... you could make that first gun in the series silent... and use an invisible projectile... that disappeared instantly.... oh yeah! So you could... not only have a weapon that fired in a ripple... but it could have a delay timer, too. Very cool, and this does work... just fine!

Oh yeah... and I've also discovered how to make a gun that only fires so long as your shields are at 100%. Most interesting... I hadn't really thought about it, but if the guns eat 100% energy, and shields are recharging (and thus, eating energy)... then you end up with a gun that only fires when the shields are 100%. And I'm sure that there are other ways to play with that one. Fun stuff for interesting game-balance there.

Edited by - Argh on 4/8/2005 9:49:01 AM

Post Fri Apr 08, 2005 11:07 am

How about you time your shots differently? The first shot from the gun with the longest recharge time and then the others progressively get faster. Also you make it so each weapon uses up 75% of your energy with each shot and have the powerplant recharge once per tick.

Check out the latest beta's of the Freelancer S.D.K. 1.5 and Freelancer Explorer v2.x

Return to Freelancer General Editing Forum