[SOLVED][CAMPAIGN] New campaign names

Has anyone ever managed to get a campaign other than ascension to work? I mean the name/folder/string “ascension”. I’m trying to troubleshoot crashing problems, and my notes from the old HW2C days say that using any other name causes the game to crash.

Here’s the unhelpful error:

LUA -- CreateRef -- FATAL EXIT -- luaconfig/799:! --stack trace--

@radar3301 managed to do it in the pre-patch days, but I can’t remember how…

Did he ever post the files?

He did in our Taiidan Republic Mod dropbox. There is a file called missionutils.lua:

-- This creates the structure for the missions
if (Mission == nil) then Mission = {} end

if (STANDARD_POST_LEVEL == nil) then
    STANDARD_POST_LEVEL = function ( bWin )
        if ( bWin == 1 ) then
            -- playAnimatic("data:animatics/A15.lua", 1, 0)
        else
            postLevelComplete()
        end
    end
end

if (missionCount == nil) then
    missionCount = 0
end

if (AddMission == nil) then
    function AddMission(_dir, _level, _postlevel, _dispName, _desc)
        missionCount = missionCount + 1
        Mission[missionCount] = {
            directory = _dir,
            level = _level,
            postlevel = _postlevel,
            displayName = _dispName,
            description = _desc,
        }
    end
end

if (AddMissionPostLoad == nil) then
    function AddMissionPostLoad(_postload)
        Mission[missionCount].postload = _postload
    end
end

and another file called trp.campaign:

dofilepath("data:leveldata/campaign/missionutils.lua")

-- localized display name for the UI
displayName = "$5500"

-- 0 = Primary
-- 1 = Tutorial
-- 2 = Extra
-- 3 = Info
contentType = 0
contentName = "trp"
contentOrdered = 0
contentChooseText = "$3492" -- CHOOSE MISSION//
contentThumbName = "[contentThumbName]"
contentThumbDesc = "[contentThumbDesc]"
contentSort = 0.4	-- Default is 1.0, so 0.4 will appear _before_ others.

ExtFilter = "campaign_trp"

INCLUDE_TEASER_MISSION_IN_CAMPAIGN = true;

if (INCLUDE_TEASER_MISSION_IN_CAMPAIGN == true) then
    AddMission("Mxx",
        "Mxx.level",
        STANDARD_POST_LEVEL,
        "Taiidan Republic Teaser Mission",
        "A convoy of Republic cargo transports must be escorted through the Arnon Belt to the trading station at Aroer.")
end


-- AddMission(_dir, _level, _postlevel, _dispName)
-- AddMission("m01", "m01.level", STANDARD_POST_LEVEL, "[displayName]", "[description]")
-- AddMissionPostLoad(_postload)

-- AddMission("m02", "m02.level", STANDARD_POST_LEVEL, "[displayName]", "[description]")
-- AddMission("m03", "m03.level", STANDARD_POST_LEVEL, "[displayName]", "[description]")
-- etc...

The actual mission directory is called “mxx”.

I’m not getting a scripting error, however, so I don’t think that’s the issue. Did he upload the whole mod? I’m thinking some file or folder is missing or misnamed.

[edit]

Also, what command-line string are you using to launch the game?

What we actually have is:

/data/leveldata/campaign/missionutils.lua
/data/leveldata/campaign/trp.campaign
/data/leveldata/campaign/trp.dds

/data/leveldata/campaign/trp/mxx/mxx.level
/data/leveldata/campaign/trp/mxx/mxx.lua
/data/leveldata/campaign/trp/mxx/teamcolour.lua

I forget whether all those files were necessary or not…

I believe missionutils.lua was my doing (it looks like my coding style), but I don’t think anything else was.

Our command line for the Taiidan Republic Mod includes -campaign trp, or at least mine does. I’m not sure what command line the launcher uses when we launch it from the HWRM Collection MODS dashboard thing.

@Dom2, what is the type of the mission you had me vidcap? Is it a campaign mission, or just an “extra” mission?


The only files that are technically necessary are data:leveldata/campaing/xyz.campaign and any level files referenced by the AddMission function (if you use my function, that is).

Somehow I fixed whatever the problem was by accident. Thanks for the help!

That was an “extra”. I haven’t got round to re-implementing a genuine campaign since the patch…

Even though you fixed it, I found with comparing the different campaigns that in ‘leveldata/campaign/.campaign’ there is a key “contentType” . With this set to 0, the game will load it as the main campaign. I haven’t checked what will happen if there are multiple campaigns with the contentType set to 0 though.

So I don’t need to add the “-campaign TestMissionGrid” command-line parameter to my shortcut?

To my knowledge no. I believe, as long as there is only 1 campaign file in leveldata/campaign that has the contentType set to 0, then the campaign button in the main menu will work fine. The HW1 and HW2 's campaign files are kept separately in HW1Campaign.big and HW2Campaign.big. To enable the campaign button for a mod, you will need to extract ‘ui/newui/main/exbuttons.lua’ from either of them 2 campaigns. The file just enables the campaign button and disables the MPButton on the main menu.

Hey @Mikali, I am getting this same error too… do you recall what you changed to make this go away? :thinking:

No, sadly. It seems it fixed itself when I did something else.