Login

russian armor

Fatal Scar Error

24 Jul 2014, 06:55 AM
#1
avatar of centurionbc

Posts: 18

I started to play COH 2 WFA with some new generals i just bought, and now the game says Fatal Scar error every time I try to play a modded map. I only modded the pop cap and the starting resource amount. What has changed?
24 Jul 2014, 17:13 PM
#2
avatar of Srinidhalaya

Posts: 357

I want to say the custom resource code was changed after WFA. If you haven't updated the code since the release, you should revisit the tutorial and re do it.

http://www.coh2.org/topic/12433/how-to-custom-starting-resources-%26-income-rate

I'm not sure if it is the cause or not. A good place to start on identifying the cause, is to remove each section one at a time, save, export, test. Try it with just the pop cap, then try it with just the Resource mod. It should point you in the right direction.
24 Jul 2014, 17:15 PM
#3
avatar of centurionbc

Posts: 18

Yeah the Pop cap change seems to work just fine, its the resource code that is messed up. I did just try the new code to no avail. Im not sure what is causing it, ive sliced the code to try what you were saying before and still no luck. anyone else having the same issue?
24 Jul 2014, 17:18 PM
#4
avatar of Srinidhalaya

Posts: 357

I'm at work, so I can't do any testing, but most scar error's are syntax. A mis placed coma, bracket...ect. Maybe add a code insert in this thread with the exact script.
24 Jul 2014, 17:23 PM
#5
avatar of centurionbc

Posts: 18

Here is the basic code without the pop cap in there the pop cap seems to work fine:



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 = 240,
fuel = 40,
munition = 0,
action = 0,
command = 1,
},
--us forces:
[3] = {
manpower = 400,
fuel = 15,
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 = 1140,
fuel = 70,
munition = 50,
action = 0,
command = 2,
},
--us forces:
[3] = {
manpower = 1300,
fuel = 45,
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,
},
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,
},
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_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)
local resource_set = g_ResourceSet[Player_GetRace(player)]
Player_ApplyResourceSet(player, resource_set)

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

Scar_AddInit(CustomStartingResources_Init)
24 Jul 2014, 17:26 PM
#6
avatar of centurionbc

Posts: 18

The code posted, is an exact copy and paste of the official code on here for resource changes btw
24 Jul 2014, 17:36 PM
#7
avatar of Srinidhalaya

Posts: 357

Lunch break is over, but at a quick glance it looks good, compared to the tutorial. Janne may be able to elaborate. If no word is mentioned by the time I get home from work, Ill take a look.
24 Jul 2014, 17:49 PM
#8
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

I've been in contact with Relic. Player_GetRace has been changed and it no longer returns the race index. I will have to update the script to work with the recent changes.

Edit:

I've updated the tutorial, it should now work. I don't have time to test it but it's such a small change it should work without issues.
24 Jul 2014, 17:52 PM
#9
avatar of centurionbc

Posts: 18

Oh I see, Well thank you fro the reply Janne252, I will be on the look out for your updates to the script! You are a big help!
24 Jul 2014, 17:54 PM
#10
avatar of centurionbc

Posts: 18

And thanks Srinidhalaya for your help as well, i appreciate you taking the time to help me!
24 Jul 2014, 19:15 PM
#11
avatar of centurionbc

Posts: 18

Now I am not sure exactly how to combinethe pop cap change with the resource change. The resource will work fine on its own, but when they mix it still gives the error?
24 Jul 2014, 19:32 PM
#12
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

It's a bit complicated, I should include it in the tutorial as well at some point. However, here's a code that should work, with both custom starting resources and popcap.

Code
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 = 240,
fuel = 40,
munition = 0,
action = 0,
command = 1,
},
--us forces:
[3] = {
manpower = 400,
fuel = 15,
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 = 1140,
fuel = 70,
munition = 50,
action = 0,
command = 2,
},
--us forces:
[3] = {
manpower = 1300,
fuel = 45,
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,
},
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,
},
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_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
--Population cap override value
g_popCapOverride = 200

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
else
return -1
end
end

Scar_AddInit(CustomStartingResources_Init)
24 Jul 2014, 19:40 PM
#13
avatar of centurionbc

Posts: 18

I really appreciate it! Thanks so much ive been trying to figure it out but no success, thanks for getting it working though!
25 Jul 2014, 00:40 AM
#14
16 Aug 2014, 08:33 AM
#15
avatar of Ozric1975

Posts: 14

Greetings!

I too have the fatal scar error BUT not with all custom maps...

I am using the same code with pop cap and modify__RT above:

function OnInitID()
--Population cap override value
g_popCapOverRide = 150

for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_SetPopCapOverride(player, g_popCapOverRide)
Modify_PlayerResourceRate(World_GetPlayerAt(1), RT_Manpower, 1.2)
Modify_PlayerResourceRate(World_GetPlayerAt(2), RT_Manpower, 1.2)
Modify_PlayerResourceRate(World_GetPlayerAt(3), RT_Manpower, 1.2)
Modify_PlayerResourceRate(World_GetPlayerAt(4), RT_Manpower, 1.2)
end
-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

end

It seems that with some maps will work but others wont...

And what about the supply center_MP point that used to work?

With the WFA update I have a yellow box stating missing xml!

Guess its obsolete now?

And last any code to increase the speed of game?

In COH1 we had the setsimrate (x),which doesn't work in coh2

Thanks in advance!
1 user is browsing this thread: 1 guest

Livestreams

Offline

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

359 users are online: 1 member and 358 guests
Kronosaur0s
4 posts in the last 24h
30 posts in the last week
84 posts in the last month
Registered members: 44636
Welcome our newest member, otorusmfqz
Most online: 2043 users on 29 Oct 2023, 01:04 AM