Login

russian armor

How-to: Custom Starting Resources & Income rate

26 Jul 2014, 09:21 AM
#21
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Included population cap override per request in the code. See
Code
--Population cap override value
g_popCapOverride = 200
to change it. By default it's set to 200.
27 Jul 2014, 00:25 AM
#22
avatar of CaribbeanCLANK

Posts: 2

It would help if you could explain a bit more briefly what you have tried and what kind of problems you have encountered.


After a full day of trying different things I finally figured out what I was doing wrong. I just did a test run of the map and it worked.
3 Aug 2014, 18:22 PM
#23
avatar of Tyknapp

Posts: 16

I am trying to do this whole code, but where do I put it on the .scar file? If you showed it on the main tutorial I am sorry for the troubles, I must of missed it.
3 Aug 2014, 18:32 PM
#24
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

which contains a pre-made scar file with the following code. Extract it and move the .scar file to your map's folder and rename the .scar file to match your .sbg file name!
4 Aug 2014, 03:03 AM
#25
avatar of Tyknapp

Posts: 16

Thanks, I have another question, but this is a half on topic half not. In the world builder there is a territory point marked manpower capture point, can I use this to boost manpower supply in high population maps?
4 Aug 2014, 06:21 AM
#26
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

First post has instructions for resource income modifiers. You should try that point yourself. It's most likely a leftover from COH1 so it might not work.
4 Aug 2014, 16:32 PM
#27
avatar of Tyknapp

Posts: 16

Ok, thanks, I suppose I will post whether it works or not in this reply using the wonderful powers of the Edit button.
17 Aug 2014, 18:21 PM
#28
avatar of Der Loler

Posts: 1

Is there any option to set this values on teams only ?
So team 1 get more resource income as Team 2 ?
For amazing Compstomp. The AI need more Resource income.....

Edit: Or a option to set different Popcaps per Team ?
2 Sep 2014, 00:23 AM
#29
avatar of Tyknapp

Posts: 16

Apparently that new point I found was a permanent point, meaning you could capture it, then its yours forever, no one else can capture it, and its a downgraded version of a regular capture point too!
2 Sep 2015, 11:21 AM
#30
avatar of whodareswins

Posts: 67

Hi
Is this just for starting resources at the beginning or is for throughout the game as well as I'm fed up with too much fuel and ammo but no manpower many thanks.
3 Sep 2015, 04:27 AM
#31
avatar of MadMartigan

Posts: 5

My maps are unplayable now (get a fatal scar execution) with the release of the british forces. How can i mod my maps so that the british are included in the resource rate changes? Please help and thank you for amazing guides!
5 Sep 2015, 13:00 PM
#32
avatar of whodareswins

Posts: 67

Hi
Could you please do another script but adding the English into it please.
many thanx for your patience.
5 Sep 2015, 13:49 PM
#33
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

My maps are unplayable now (get a fatal scar execution) with the release of the british forces. How can i mod my maps so that the british are included in the resource rate changes? Please help and thank you for amazing guides!

Hi
Could you please do another script but adding the English into it please.
many thanx for your patience.


Replace function Player_GetRaceIndex with this:

function Player_GetRaceIndex(player)
local racename = Player_GetRaceName(player)
if racename == "german" then
return 0
elseif racename == "soviet" then
return 1
elseif racename == "west_german" then
return 2
elseif racename == "aef" then
return 3
elseif racename == "british" then
return 4
else
return 0
end
end


And add this to each configuration below "--us forces:"

--british forces:
[4] = {
manpower = 400,
fuel = 15,
munition = 0,
action = 0,
command = 1,
},

Don't forget to set your values for the British Forces!
7 Sep 2015, 13:14 PM
#34
avatar of whodareswins

Posts: 67

thanx you're a star.
7 Sep 2015, 16:09 PM
#35
avatar of whodareswins

Posts: 67

also do you know how I can change the camera so that I can scroll out further whilst I'm playing as I have looked on my map settings in world builder but nothing works please help.
many thanks.
31 Oct 2015, 11:52 AM
#36
avatar of MadMartigan

Posts: 5

thanks jane! srry for late gratitude, you're the man!
16 Mar 2016, 19:37 PM
#37
avatar of MrEasyUK

Posts: 34

Could I trouble to ask about the new Brit faction. could you update your tool to include brits or please, provide an entire script or could I boldly ask that you have a look at the below and see if I have it right.

function CustomStartingResources_Init()
--[[
CustomStartingResource System created by Janne252. Visit COH2.ORG for more. Please do not remove this note.

Some information about income_modifier table and how to use it:
- All resource income modifiers affect the # per minute value.
- By default all resource income modifiers are set to 1 (value = 1, math_type = MUT_Multiplication). As you know, anything * 1 is the same value.
- MUT_Multiplication multiplies the income rate and MUT_Addition adds to it. Here are some examples of that:
- Let's say manpower income is 294 manpower per minute. With value = 10, math_type = MUT_Multiplication we will get 2940 manpower per minute,
since 294 * 10 = 2940.
Let's say manpower income is still 294 manpower per minute. With value = 10, math_type = MUT_Addition, we will get 304 manpower per minute,
since 294 + 10 = 304.

- How to add 50 extra munition income?
{type = RT_Munition, value = 50, math_type = MUT_Addition}

- How to remove 100 from manpower income?
{type = RT_Manpower, value = -100, math_type = MUT_Addition}

- How to double manpower income?
{type = RT_Manpower, value = 2, math_type = MUT_Multiplication}
]]

