ps. I've tried to make a "Mechanized infantry warfare mode"(Infantry, light vehicles and rocket artillery) using this mode as a template, but I have very little experience whit scar, so I don't know if I've done it right ^^
function OnInitID()
--Population cap override value
g_popCapOverRide = 115
for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_SetPopCapOverride(player, g_popCapOverRide)
end
-- [[ Markers ]]
-- [[ Squad Groups ]]
-- [[ Entity Groups ]]
local _vehicleAbilities = {
"tiger_tank","elefant_unlock","tiger_tank_ace","stug_short_barrel","cmd_kv-8_unlock_mp","cmd_advanced_t34_85_medium_tank","cmd_t34_85_medium_tank","cmd_isu-152","cmd_is2_heavy_tank","cmd_kv-1_unlock","kv-2",
}
local SBP_IsVehicle = function(sbp)
--Skip problematic squads (pak creates splats, panzer_iii causes an error due to not existing yet)
local _skip_sbp = {
[1] = {
name = "pak43",
isVehcle = false,
},
[2] = {
name = "panzer_iii",
isVehcle = true,
},
[3] = {
name = "sdkfz_251_halftrack_squad_mp",
isVehcle = false,
},
[4] = {
name = "m3a1_scout_car_squad_mp",
isVehcle = false,
},
[5] = {
name = "scoutcar_sdkfz222_mp",
isVehcle = false,
},
[6] = {
name = "panzerwerfer_squad_mp",
isVehcle = false,
},
[7] = {
name = "stug_short_barrel",
isVehcle = true,
},
[8] = {
name = "m5_halftrack_squad_mp",
isVehcle = false,
},
[9] = {
name = "70m_mp",
isVehcle = false,
},
[10] = {
name = "katyusha_bm-13n_squad_mp",
isVehcle = false,
},
[11] = {
name = "zis_6_transport_truck_mp",
isVehcle = false,
},
[12] = {
name = "us6_truck_squad",
isVehcle = false,
},
}
local isVehcle = false
local pos = World_Pos(-512, -512, -512)
local skipSBP = false
for key, _sbp in ipairs(_skip_sbp) do
if string.find(BP_GetName(sbp), _sbp.name) then
isVehcle = _sbp.isVehcle
skipSBP = true
end
end
if not skipSBP then
local squad = Squad_CreateAndSpawnToward(sbp, World_GetPlayerAt(1), 1, pos, pos)
local entity = Squad_EntityAt(squad, 0)
if Entity_IsOfType(entity, "vehicle") and not Entity_IsOfType(entity, "team_weapon") then
isVehcle = true
else
isVehcle = false
end
Squad_Destroy(squad)
end
return isVehcle
end
for key, race in pairs(SBP) do
for key, sbp in pairs(race) do
if SBP_IsVehicle(sbp) then
for i = 1, World_GetPlayerCount() do
Player_SetSquadProductionAvailability(World_GetPlayerAt(i), sbp, ITEM_REMOVED)
end
end
end
end
for key, abp in ipairs(_vehicleAbilities) do
for i = 1, World_GetPlayerCount() do
Player_SetAbilityAvailability(World_GetPlayerAt(i), BP_GetAbilityBlueprint(abp), ITEM_REMOVED)
end
end
end