Custom campaigns and the menu

Now that I’m fully moving over to HWR modding, I’m having a lot of trouble getting my old WIP campaign over into it. I had things appearing nicely in the old HW2 campaign menu, but can’t crack it now. I’ve tried grafting various parts of the new .campaign files to my old one, making sure that my new version gets included in the mods’ filtering, but nothing works so far. Anyone got pointers?

Last tried command line:

-campaign pirates

Last tried .campaign file(pirates.campaign in data/leveldata/campaign/)

contentType = 0
contentName = “pirates_hwat”
contentOrdered = 0
contentChooseText = “$4062”
contentThumbName = “$4064”
contentThumbDesc = “$4063”
contentSort = 0.5 – Default is 1.0, so 0.5 will appear before others.
contentRules = “SinglePlayer” – A DEFAULT that actually reads from SinglePlayerOptions.lua

ExtFilter = “campaigns_hwat”

displayName = “$5500”

Mission = {}
Mission[1] = {
postload = function() c=[[]]; playAnimatic(“data:animatics/KPMC01_Intro.lua”,0,1); c=[[]]; end,
directory = “KPMC01_Convoy”,
level = “KPMC01_Convoy.level”,
postlevel = function(bWin) if (bWin == 1) then playAnimatic(“data:animatics/A01.lua”, 1, 0) else postLevelComplete() end end,
displayName = “Convoy”,
description = “The UNH 1203rd carrier group is dispatched to protect a tradelane from piracy.”}

Apparently, we cannot use ContentType = 0 with mod …

Try to use contentType = 2 (Extra) and access this mission by Extra Mission menu :wink:

Personally i use the extra contentType, and no problem to access.

I tried 2 as well and didn’t get ir ro show up. Could you share a .campaign file and any command line switches you need?

I don’t add any command line … shortcuts have just -overRideBigFile -mod Compatibility.big etc …

In my special rules for this campaign i have this :

GameRulesName = "Single Player"
Description = "No description"
SaveGameVersion = 1.0
SinglePlayer = 1

ExtFilter = "rules_sp,rules_sp_generic,rules_campaign_ssc"

Race_Paths = "Goauld_Tutorial_SP"

Race_Pass_Tags = "race_ssc_sp"

And in my .campaign :

-- localized display name for the UI
displayName = "Campaign Goauld"

-- 2 = Extra
contentType = 2
contentName = "Campaign_Goauld"
contentOrdered = 0
contentChooseText = "Campaign Goauld"
contentThumbName = "$11000"
contentThumbDesc = "$11001"
contentSort = 0.4	-- Default is 1.0, so 0.5 will appear _before_ others.
contentRules = "Goauld_Tutorial_SP"

ExtFilter = "campaign_tutorial,campaign_goauld,campaign_ssc"

Mission = { }   -- create a mission structure

-- Mission 1 
Mission[1] = {
    postload        = function () end,

    directory       = "M01_Abydos",
    level           = "M01_Abydos.level",
    displayName     = "Begin intro Abydos",
    postlevel = function(bWin) if (bWin == 1) then postLevelComplete(); else postLevelComplete(); end end,

Oh, and i don’t use any animatics in this time, the animator don’t finished this yet … So, i have two postLevelComplete() …

Oh … Why you have the c=[[]] at the beginning (probably use this in other file ?) ?
We have not this in the base file :

postload		= function () playAnimaticNis("data:animatics/A00.lua", "nis/NIS01A");  end,

This what I am using in my .campaign file:

  -- localized display name for the UI
displayName = "Taiidan Republic Test Campaign"

-- 2 = Extra
contentType = 2
contentName = "TRP"
contentOrdered = 0
contentChooseText = "Campaign choose text"
contentThumbName = "Taiidan Republic Test Campaign"
contentThumbDesc = "A test mission for the Taiidan Republic mod (WIP)"
contentSort = 0.4    -- Default is 1.0, so 0.4 will appear _before_ others.

-- This creates the structure for the missions
Mission = {}

Mission[1] =
    directory = "M00",
    level = "M00.level",
    postlevel = function ( bWin )
        if bWin == 1 then
    displayName = "Mission 0 - Taiidan Republic Test Mission",
    description = "Test Mission for Taiidan Republic ships...",

It’s a trick for block commenting. remove the closing braces on the first one and everything until the second one is effectively commented out. Unless you have a variable named c somewhere, I suppose.

Thats the idea anyway. Doesn’t seem to be working especially well at the moment. Getting rid of that bit cleaned up some errors and made the extra missions button appear. Pushing it causes a crash to desktop, but it’s progress.

Edit: Well, I got the menus to stop crashing. The bit that was tripping me up is that contentName needs to be the name of the path to the mission.Now, to the next issues!

Alright, menus and launching are all working now. Thanks for the help guys.