Login

russian armor

How to: Infantry Only Mode in a Custom Map

30 Jan 2014, 21:01 PM
#2
avatar of IronMedic

Posts: 318

stug_short_barrel aka Stug III E is still enabled.

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

Code

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
31 Jan 2014, 04:57 AM
#3
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

stug_short_barrel aka Stug III E is still enabled.

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

Code

SNIP



Clever use of the config I created to skip problematic ones! I guess you can find out by testing. For example you could use my CheatCommands Mod ULE for testing.

EDIT: Is stug_short_barrel called via commander ability? If so, which one?
31 Jan 2014, 09:24 AM
#4
avatar of IronMedic

Posts: 318



Clever use of the config I created to skip problematic ones! I guess you can find out by testing. For example you could use my CheatCommands Mod ULE for testing.

EDIT: Is stug_short_barrel called via commander ability? If so, which one?


The commander call-in for the stug_short_barrel does still work in both yours and mine code, and i also realised that you did forget "armor_commander" and tried to disable it in the same way you did for the other call-ins and i just like the stug_short_barrel does still work even though it's supposed to be disabled.
31 Jan 2014, 14:32 PM
#5
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Short barreled Stug is actually called via this ability: "stug_iii_e" (just add it to the _vehicleAbilities table)
Commander tank can be disabled by adding "armor_commander" to the _vehicleAbilities table.

Code in the tutorial will be updated in the near future, thanks to computerheat.

For the meanwhile, here is the updated table:
Code

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


Thank you for reporting the missing vehicles!
1 Feb 2014, 12:03 PM
#6
avatar of computerheat
Honorary Member Badge
Benefactor 117

Posts: 2838 | Subs: 3

Guide updated!
1 Feb 2014, 14:16 PM
#7
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Guide updated!


Thanks. Hopefully this update covers all the vehicles. If not, please keep reporting!
1 Feb 2014, 18:25 PM
#8
avatar of IronMedic

Posts: 318

just though of it, some of the commanders get left whit very little if you remove all doctrinal vehicles, like Mechanized Assault Doctrine only get assgrens and light artillery barrage, so would it not be possible to swap the "powers" for a more suitable power?
1 Feb 2014, 19:02 PM
#9
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

just though of it, some of the commanders get left whit very little if you remove all doctrinal vehicles, like Mechanized Assault Doctrine only get assgrens and light artillery barrage, so would it not be possible to swap the "powers" for a more suitable power?


I think people would choose to use infantry related commanders anyway.
1 Feb 2014, 19:16 PM
#10
avatar of IronMedic

Posts: 318



I think people would choose to use infantry related commanders anyway.

true, but do you know if its possible whit scarr/lua?
1 Feb 2014, 21:06 PM
#11
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11


true, but do you know if its possible whit scarr/lua?


I've been able to add commander abilities to the player so yeah, I think adding some base abilities could be possible.
14 Apr 2014, 21:12 PM
#12
avatar of Blue

Posts: 3

Where can i find all Units?
i want to restrict mortar.

And the SIS Pak from the Soviet is not restrictet.
15 Apr 2014, 06:30 AM
#13
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

All units can be found from luaconstsauto.scar which is located in AttribArchive.sga/attrib/scar
15 Apr 2014, 11:40 AM
#14
avatar of Blue

Posts: 3

ok. i found it.
but im a beginner an not so good in english.
wich one is the soviet 76mm at sis,
wich the soviet and german mortar?
17 Apr 2014, 17:00 PM
#15
avatar of Blue

Posts: 3

nobody any idea?
17 Apr 2014, 18:53 PM
#16
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

You can find the Zis from the list by searching for "zis". (Control + F to search)

for squads, it should be something like this:
SBP.SOVIET.*_SQUAD_MP
where * is the base name of the squad
20 Apr 2014, 15:47 PM
#17
avatar of D3MAR

Posts: 9

what should I write if I want to disable all mortar .........?

please help thank you
20 Apr 2014, 15:55 PM
#18
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Looks like I will have to write a tutorial about blocking units as that's what most people are after.
20 Apr 2014, 16:02 PM
#19
avatar of D3MAR

Posts: 9

oh yes please .......................
or did you got some tips................
27 Jun 2014, 13:21 PM
#20
avatar of Wolfie88

Posts: 7

Hi guys. I had a few infantry only maps out that used this code

http://steamcommunity.com/sharedfiles/filedetails/?id=269056837
http://steamcommunity.com/sharedfiles/filedetails/?id=264849628

and it worked fine.
Since Relic released the Western Front expansion however, these infantry only maps started to crash. As I am not a coder I don't know how to fix this. Any help is welcome.

PS: Due to the changes in world builder I had a lot of maps to fix. So I started to fix the ones that I could fix first. If these inf only maps can't be fixed I have to delete them.
3 Sep 2014, 14:38 PM
#21
avatar of optical21

Posts: 95

Hello, i have tried the code but when i start the match the match is just frozen, the game works but the match is frozen, and it doesnt work
1 user is browsing this thread: 1 guest