Login

russian armor

Pop Cap change does NOT work on WFA?

24 Jun 2014, 17:01 PM
#1
avatar of centurionbc

Posts: 18

Hello,
I am new here but I noticed that with the new WFA you cannot change the pop cap for maps like you could before. Is there something I am not doing correctly? Is there a new way to do it?
24 Jun 2014, 17:03 PM
#2
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Post your code, please.
24 Jun 2014, 17:11 PM
#3
avatar of centurionbc

Posts: 18

Code
function OnInitID()
--Population cap override value
g_popCapOverRide = 500

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

local ResourceSets = {
standard = {
--soviet:
[0] = {
manpower = 490,
fuel = 50,
munition = 0,
action = 0,
command = 0,
},
--german:
[1] = {
manpower = 490,
fuel = 20,
munition = 0,
action = 0,
command = 0,
},
},
highResources = {
--soviet:
[0] = {
manpower = 1390,
fuel = 80,
munition = 50,
action = 0,
command = 1,
},
--german:
[1] = {
manpower = 1390,
fuel = 50,
munition = 50,
action = 0,
command = 1,
},
},
customSet_01 = {
--soviet:
[0] = {
manpower = 4000,
fuel = 400,
munition = 400,
action = 0,
command = 2,
},
--german:
[1] = {
manpower = 4000,
fuel = 40,
munition = 400,
action = 0,
command = 2,
},
},
customSet_02 = {
--soviet:
[0] = {
manpower = 0,
fuel = 0,
munition = 0,
action = 0,
command = 0,
},
--german:
[1] = {
manpower = 0,
fuel = 0,
munition = 0,
action = 0,
command = 0,
},
},
}
--This will set the resource set to use in-game
local g_ResourceSet = ResourceSets.customSet_01

local Player_ApplyResourceSet = function(player, resourceSet)
Player_SetResource(player, RT_Manpower, resourceSet.manpower)
Player_SetResource(player, RT_Fuel, resourceSet.fuel)
Player_SetResource(player, RT_Munition, resourceSet.munition)
Player_SetResource(player, RT_Action, resourceSet.action)
Player_SetResource(player, RT_Command, resourceSet.command)
end

for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_ApplyResourceSet(player, g_ResourceSet[Player_GetRace(player)])
end
-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

end
24 Jun 2014, 19:34 PM
#4
avatar of centurionbc

Posts: 18

So I managed to get the Pop cap change to work, however I cannot seem to get the change in resources working for the maps. I know how to change the german and soviets, however the new factions remain unsolved. any ideas?
24 Jun 2014, 21:09 PM
#5
avatar of centurionbc

Posts: 18

I take that back, apparently it worked on one maps but the rest just crash. here is the code I am using:


Code
function OnInitID()
--Population cap override value
g_popCapOverRide = 500

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

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

end





What am I doing wrong in this text that is making the game crash. I am trying to play these maps with the new US Forces and Oberkommando west. Is there a solution?




24 Jun 2014, 21:47 PM
#6
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

I've updated the guide with support for Western Front Armies.
http://www.coh2.org/topic/12433/how-to-custom-starting-resources
24 Jun 2014, 23:38 PM
#7
avatar of centurionbc

Posts: 18

Well I got the pop cap working seperately and the resources working seperately. But when i try to put them both together it crashes. Any ideas?
25 Jun 2014, 15:09 PM
#8
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Post your full code please. And use
Code
[code]Your code goes here..[/code]
tags.


I take that back, apparently it worked on one maps but the rest just crash. here is the code I am using:


Code
function OnInitID()
--Population cap override value
g_popCapOverRide = 500

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

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

end





What am I doing wrong in this text that is making the game crash. I am trying to play these maps with the new US Forces and Oberkommando west. Is there a solution?





Check your code syntax.
1 user is browsing this thread: 1 guest

Livestreams

Germany 272
Russian Federation 7
unknown 1

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

880 users are online: 880 guests
0 post in the last 24h
8 posts in the last week
34 posts in the last month
Registered members: 49110
Welcome our newest member, jhonnycena0400
Most online: 2043 users on 29 Oct 2023, 01:04 AM