Login

russian armor

changing resources for new factions

24 Jun 2014, 20:18 PM
#1
avatar of centurionbc

Posts: 18

Sorry to create new post didn't know if i was supposed to or not, but Im trying to change the starting resources for the new factions, but I am not sure how to do so. I have been able to change the resources for the old factions but I crash every time I try to edit the new factions. Here is my code:






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, 20:52 PM
#2
avatar of RivetrPlate12

Posts: 4

There are still only two fraction that still does not work!
24 Jun 2014, 20:58 PM
#3
avatar of centurionbc

Posts: 18

I know, I myself am asking if anyone has found the way to change the resources for the new factions?
25 Jun 2014, 15:13 PM
#4
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

This thread has the new code, which works with Western Front factions. Use it instead.
1 user is browsing this thread: 1 guest

Livestreams

unknown 7
Russian Federation 6
unknown 4
United States 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

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