Game crashes on ship launch
-
I have a couple ships in game that I’m trying to get working. Most of our ships are working fine, but a couple are being stubborn, and I have no idea why.
When you go to buy the ship, it shows in the ship purchase window. After you’ve bought it, it’s sitting right there in the docking bay as it should be. As soon as you go to launch, however, it crashes right away and dumps you to the desktop.
My thought is that there’s a coding error somewhere, or something wrong with the mounted equipment. I’ve looked the code over a dozen times and haven’t seen anything wrong, and the equipment used is working fine on other ships. FL error checker isn’t showing any sort of hardpoint issues, either.
I’m completely at a loss as to what’s going on here. I’ll include my code for one of the ships so maybe one of you can see what it is that I’m missing.
shiparch.ini
[Ship] ids_name = 237008 ids_info = 66508 ids_info1 = 66509 ids_info2 = 66608 ids_info3 = 66510 nickname = bb_tmi_lf ship_class = 0 type = FIGHTER mission_property = can_use_berths LODranges = 0, 9999, 9999, 9999, 9999 msg_id_prefix = gcs_refer_shiparch_Liblf DA_archetype = Ships\bb\devil\devil.cmp material_library = Ships\bb\devil\devil.mat material_library = fx\envmapbasic.mat envmap_material = envmapbasic pilot_mesh = generic_pilot nanobot_limit = 0 shield_battery_limit = 1 hold_size = 20 max_bank_angle = 35 fuse = intermed_damage_smallship01, 0.000000, 625 fuse = intermed_damage_smallship02, 0.000000, 312 fuse = intermed_damage_smallship03, 0.000000, 156 cockpit = Cockpits\Liberty\l_fighter.ini camera_offset = 6, 28.000000 camera_angular_acceleration = 0.050000 camera_horizontal_turn_angle = 23 camera_vertical_turn_up_angle = 5 camera_vertical_turn_down_angle = 30 camera_turn_look_ahead_slerp_amount = 1.000000 hit_pts = 2500 explosion_arch = explosion_li_fighter surface_hit_effects = 0, small_hull_hit_light01, small_hull_hit_light02, small_hull_hit_light03 surface_hit_effects = 150, small_hull_hit_medium01, small_hull_hit_medium02, small_hull_hit_medium03 surface_hit_effects = 300, small_hull_hit_heavy01, small_hull_hit_heavy02, small_hull_hit_heavy03 bay_door_anim = Sc_open baydoor bay_doors_open_snd = cargo_doors_open bay_doors_close_snd = cargo_doors_close HP_bay_surface = HpBayDoor01 HP_bay_external = HpBayDoor02 num_exhaust_nozzles = 3 shield_link = l_fighter_shield01, HpMount, HpEngine01, HpShield01 hp_type = hp_thruster, HpThruster01 hp_type = hp_countermeasure_dropper, HpCM01, HpCM02 hp_type = hp_torpedo_special_2, HpTorpedo01 HP_tractor_source = HpTractor_Source hp_type = hp_gun_special_1, HpWeapon01, HpWeapon02, hp_type = hp_fighter_shield_special_2, HpShield01 hp_type = hp_fighter_shield_special_1, HpShield01 hp_type = hp_fighter_shield_special_9, HpID01 hp_type = hp_fighter_shield_special_10, HpID02 linear_drag = 1.000000 mass = 125.000000 steering_torque = 20000.000000, 20000.000000, 58000.000000 angular_drag = 15000.000000, 15000.000000, 35000.000000 rotation_inertia = 2800.000000, 2800.000000, 1000.000000 nudge_force = 30000.000000 strafe_force = 20000.000000 strafe_power_usage = 2
goods.ini
[Good] nickname = bb_tmi_lf_hull category = shiphull ship = bb_tmi_lf price = 800000 ids_name = 12013 item_icon = Equipment\models\commodities\nn_icons\devil.3db [Good] nickname = bb_tmi_lf_package category = ship hull = bb_tmi_lf_hull addon = ge_kf_engine_01, internal, 1 addon = br_fighter_power01, internal, 1 addon = ge_s_scanner_01, internal, 1 addon = ge_s_tractor_01, internal, 1 addon = shield01_mark02_lf, HpShield01, 1 addon = LargeWhiteSpecial, HpHeadlight01, 1
Finally, FLSpew gives me this right at the crash:
E:\FL\Scratch\Source\Client\space\space.cpp(382) : *** WARNING: Unknown camera type? (ChaseCamera)
-
Crash on launch can be caused by a bad .mat file or a bad .sur file, and rarely by a .cmp file too.
If you rename the .mat file so it is not found, the ship will be untextured but will still launch, so you can diagnose a bad .mat file easily.
If you replace the .sur file with a vanilla one and rename it to the same name as the ship .cmp, (doesn’t matter about wrong shape/size) then this will prove or rule out the .sur file.
These are fast diagnoses that you can try before you change any coding.
If you get no progress with these 2 steps, replace the entire ship .cmp, .mat and .sur with copies of the ones from a working ship and just rename them to the name of the ship you are testing. (Save the suspect ship files in another folder! lol )
Let us know.
-
Removing the mat didn’t help, nor did removing or replacing the sur. When I pointed the shiparch at another working ship, the thing launched without incident.
So, we’ve learned that it’s not the mat, sur, or my code. That leaves the cmp. Just what I was afraid of, since I have no clue where to look for the problem.
-
Hey Capt.Morgan
try to replace your
[Good]
nickname = bb_tmi_lf_hull
category = shiphull
ship = bb_tmi_lf
price = 800000
ids_name = 12013 <–- change this to 237008
item_icon = Equipment\models\commodities\nn_icons\devil.3dband rename your devil with
bb_tmi_lf
for the cmp, sur and mat fileAnd it should work also get ride of
hp_type = hp_fighter_shield_special_9, HpID01
hp_type = hp_fighter_shield_special_10, HpID02could be a conflict there also
-
The last two entries are ID slots, and would have nothing to do with the crash. All our ships have them, but only the two ships crash the game.
As for the rest, I’ll give it a try tomorrow. However, I really don’t think the problem is due to the file name, as the shiparch points to the right one. I can see the ship on the base, after all, so it knows where my ship is.
-
Capt. Morgan:
Zip up and attach your ship’s .cmp and .mat and .sur file here please so someone can take a look to see if we can identify the problem.
Also please post your loadouts.ini entry for this ship, it may be just a hardpoint name that does not exist in the .cmp.
Just a bit of a cleanup:
camera_offset = 6, 28.000000
should be
camera_offset = 6, 28and make all of these into integers too (not x.000000)
linear_drag = 1.000000
mass = 125.000000
steering_torque = 20000.000000, 20000.000000, 58000.000000
angular_drag = 15000.000000, 15000.000000, 35000.000000
rotation_inertia = 2800.000000, 2800.000000, 1000.000000
nudge_force = 30000.000000
strafe_force = 20000.000000eagleclaw wrote:
Hey Capt.Morgantry to replace your
[Good]
nickname = bb_tmi_lf_hull
category = shiphull
ship = bb_tmi_lf
price = 800000
ids_name = 12013 <–- change this to 237008Yes, do this, to match the shiparch.ini ids_name entry. (But it’s not causing the problem).
eagleclaw wrote:
and rename your devil with
bb_tmi_lf
for the cmp, sur and mat fileWhy? No. It points correctly to the ship name in shiparch.ini
eagleclaw wrote:
And it should work also get ride ofhp_type = hp_fighter_shield_special_9, HpID01
hp_type = hp_fighter_shield_special_10, HpID02could be a conflict there also
No - these Hardpoints are not for shields, they are used for something else, maybe ID tokens or generators or other add-on equipment.
Capt.Morgan:
LODranges = 0, 9999, 9999, 9999, 9999
This is not correct, custom ships usually have only one mesh and distance texture, so this is saying the following:
“from distance 0 to 9999 use 1st mesh and 1st mesh texture (LOD0 and MIPMap0),
from 9999 to 9999 use 2nd mesh and 2nd texture (LOD1 and MIPMap1),
from 9999 to 9999 use 3rd mesh and 3rd texture (LOD2 and MIPMap2),
from 9999 to 9999 use 4th mesh and 4th texture (LOD3 and MIPMap3), and
from 9999 don’t display the model”!Meshes 2 to 4 don’t exist (ask the modeller if he made the extra LOD meshes and put them in the .cmp? I doubt it.)
The following is correct for single-mesh models:
LODranges = 0, 9999This means…
“from distance 0 display 1st mesh and 1st texture, and
from 9999 don’t display the model”.When anyone does make additional LOD meshes then I would expect the following:
LODranges = 0, 999, 1999, 9999
which means:
from distance 0 display 1st Mesh & 1st texture,
from distance 999 display 2nd Mesh & 2nd texture,
from distance 1999 display 3rd Mesh & 3rd texture,
from distance 9999 don’t display the modelAs a guide, so bigger ships still show at further distances:
make all your fighter models LODranges = 0, 1999
make all your gunship models LODranges = 0, 2999
make all your medium battleship models LODranges = 0, 9999
make all your huge ship models LODranges = 0, 19999If there are low-res meshes and textures (check with your modeller) then decide at which distance to switch the textures and meshes as above, and at what distance to stop displaying the ship model, and set the LODranges to those values.
-
Here’s the ship’s files, attached to this post. It’s a modified version of Kuze’s Serpent from his ship pack, and I’m thinking something went wrong when I modified and re-exported it.
-
Don’t worry about loadouts.ini, it’s not an npc ship problem, the loadout is already in goods.ini
OK - I opened the model OK in hardcmp and in Milkshape, I can’t see anything obvious but I will try a flight tomorrow unless someone can do it for you before me.
I am not sure the following is valid:
nanobot_limit = 0Make it temporarily:
nanobot_limit = 10
shield_battery_limit = 10And a bit more integer cleanup, remove the x.000000’s from these too:
fuse = intermed_damage_smallship01, 0.000000, 625
fuse = intermed_damage_smallship02, 0.000000, 312
fuse = intermed_damage_smallship03, 0.000000, 156It’s just cosmetic.
-
The nanobot limit of 0 is indeed valid. Broken Bonds is doing away with hull regens and making shield batteries regen your entire shield. But, you only get one or two. But, the point is, that setting is the same on all our ships, so it shouldn’t be the source of the crash either.
-
Erm, have you tried launching with a different ship to rule out system crashes? I don’t mean just launch once and say “yup, working” - launch about a dozen times.
After that, if you’re not sure whether it is your ship - copy and paste that shiparch.ini entry to the bottom of the file, and then use a stock FL ships cmp/mat reference. Obviously comment out the non existent hardpoints HpDI01 or whatever those are, and the counter measure 02.
You could also comment out these on your own entry too…no idea what your cmp file has. Dunno if bad references cause crashes shrugs
-
No that’s OK, several mods use other hardpoints including HpEnginexx like this for mounting addon equipment.
-
Capt. Morgan:
Your ship model is fine.
I replaced my starting ship with it (.cmp, .mat, .sur) and all is well.
So your problem is elsewhere.
Post up your loadouts.ini entry for the devil too.
-
Long shot… but check your shield
check everything its sold with actually… swap stuff out like power and engine’s. I’ve had this before but not for a long time last ship to do this to me was the FA37… i believe that was due to the shield link, it was about 2 years ago so my memory of exactly why has faded…
EDIT:
Woah…
make
addon = LargeWhiteSpecial, HpHeadlight01, 1
into
addon = LargeWhiteSpecial, HpHeadlight, 1
or check the CMP to make sure… most headlights don’t have the “01”
-
I’m surprised nobody has mentioned the icon. Looking at the code posted i see the ship uses a custom icon. If that’s not made properly there’s a ctd just waiting to happen. Agree totally with Startrader as well, follow his guidelines for tidying up your code, looks better, runs better, neater
I had a look at the model as well, nothing obvious with the model itself, seems fine actually.
-
I’ve assumed all along that the shield is class 2?
hp_type = hp_gun_special_1, HpWeapon01, HpWeapon02,
hp_type = hp_fighter_shield_special_2, HpShield01
hp_type = hp_fighter_shield_special_1, HpShield01That’s:
addon = shield01_mark02_lf, HpShield01, 1But I think it may be a loadout problem, waiting for him to post the loadouts.ini entry for it.
HpHeadLight01 is correct, it’s in the .cmp
Gibbon - Capt.Morgan says the ship appears in the dealer and he can buy it, so isn’t the icon ok (as long as the ship’s picture is correct)?
Can’t remember, can it cause a crash on launch if it’s ok in the dealer?
-
There is no loadouts.ini entry for this one. Loadouts.ini looks like it’s intended for NPC ships, which we haven’t included yet. So, there isn’t an entry there for any of our ships. The files it’s in are the ones linked on the first post. The loadout at purchase is in the goods.ini entry.
Also, I’m going to be away from home until probably Saturday evening, so I won’t actually be able to get anything else done with this until then.
-
I’m from the same team. Strange thing happened to me yesterday.
After a long time I started the mod and tried to repeat the crash. I don’t remember changing anything before, but this time one of the broken ships undocked without a crash.
That isn’t all, though. I noticed a crazy bug with it. My shield was up as I was being hit by a station. All effects showed a shield hit, but the shield level wouldn’t budge. Hull was getting damaged instead!
-
OK maybe it’s time to delete the Freelancer folder and saved games folders, and use a fresh copy of the mod.
I have had annoying things like this, and using a fresh copy fixed it.
Don’t use FLMM to de-activate, just delete the Freelancer folder to get rid of all corruption, and also re-install FLMM.
Use a fresh clean copy of FL and activate the mod into it.