Company of Heroes 2

Company of Heroes 2

8p Blood Red River Superflood
DeadKennys  [developer] 22 Apr, 2014 @ 8:45pm
SCAR File
posting SCAR scripts for reference
< >
Showing 1-3 of 3 comments
DeadKennys  [developer] 22 Apr, 2014 @ 8:45pm 
CURRENT SCAR 4-27-2014 827P

function OnInitID()

--Population cap override value
g_popCapOverRide = 160

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

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

local _vehicleAbilities = {
"mechanized_grenadier_group", "supply_truck", "tiger_tank", "mortar_halftrack", "elefant_unlock", "tiger_tank_ace", "stug_short_barrel", "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", "sherman_soviet_dispatch", "m5_halftrack_assault", "puma_dispatch",
}

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,
},
}
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

--skip keepers
local SBP_Keepers = function(sbp)
--skip squads I wanna keep
local _skip_keepers =
{
[1] = {
name = "panzerwerfer",
isSkip = true
},
[2] = {
name = "katyusha",
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

--gets rid of all rigs in buildings
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

--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

--gets rid of commander powers
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
Last edited by DeadKennys; 27 Apr, 2014 @ 8:43pm
DeadKennys  [developer] 27 Apr, 2014 @ 8:41pm 
DeadKennys [developer] Apr 22 @ 8:45pm

SCAR from Apr 22 @ 8:45pm to Apr 27 @ 8:27pm

function OnInitID()

--Population cap override value
g_popCapOverRide = 160

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

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

local _vehicleAbilities = {
"mechanized_grenadier_group", "supply_truck", "tiger_tank", "mortar_halftrack", "elefant_unlock", "tiger_tank_ace", "stug_short_barrel", "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",
}

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,
},
}
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

--skip keepers
local SBP_Keepers = function(sbp)
--skip squads I wanna keep
local _skip_keepers =
{
[1] = {
name = "panzerwerfer",
isSkip = true
},
[2] = {
name = "katyusha",
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

--gets rid of all rigs in buildings
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

--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

--gets rid of commander powers
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
Last edited by DeadKennys; 27 Apr, 2014 @ 8:45pm
DeadKennys  [developer] 25 Jan, 2015 @ 5:25pm 
SCAR as of 25 JAn 2015 @ 5:24P Pacific

function OnInitID()

--Population cap override value
g_popCapOverRide = 160

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

--~ function OnInit()
--~ --Code to allow player full powers for testing
--~ for i = 7, 7 do
--~ local player = World_GetPlayerAt(i)
--~ Player_SetResource(player, RT_Manpower, 90000)
--~ Player_SetResource(player, RT_Munition, 9000)
--~ Player_SetResource(player, RT_Fuel, 9000)
--~ Player_SetResource(player, RT_Action, 200000)

--~ end
--~ end

--~ Scar_AddInit(OnInit)

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

local _vehicleAbilities = {
"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",
}

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,
},
}
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

--skip keepers
local SBP_Keepers = function(sbp)
--skip squads I wanna keep
local _skip_keepers =
{
[1] = {
name = "panzerwerfer",
isSkip = true
},
[2] = {
name = "katyusha",
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

--gets rid of all rigs in buildings
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

--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

--gets rid of commander powers
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
< >
Showing 1-3 of 3 comments
Per page: 1530 50