As the BT Mod is on hold I though I'd post how to create a squad that can produce CC units that go into CC and Ranged units that stay back and shoot, I had one person PM me once how I did it so I though I'd write it down for people. You will need to ahve some LUA coding experience, at least knowing how to create entities and squads

Overview:

Basicly this is a squad that uses the leader code to have a unit which multiple unit types as many mods do, this means the squad must have a leader.

Implementation:

1) First create the ebps files of the basic entities in the squad and one for a sergeant or start trooper, you can have up to 4 basic entities. Now for the ranged troopers remove at instances of 'melee_ext' this removes the ranged troopers option to go into melee, usually units have to have this otherwise the game crashes however when a unit counts as a leader this doesn't seem to be the case and you get away with it. The finished files shoudl look a bit like this:
Code:
----------------------------------------
-- File: 'ebps\races\black_templars\troops\black_templars_init_lr.lua'
-- Created by: AttributeEditor v2.0
-- Note: Do NOT edit by hand!
-- (c) 2001 Relic Entertainment Inc.

GameData = Inherit([[ebps\races\black_templars\troops\black_templars_soldier.nil]])
MetaData = InheritMeta([[ebps\races\black_templars\troops\black_templars_soldier.nil]])

GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["weapon_table"]["weapon_01"]["name_for_this_weapon_choice"] = "space_marines_bolter"
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["weapon_table"]["weapon_01"]["weapon"] = "weapon\\black_templars_bolter_tactical.lua"
GameData["combat_ext"]["hardpoints"]["hardpoint_02"]["weapon_table"]["weapon_01"]["name_for_this_weapon_choice"] = "Space_Marines_Knife"
GameData["combat_ext"]["hardpoints"]["hardpoint_02"]["weapon_table"]["weapon_01"]["weapon"] = "weapon\\black_templars_knife_tactical.lua"
GameData["cost_ext"]["time_cost"]["cost"]["requisition"] = 45.00000
GameData["cost_ext"]["time_cost"]["time_seconds"] = 6.50000
GameData["entity_blueprint_ext"]["animator"] = "Races/Space_Marines/Troops/Space_Marine"
GameData["health_ext"]["hitpoints"] = 350.00000
GameData["type_ext"]["type_armour"] = Reference([[type_armour\tp_infantry_heavy_med.lua]])
GameData["ui_ext"]["ui_info"]["help_text_id"] = "$15014001"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_01"] = "$15014002"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_02"] = "$15014003"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_03"] = "$15014004"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_04"] = "$15014005"
GameData["ui_ext"]["ui_info"]["icon_name"] = "black_templars_icons/initiate_ranged"
GameData["ui_ext"]["ui_info"]["screen_name_id"] = "$15014001"
Instead of the CC Tropper that should look like this, with the 'melee_ext' included:
Code:
-- Note: Do NOT edit by hand!
-- (c) 2001 Relic Entertainment Inc.

GameData = Inherit([[ebps\races\black_templars\troops\black_templars_soldier.nil]])
MetaData = InheritMeta([[ebps\races\black_templars\troops\black_templars_soldier.nil]])

GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["weapon_table"]["weapon_01"]["name_for_this_weapon_choice"] = "Space_Marines_Bolt_Pistol"
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["weapon_table"]["weapon_01"]["weapon"] = "weapon\\black_templars_bolt_pistol_assault.lua"
GameData["combat_ext"]["hardpoints"]["hardpoint_02"]["weapon_table"]["weapon_01"]["name_for_this_weapon_choice"] = "Space_Marines_chainsword"
GameData["combat_ext"]["hardpoints"]["hardpoint_02"]["weapon_table"]["weapon_01"]["weapon"] = "weapon\\black_templars_chainsword_assault.lua"
GameData["cost_ext"]["time_cost"]["cost"]["requisition"] = 45.00000
GameData["cost_ext"]["time_cost"]["time_seconds"] = 6.50000
GameData["entity_blueprint_ext"]["animator"] = "Races/Black_Templars/Troops/CC_Initiate"
GameData["health_ext"]["hitpoints"] = 350.00000
GameData["melee_ext"] = Reference([[ebpextensions\melee_ext.lua]])
GameData["melee_ext"]["in_melee_modifiers"]["modifier_04"] = Reference([[modifiers\enable_squad_morale_damage.lua]])
GameData["melee_ext"]["in_melee_modifiers"]["modifier_04"]["value"] = -1.00000
GameData["type_ext"]["type_armour"] = Reference([[type_armour\tp_infantry_heavy_med.lua]])
GameData["ui_ext"]["ui_info"]["help_text_id"] = "$15014006"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_01"] = "$15014007"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_02"] = "$15014008"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_03"] = "$15014009"
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_04"] = "$15014010"
GameData["ui_ext"]["ui_info"]["icon_name"] = "black_templars_icons/initiate_cc"
GameData["ui_ext"]["ui_info"]["screen_name_id"] = "$15014006"
2) Now create the sbps file for the squad, set the basic troopers as leaders in the 'squad_leaders_ext' and set the max leaders to be the max amount of troopers you want in the squad. Set the sergeant as starting unit in the 'squad_loadout_ext' and set the unit min and maxs to be 1.

Now make sure this is set to true:
Code:
GameData["squad_melee_stance_ext"]["default_to_melee"] = true
3) Continue to code the unit however you want, set a building for it to be available from and voila. The are some ingame rules, always keep the squad in melee stance, the ranged units will ignore this as they can't go into melee, thus you have a squad with mixed stances.

Finished Product