Limiting player mountable equipment to specific ships.
-
Originally posted by Eagle on the Universal Modding Forums. Found here.
There’s several ways of preventing a range of weapons of getting mounted on ships which should not carry them, like not mounting train turrets on fighters etc. The way most mods deal with this is to abuse the 10 gun classes at our disposal and split those into groups. This obviously limits your options greatly and it will force you to give up the compatibility with vanilla freelancer. Ofcourse there have been attempts to get around this problem but these are all very limiting and most aren’t even compatible with the game engine, instead they exploit bugs which will get you in trouble when using a server tool such as FLAC which forces you to have sound mod code for things to work.
Fortunatelly there’s now a way to specify mount groups. You can assign ships and weapons to groups, which restricts mounting of such guns to those ships. You don’t have to muck about with gun classes anymore.
NOTE!
The features below require a licensed copy of FLAC to be running on the server for them to work!Mount group example
[Ship]
ids_name = 237039
ids_info1 = 460768
ids_info2 = 66608
ids_info3 = 460769
ids_info = 66579
nickname = no_fighter
LODranges = 0, 80, 120, 1000
type = FIGHTER
DA_archetype = ships\nomad\no_fighter\no_fighter.3db
material_library = ships\nomad\nomad_fx.txm
nomad = true
cockpit = cockpits\liberty\l_elite.ini
mass = 150.000000
hold_size = 70
linear_drag = 1.000000
explosion_arch = explosion_no_elite
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
steering_torque = 57000.000000, 57000.000000, 44000.000000
angular_drag = 41000.000000, 41000.000000, 30000.000000
rotation_inertia = 8400.000000, 8400.000000, 950.000000
nudge_force = 30000.000000
strafe_force = 7500
strafe_power_usage = 0
HP_tractor_source = HpMount
num_exhaust_nozzles = 1
hit_pts = 4000
camera_offset = 10, 25
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
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
nanobot_limit = 10
shield_battery_limit = 1
mission_property = can_use_berths
hp_type = hp_gun_special_10, HpWeapon01, HpWeapon02, HpWeapon03 –> plain class 10 weapon mounts
hp_type = hp_thruster, HpThruster01
hp_type = hp_torpedo_special_1, HpTorpedo01
hp_type = hp_torpedo_special_2, HpTorpedo01
hp_mount_group = nomad_fighter –> The group name used here can be freely chosen and must match that of the guns this ship can mount[Gun]
nickname = nomad_gun01_mark01
ids_name = 458765
ids_info = 264523
DA_archetype = Equipment\models\weapons\no_fighter_gun.cmp
HP_child = HPConnect
hit_pts = 100000
explosion_resistance = 1.000000
debris_type = debris_normal
parent_impulse = 20
child_impulse = 80
volume = 0.000000
mass = 10
damage_per_fire = 0
power_usage = 0
hp_gun_type = hp_gun_special_10 –> plain class 10 weapon
refire_delay = 0.120000
hp_mount_group = nomad_fighter –> The group name used here can be freely chosen and must match that of the ships this gun can be mounted on
muzzle_velocity = 750
toughness = 7.000000
flash_particle_name = no_gun01_rank01_flash
flash_radius = 15
light_anim = l_gun01_flash
projectile_archetype = nomad_gun01_mark01_ammo
separation_explosion = sever_debris
auto_turret = false
turn_rate = 90
lootable = false
LODranges = 0, 20Mount groups explained
As you can see above, the nomad fighter ship is modded to mount any class 10 weapon and the nomad laser is modded to match. Usually this would mean the nomad ship could mount any class 10 weapon, and the nomad laser would be mountable on any ship capable of carrying class 10 weapons. Not so with hp_mount_group specified as this will make it impossible for players to mount the laser above on for instance an eagle, which doesn’t have the same mount group specified. The mount group line isn’t mandatory, all ships and guns not specifying a group will simply be regarded as one big group which can’t mount anything from other groups and vice versa.Security
The mod changes above aren’t required on the client side, they are checked server side only and therefor can’t be circumvented by any means.Plans for the future
Right now FLAC is limited to using mount groups with Ship and Gun sections only, this will however be expanded to other sections such as thrusters and other equipment.