Company of Heroes 2

Company of Heroes 2

8p Sniper vs Sniper (aka 8p Kaiserslautern Large)
DeadKennys  [developer] 3 May, 2014 @ 9:38am
SCAR File
Posting SCAR scripts for reference
< >
Showing 1-1 of 1 comments
DeadKennys  [developer] 26 Apr, 2016 @ 10:10pm 
function OnInitID()
--Population cap override value, high pop cap...but only snipers and engineers!
g_popCapOverRide = 300

for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_SetPopCapOverride(player, g_popCapOverRide)
end

function OnInitPower()
--Increase BASE powers for all players --rem snipe/engineers only is goal
for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_SetResource(player, RT_Manpower, 1000)
Player_SetResource(player, RT_Munition, 1000)
Player_SetResource(player, RT_Fuel, 1000)
Player_SetResource(player, RT_Action, 10)

end
end

Scar_AddInit(OnInitPower)

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

--Make buildings where I placed ambient fires in roofs and upper floors indestructable
eg_NoMagicFires = EGroup_CreateIfNotFound("eg_NoMagicFires")
EGroup_ForEach(eg_NoMagicFires,
function(egid, idx, entity)
EGroup_SetInvulnerable(eg_NoMagicFires, true)
end)

--try to set forest fire
eg_forest_fire_01 = EGroup_CreateIfNotFound("eg_forest_fire_01")
EGroup_ForEach(eg_forest_fire_01,
function(egid, idx, entity)
Entity_SetOnFire(entity)
end)

--Remove Abilities
local _Abilities = {
"breakthrough_operation", "mechanized_grenadier_group", "supply_truck", "tiger_tank", "mortar_halftrack", "elefant_unlock", "tiger_tank_ace", "stug_iii_e", "armor_commander",
"mechanized_assault_group", "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", "cmd_guard_troops", "cmd_120mm_mortar_crew", "cmd_katyusha", "cmd_ml_20", "cmd_penal_battalion", "cmd_shock_troops", "m-42_at_gun", "b4_203mm_howitzer",
"partisan_dispatch", "partisan_dispatch_tow", "m11_partisans_dispatch_kark98k", "m11_partisans_dispatch_nagant", "dshk_mp", "howitzer_105mm_emplacement_unlock",
"jaeger_infantry_unlock", "assault_grenadiers", "stormtroopers", "urban_assault_grenadiers", "relief_infantry", "pak_43_emplacement_unlock", "panzer_tactician_unlock",
"partisan_dispatch_tow", "assault_field_officer", "ostruppen", "sherman_soviet_dispatch", "m5_halftrack_assault", "ostruppen_reserves", "puma_dispatch", "command_vehicle",
"crew_repair_operation", "reinforced_structures", "churchill_avre", "observation_valentine", "sexton_dispatch_british", "stand_fast", "priest_dispatch",
"sherman_bulldozer_dispatch", "sherman_calliope_dispatch", "sherman_easy8_dispatch", "m10_deploy", "greyhound_recon_dispatch", "dodge_wc51_dispatch",
"m21_mortar_halftrack_dispatch", "m3_halftrack_group", "m5_quad_halftrack_dispatch", "m26_pershing_dispatch", "priest_dispatch", "elite_vehicle_crews",
"tank_commander_unlock", "flame_haltrack_dispatch", "urban_assault_light_infantry", "command_panther", "command_royal_tiger_dispatch", "fallschirmjaeger",
"goliath_dispatch", "hetzer_dispatch", "jaeger_light_infantry_recon_dispatch", "jagdtiger", "king_tiger_dispatch", "mg34_dispatch", "mortar_halftrack_west_german",
"ostwind_dispatch", "panzerfusiliers_dispatch", "panzer_iv_group_dispatch", "sturmtiger_dispatch", "terror_officer", "partisans_commander_anti_infantry",
"partisans_commander_anti_vehicle",
}

--Remove Entities
local _Entities = {
"artillery_203mm_b4", "m1931_203mm_b-4_howitzer_artillery_commander_mp", "m1931_203mm_b-4_howitzer_artillery_mp", "m1937_152mm_ml_20_artillery", "m1937_152mm_ml_20_artillery_mp",
"howitzer_105mm_le_fh18", "howitzer_105mm_le_fh18_mp", "howitzer_105mm_dummy", "sherman_soviet", "m5_halftrack_mp", "m5_halftrack_assault_mp", "m5_halftrack",
"puma_east_german", "brit_3_inch_mortar_emplacement", "brit_bofors_40mm_autocannon_mp", "brit_17_pounder_pit_mp", "churchill_crocodile_mp", "churchill_default_mp",
}

--skip keepers
local SBP_Keepers = function(sbp)
--skip squads I wanna keep
local _skip_keepers =
{
[1] = {
name = "sniper",
isSkip = true
},
[2] = {
name = "engineer",
isSkip = true
},
[3] = {
name = "pioneer",
isSkip = true
},
[4] = {
name = "rear_echelon",
isSkip= true
},
[5] = {
name = "sapper",
isSkip = true
},
[6] = {
name = "sws_halftrack",
isSkip = true
},
}

local isSkip = false
local skipKeep = false

for key, _sbp in ipairs(_skip_keepers) do
if string.find(BP_GetName(sbp), _sbp.name) then
isSkip = true
skipKeep = true
end
end
if not skipKeep then
isSkip = false
skipKeep = false
end
return isSkip
end

--Remove building Powers
for key, race in pairs(SBP) do
for key, sbp in pairs(race) do
for i = 1, World_GetPlayerCount() do
Player_SetSquadProductionAvailability(World_GetPlayerAt(i), sbp, ITEM_REMOVED)
end
end
end

--adds back in my keepers
for key, race in pairs(SBP) do
for key, sbp in pairs(race) do
if SBP_Keepers(sbp) then
for i = 1, World_GetPlayerCount() do
Player_SetSquadProductionAvailability(World_GetPlayerAt(i), sbp, ITEM_UNLOCKED)
end
end
end
end

--Remove commander powers
for key, abp in ipairs(_Abilities) do
for i = 1, World_GetPlayerCount() do
Player_SetAbilityAvailability(World_GetPlayerAt(i), BP_GetAbilityBlueprint(abp), ITEM_REMOVED)
end
end

--Remove Entity Upgrades
for key, ebp in ipairs(_Entities) do
for i=1, World_GetPlayerCount() do
Player_SetEntityProductionAvailability(World_GetPlayerAt(i), BP_GetEntityBlueprint(ebp), ITEM_REMOVED)
end
end

end

< >
Showing 1-1 of 1 comments
Per page: 1530 50