Can't progress in Black Day co-op (again)

Tournaments announces and results.

Moderators: FtXCommando, Stups

Can't progress in Black Day co-op (again)

Postby Paul Kauphart » 01 Jul 2014, 02:34

Same behavior as there : viewtopic.php?f=3&t=7814 but the bug never went away when I set myself to unassigned team.

here is the game.log
Attachments
Copie (2) de game.log
(153.53 KiB) Downloaded 57 times
User avatar
Paul Kauphart
Crusader
 
Posts: 42
Joined: 23 Apr 2014, 01:27
Has liked: 5 times
Been liked: 3 times
FAF User Name: Paul_Kauphart

Re: Can't progress in Black Day co-op (again)

Postby Paul Kauphart » 15 Jul 2014, 16:50

Hello, any luck in cornering down the problem ?
User avatar
Paul Kauphart
Crusader
 
Posts: 42
Joined: 23 Apr 2014, 01:27
Has liked: 5 times
Been liked: 3 times
FAF User Name: Paul_Kauphart

Re: Can't progress in Black Day co-op (again)

Postby Paul Kauphart » 30 Sep 2014, 17:46

Refresh, anybody had a look at that ?

If needed I can try again.
User avatar
Paul Kauphart
Crusader
 
Posts: 42
Joined: 23 Apr 2014, 01:27
Has liked: 5 times
Been liked: 3 times
FAF User Name: Paul_Kauphart

Re: Can't progress in Black Day co-op (again)

Postby Paul Kauphart » 04 Oct 2014, 15:12

Hello, In the end, I had a go at the problem myself. Here is the problem in the error log :

Code: Select all
warning: Error running lua script: ...\maps\x1ca_coop_001_v07\x1ca_coop_001_v07_script.lua(1616): access to nonexistent global variable "exp"
         stack traceback:
            [C]: in function `error'
            ...alliance\gamedata\mohodata.scd\lua\system\config.lua(53): in function <...alliance\gamedata\mohodata.scd\lua\system\config.lua:52>
            ...\maps\x1ca_coop_001_v07\x1ca_coop_001_v07_script.lua(1616): in function `M3CounterAttack'
            ...\maps\x1ca_coop_001_v07\x1ca_coop_001_v07_script.lua(1446): in function <...\maps\x1ca_coop_001_v07\x1ca_coop_001_v07_script.lua:1378>


I had a look at the relevant part of the code :

Code: Select all
    # sends [1, 2, 3] strat bomber groups at each hlra
    if(total < quantity[Difficulty]) then
        for _, player in ScenarioInfo.HumanPlayers do
            local exp = ArmyBrains[player]:GetListOfUnits(categories.TECH3 * categories.ARTILLERY * categories.STRUCTURE, false)
                num = table.getn(exp)
                if(num > 0) then
                    if(num > quantity[Difficulty] - total) then
                        num = quantity[Difficulty] - total
                    end
                end
        end
        for i = 1, num do
            for j = 1, Difficulty do
                units = ScenarioUtils.CreateArmyGroupAsPlatoonCoopBalancedVeteran('Order', 'M2_Main_Adapt_Bomber', 'GrowthFormation', 5)
                IssueAttack(units:GetPlatoonUnits(), exp[i])
                ScenarioFramework.PlatoonPatrolChain(units, 'M1_Order_E_AirAttack_1_Chain')
                local guards = ScenarioUtils.CreateArmyGroup('Order', 'M2_Main_Adapt_StratGuards')
                IssueGuard(guards, units:GetPlatoonUnits()[1])
            end
            total = total + 1
        end
    end


Problem here, local variable exp is defined in the first for block, and used in the second... Looking at the other similar blocks of that function, and the logic behind, I think the code should be :
Code: Select all
    # sends [1, 2, 3] strat bomber groups at each hlra
    if(total < quantity[Difficulty]) then
        for _, player in ScenarioInfo.HumanPlayers do
            local exp = ArmyBrains[player]:GetListOfUnits(categories.TECH3 * categories.ARTILLERY * categories.STRUCTURE, false)
            num = table.getn(exp)
            if(num > 0) then
                if(num > quantity[Difficulty] - total) then
                    num = quantity[Difficulty] - total
                end
            for i = 1, num do
               for j = 1, Difficulty do
                  units = ScenarioUtils.CreateArmyGroupAsPlatoonCoopBalancedVeteran('Order', 'M2_Main_Adapt_Bomber', 'GrowthFormation', 5)
                  IssueAttack(units:GetPlatoonUnits(), exp[i])
                  ScenarioFramework.PlatoonPatrolChain(units, 'M1_Order_E_AirAttack_1_Chain')
                  local guards = ScenarioUtils.CreateArmyGroup('Order', 'M2_Main_Adapt_StratGuards')
                  IssueGuard(guards, units:GetPlatoonUnits()[1])
               end
               total = total + 1
            end
            end
        end
    end



I have corrected it in my local version (cf joined file) and see if that works.
Attachments
X1CA_Coop_001_v07_script.lua
(135.46 KiB) Downloaded 89 times
User avatar
Paul Kauphart
Crusader
 
Posts: 42
Joined: 23 Apr 2014, 01:27
Has liked: 5 times
Been liked: 3 times
FAF User Name: Paul_Kauphart

Re: Can't progress in Black Day co-op (again)

Postby Paul Kauphart » 05 Oct 2014, 05:07

I can confirm it works now.
User avatar
Paul Kauphart
Crusader
 
Posts: 42
Joined: 23 Apr 2014, 01:27
Has liked: 5 times
Been liked: 3 times
FAF User Name: Paul_Kauphart

Re: Can't progress in Black Day co-op (again)  Topic is solved

Postby Deering » 05 Oct 2014, 06:00

Nice work. It might be a good idea to upload the entire map in the contributor section. More likely to get noticed then here.
Deering
Evaluator
 
Posts: 673
Joined: 18 Sep 2013, 11:47
Has liked: 16 times
Been liked: 41 times
FAF User Name: Deering


Return to Tournaments

Who is online

Users browsing this forum: No registered users and 1 guest

cron