How to Give a Ship Fuel-Burn by IWAssassin, Tamerlane, and Thought
the "fuelburn.lua" script and install it into "Data\Scripts\Fuelburn\".
Giving a ship fuel involves editing four main files:
StartShipHardPointConfig(NewShipType, "Engine", "Weapon_FrontGun", "System", "Innate", "Damageable", "Kushan_int_Engine", "", "", "", "", "", "", "", "")
needs to be a valid hardpoint on the HOD file. For the interceptor I simply used the hardpoint for the gun. Ideally you'll want to add a "FuelTank
needs to be the name of your fuel tank subsystem. I used the "hgn_C_engine" as a base.
Add this line:
NewSubSystemType.Visible = 0
This ensures you don't see something like a carrier engine module strapped to an interceptor.
If there is a subsystem multiplier, remove it, or change Linear to "None" -- unless you want an interceptor with 50% fuel to move at 50% speed.
Here you need to create a sobgroup for EVERY ship that is in the ".level" file that uses fuel. Syntax for the sobgroup name is as follows:
So, if you have 3 Squadrons of Hiigaran Attack Bombers you will need three sobgroups, named:
Make sure you add the fighters to the sobgroups, as well using the addToSOBGroup
Note: if you dont have ships in the ".level" file that use fuel, you can ignore this edit.
To reference the FuelBurn
script, you need to add this line to the file:
For the initialization function add one line for every ship class you have that burns fuel, e.g.:
FuelBurn_Initialize(, , , )
: the name of the class of ship, e.g. "kushan_interceptor" or "hgn_attackbomber".
: the number of Ships of that class you have in the ".level" file.
: the duration (in 0.1 second intervals) that the fuel lasts. 5 minutes of fuel is 3000.
the name of the fuel tank. It is the second parameter in the StartShipHardPointConfig()
Next, add a rule that will handle fuel burn. In this rule, you need only one line:
Optionally, you MAY burn only some ships using the function:
All parameters are the same as for FuelBurn_Initialize().
- Some ships will not be able to dock with Hiigaran Carrier. This is because the ship is not maneuverable enough with the reduced speed in order to make the tight turns necessary to dock.
- Squadrons with more than one ship will only show fuel drain on the first Ship. If the first Ship is destroyed, the engine starts draining from the next ship which will have 100% fuel.