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
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