local ResourceSets = {
standard = {
--german:
[0] = {
manpower = 490,
fuel = 20,
munition = 0,
action = 0,
command = 1,
},
--soviet:
[1] = {
manpower = 490,
fuel = 50,
munition = 0,
action = 0,
command = 1,

},
--Obercommando west:
[2] = {
manpower = 490,
fuel = 50,
munition = 0,
action = 0,
command = 1,
},
--us forces:
[3] = {
manpower = 490,
fuel = 50,
munition = 0,
action = 0,
command = 1,
},

--british forces:
[4] = {
manpower = 4490,
fuel = 50,
munition = 0,
action = 0,
command = 1,
},

income_modifier = {
{type = RT_Manpower, value = 1, math_type = MUT_Multiplication}, -- manpower. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Munition, value = 1, math_type = MUT_Multiplication}, -- munition. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Fuel, value = 1, math_type = MUT_Multiplication}, -- fuel. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Action, value = 1, math_type = MUT_Multiplication}, -- action/xp. math_type = MUT_Multiplication OR MUT_Addition
},
},
highResources = {
--german:
[0] = {
manpower = 1390,
fuel = 50,
munition = 50,
action = 0,
command = 2,
},
--soviet:
[1] = {
manpower = 1390,
fuel = 80,
munition = 50,
action = 0,
command = 2,
},
--Obercommando west:
[2] = {
manpower = 1390,
fuel = 80,
munition = 50,
action = 0,
command = 2,
},
--us forces:
[3] = {
manpower = 1390,
fuel = 80,
munition = 50,
action = 0,
command = 2,
},
income_modifier = {
{type = RT_Manpower, value = 1, math_type = MUT_Multiplication}, -- manpower. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Munition, value = 1, math_type = MUT_Multiplication}, -- munition. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Fuel, value = 1, math_type = MUT_Multiplication}, -- fuel. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Action, value = 1, math_type = MUT_Multiplication}, -- action/xp. math_type = MUT_Multiplication OR MUT_Addition
},
},
customSet_01 = {
--german:
[0] = {
manpower = 2000,
fuel = 80,
munition = 100,
action = 0,
command = 2,
},
--soviet:
[1] = {
manpower = 2000,
fuel = 100,
munition = 100,
action = 0,
command = 2,
},
--Obercommando west:
[2] = {
manpower = 2000,
fuel = 80,
munition = 100,
action = 0,
command = 2,
},
--us forces:
[3] = {
manpower = 2000,
fuel = 80,
munition = 100,
action = 0,
command = 2,
},


--british forces:
[4] = {
manpower = 2000,
fuel = 80,
munition = 100,
action = 0,
command = 2,
},
income_modifier = {
{type = RT_Manpower, value = 1, math_type = MUT_Multiplication}, -- manpower. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Munition, value = 1, math_type = MUT_Multiplication}, -- munition. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Fuel, value = 1, math_type = MUT_Multiplication}, -- fuel. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Action, value = 1, math_type = MUT_Multiplication}, -- action/xp. math_type = MUT_Multiplication OR MUT_Addition
},
},
customSet_02 = {
--german:
[0] = {
manpower = 0,
fuel = 0,
munition = 0,
action = 0,
command = 0,
},
--soviet:
[1] = {
manpower = 0,
fuel = 0,
munition = 0,
action = 0,
command = 0,
},
--Obercommando west:
[2] = {
manpower = 0,
fuel = 0,
munition = 0,
action = 0,
command = 0,
},
--us forces:
[3] = {
manpower = 0,
fuel = 0,
munition = 0,
action = 0,
command = 0,
},

--british forces:
[4] = {
manpower = 0,
fuel = 0,
munition = 0,
action = 0,
command = 0,
},

income_modifier = {
{type = RT_Manpower, value = 1, math_type = MUT_Multiplication}, -- manpower. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Munition, value = 1, math_type = MUT_Multiplication}, -- munition. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Fuel, value = 1, math_type = MUT_Multiplication}, -- fuel. math_type = MUT_Multiplication OR MUT_Addition
{type = RT_Action, value = 1, math_type = MUT_Multiplication}, -- action/xp. math_type = MUT_Multiplication OR MUT_Addition
},
},
}
--This will set the resource set to use in-game
local g_ResourceSet = ResourceSets.customSet_02

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
--Population cap override value
g_popCapOverride = 250

for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
local resource_set = g_ResourceSet[Player_GetRaceIndex(player)]
Player_ApplyResourceSet(player, resource_set)
Player_SetPopCapOverride(player, g_popCapOverride)
for key, resource in ipairs(g_ResourceSet.income_modifier) do
local _value = resource.value
if resource.math_type == MUT_Addition then
_value = _value / (60 * 8)
end
Modify_PlayerResourceRate(player, resource.type, _value, resource.math_type)
end
end
end

function Player_GetRaceIndex(player)
local racename = Player_GetRaceName(player)
if racename == "german" then
return 0
elseif racename == "soviet" then
return 1
elseif racename == "west_german" then
return 2
elseif racename == "aef" then
return 3
elseif racename == "british" then
return 4
else
return 0
end
end

end

Scar_AddInit(CustomStartingResources_Init)
please.
10 Jul 2020, 20:36 PM
#38
avatar of Slavik

Posts: 16

Not seem to be working on 2020 :(
1 user is browsing this thread: 1 guest

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

737 users are online: 737 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