Solved Campaign not loading.

Discussion in 'Mod Support' started by HighDef, Jun 11, 2018.

  1. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    682
    I have made a campaign for the Off-road Trials map by Hendrixx but when I select it I get sent back to the main menu. Plus there's no thumbnail.




    Code:
    {
        "header":{"type":"campaign", "version": 1},
        "title": "Off-Road Trials Campaign",
        "description": "A run through all the section scenarios of this mod.",
        "authors": "BeamNG",
        "difficulty": "5",
        "date":1455193290,
        "summaryHeading" : "NC",
        "summaryMessage" : "NC",
        "startingScenario" : "TT1",
        "scenarios":
        {
            "TT1":
            {
                "title": "TT1",
                "description": "Part1",
                "path": "levels/rain/scenarios/TT1.json",
                "nextScenario": "TT2",
            },
    
            "TT2":
            {
                "title": "TT2",
                "description": "Part2",
                "path": "levels/rain/scenarios/TT2.json",
                "nextScenario": "TT3",
            },
            
            "TT3":
            {
                "title": "TT3",
                "description": "Part3",
                "path": "levels/rain/scenarios/TT3.json",
                "nextScenario": "TT4",
            },
            
            "TT4":
            {
                "title": "TT4",
                "description": "Part4",
                "path": "levels/rain/scenarios/TT4.json",
                "nextScenario": "TT5",
            },
    
            "TT5":
            {
                "title": "TT5",
                "description": "Part5",
                "path": "levels/rain/scenarios/TT5.json",
                "nextScenario": "TT6",
            },
    
            "TT6":
            {
                "title": "TT6",
                "description": "Part6",
                "path": "levels/rain/scenarios/TT6.json",
                "nextScenario": "TT7",
            },
            
            "TT7":
            {
                "title": "TT7",
                "description": "Part7",
                "path": "levels/rain/scenarios/TT7.json",
                "nextScenario": "TT8",
            },
            
            "TT8":
            {
                "title": "TT8",
                "description": "Part8",
                "path": "levels/rain/scenarios/TT8.json",
                "nextScenario": "TT9",
            },
    
            "TT9":
            {
                "title": "TT9",
                "description": "Part9",
                "path": "levels/rain/scenarios/TT9.json",
                "nextScenario": "TT10",
            },
            
            "TT10":
            {
                "title": "TT10",
                "description": "Part10",
                "path": "levels/rain/scenarios/TT10.json",
                "nextScenario": "TT11",
            },
    
            "TT11":
            {
                "title": "TT11",
                "description": "Part11",
                "path": "levels/rain/scenarios/TT11.json",
                "nextScenario": "TT12",
            },
            "TT12":
            {
                "title": "TT12",
                "description": "Part12",
                "path": "levels/rain/scenarios/TT12.json",
            },
        }
    }
    I was able to make scenarios in the past but I fear that things have changed with the code since then. Any help would be much appreciated, cheers.
     
  2. RyvyLo

    RyvyLo
    Expand Collapse

    Joined:
    May 15, 2014
    Messages:
    438
    I took a look at the official campaigns and at my working Road Atlanta campaign to compare, and it seems that the way you have to write the campaign code has changed (maybe to be able to handle more complicated campaigns in the future ?).
    The differences I could spot is that "startingScenario" is replaced by "startingLocation" and that
    ' "scenarios": { ' is replaced by ' "subsections": { "subsection_main": { "locations": { '
    I think your best option is to take an official campaign file and copy-paste and replace with your own campaign information.

    @bobby_boulgat you might want to take a look at this to see if this is the same issue you have with your campaigns
     
    • Staff Pick Staff Pick x 1
    • Informative Informative x 1
  3. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    682
    I noticed this but I thought that that was due to it having different parts within that you travel too. I guess Chapter 1 isn't like that, so that must be where I am going wrong. I will have a play tomorrow when I have free time. Thanks.
     
  4. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    682
    Ok so I have converted the best way I am able to the new code.

    Code:
    {
        "header":{"type":"campaign", "version": 2},
        "title": "Off-Road Trials Campaign",
        "description": "A run through all the section scenarios of this mod.",
        "authors": "HighDef, BeamNG",
        "difficulty": "8",
        "date":190618,
        "summaryHeading" : "NC",
        "summaryMessage" : "NC",
        "startingLocation" : "TT1",
        "subsections": {
          "subsection_main": {
            "locations":
            {
                "TT1":
                {
                    "title": "TT1",
                    "description": "Part 1",
                    "path": "levels/rain/scenarios/TT1.json",
                    "nextScenario": "TT2",
                },
    
                "TT2":
                {
                    "title": "TT2",
                    "description": "Part 2",
                    "path": "levels/rain/scenarios/TT2.json",
                    "nextScenario": "TT3",
                },
                
                "TT3":
                {
                    "title": "TT3",
                    "description": "Part 3",
                    "path": "levels/rain/scenarios/TT3.json",
                    "nextScenario": "TT4",
                },
                
                "TT4":
                {
                    "title": "TT4",
                    "description": "Part 4",
                    "path": "levels/rain/scenarios/TT4.json",
                    "nextScenario": "TT5",
                },
    
                "TT5":
                {
                    "title": "TT5",
                    "description": "Part 5",
                    "path": "levels/rain/scenarios/TT5.json",
                    "nextScenario": "TT6",
                },     
    
                "TT6":
                {
                    "title": "TT6",
                    "description": "Part 6",
                    "path": "levels/rain/scenarios/TT6.json",
                    "nextScenario": "TT7",
                },
    
                "TT7":
                {
                    "title": "TT7",
                    "description": "Part 7",
                    "path": "levels/rain/scenarios/TT7.json",
                    "nextScenario": "TT8",
                },
    
                "TT8":
                {
                    "title": "TT8",
                    "description": "Part 8",
                    "path": "levels/rain/scenarios/TT8.json",
                    "nextScenario": "TT9",
                },
    
                "TT9":
                {
                    "title": "TT9",
                    "description": "Part 9",
                    "path": "levels/rain/scenarios/TT9.json",
                    "nextScenario": "TT10",
                },
    
                "TT10":
                {
                    "title": "TT10",
                    "description": "Part 10",
                    "path": "levels/rain/scenarios/TT10.json",
                    "nextScenario": "TT11",
                }, 
    
                "TT11":
                {
                    "title": "TT11",
                    "description": "Part 11",
                    "path": "levels/rain/scenarios/TT11.json",
                    "nextScenario": "TT12",
                },   
                
                "TT12":
                {
                    "title": "TT12",
                    "description": "Part 12",
                    "path": "levels/rain/scenarios/TT12.json",
                }       
            }
        }
    }
    
    I have no idea if this is the right way apart from the fact that it doesn't work.
     
  5. RyvyLo

    RyvyLo
    Expand Collapse

    Joined:
    May 15, 2014
    Messages:
    438
    I managed to get your campaign working by replacing "startingLocation" : "TT1" by "startingLocation": "subsection_main.TT1"

    I also noticed that your campaign image doesn't load because it's not named the same way as your campaign folder (image is named "TT_series" instead of "TT-series"). Also it's resolution is bigger than necessary, at no moment in time the game will need to display it in full size so you could resize it to 800*450, it's the resolution used in the official campaigns and it has the perfect height/width ratio in relation to the size of the UI image.
     
    • Like Like x 1
  6. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    682
    Ok I have tried it, my code now looks like this:
    Code:
    {
        "header":{"type":"campaign", "version": 2},
        "title": "Off-Road Trials Campaign",
        "description": "A run through all the section scenarios of this mod.",
        "authors": "HighDef, BeamNG",
        "difficulty": "8",
        "date":190618,
        "summaryHeading" : "NC",
        "summaryMessage" : "NC",
        "startingLocation": "subsection_main.TT1",
        "subsections": {
          "subsection_main": {
            "locations":
            {
                "TT1":
                {
                    "title": "TT1",
                    "description": "Part 1",
                    "path": "levels/rain/scenarios/TT1.json",
                    "nextScenario": "TT2",
                },
    
                "TT2":
                {
                    "title": "TT2",
                    "description": "Part 2",
                    "path": "levels/rain/scenarios/TT2.json",
                    "nextScenario": "TT3",
                },
                
                "TT3":
                {
                    "title": "TT3",
                    "description": "Part 3",
                    "path": "levels/rain/scenarios/TT3.json",
                    "nextScenario": "TT4",
                },
                
                "TT4":
                {
                    "title": "TT4",
                    "description": "Part 4",
                    "path": "levels/rain/scenarios/TT4.json",
                    "nextScenario": "TT5",
                },
    
                "TT5":
                {
                    "title": "TT5",
                    "description": "Part 5",
                    "path": "levels/rain/scenarios/TT5.json",
                    "nextScenario": "TT6",
                },     
    
                "TT6":
                {
                    "title": "TT6",
                    "description": "Part 6",
                    "path": "levels/rain/scenarios/TT6.json",
                    "nextScenario": "TT7",
                },
    
                "TT7":
                {
                    "title": "TT7",
                    "description": "Part 7",
                    "path": "levels/rain/scenarios/TT7.json",
                    "nextScenario": "TT8",
                },
    
                "TT8":
                {
                    "title": "TT8",
                    "description": "Part 8",
                    "path": "levels/rain/scenarios/TT8.json",
                    "nextScenario": "TT9",
                },
    
                "TT9":
                {
                    "title": "TT9",
                    "description": "Part 9",
                    "path": "levels/rain/scenarios/TT9.json",
                    "nextScenario": "TT10",
                },
    
                "TT10":
                {
                    "title": "TT10",
                    "description": "Part 10",
                    "path": "levels/rain/scenarios/TT10.json",
                    "nextScenario": "TT11",
                }, 
    
                "TT11":
                {
                    "title": "TT11",
                    "description": "Part 11",
                    "path": "levels/rain/scenarios/TT11.json",
                    "nextScenario": "TT12",
                },   
                
                "TT12":
                {
                    "title": "TT12",
                    "description": "Part 12",
                    "path": "levels/rain/scenarios/TT12.json",
                }       
            }
        }
    }
    But it is not showing up in the campaigns menu also I changed the folder name to TT_series.
     
  7. RyvyLo

    RyvyLo
    Expand Collapse

    Joined:
    May 15, 2014
    Messages:
    438
    It looks like you forgot the } that closed the "subsection_main" part

    Code:
    {
        "header":{"type":"campaign", "version": 2},
        "title": "Off-Road Trials Campaign",
        "description": "A run through all the section scenarios of this mod.",
        "authors": "HighDef, BeamNG",
        "difficulty": "8",
        "date":190618,
        "summaryHeading" : "NC",
        "summaryMessage" : "NC",
        "startingLocation": "subsection_main.TT1",
        "subsections": {
          "subsection_main": {
                "locations": {
                    "TT1":
                    {
                        "title": "TT1",
                        "description": "Part 1",
                        "path": "levels/rain/scenarios/TT1.json",
                        "nextScenario": "TT2",
                    },
    
                    "TT2":
                    {
                        "title": "TT2",
                        "description": "Part 2",
                        "path": "levels/rain/scenarios/TT2.json",
                        "nextScenario": "TT3",
                    },
                    
                    "TT3":
                    {
                        "title": "TT3",
                        "description": "Part 3",
                        "path": "levels/rain/scenarios/TT3.json",
                        "nextScenario": "TT4",
                    },
                    
                    "TT4":
                    {
                        "title": "TT4",
                        "description": "Part 4",
                        "path": "levels/rain/scenarios/TT4.json",
                        "nextScenario": "TT5",
                    },
    
                    "TT5":
                    {
                        "title": "TT5",
                        "description": "Part 5",
                        "path": "levels/rain/scenarios/TT5.json",
                        "nextScenario": "TT6",
                    },     
    
                    "TT6":
                    {
                        "title": "TT6",
                        "description": "Part 6",
                        "path": "levels/rain/scenarios/TT6.json",
                        "nextScenario": "TT7",
                    },
    
                    "TT7":
                    {
                        "title": "TT7",
                        "description": "Part 7",
                        "path": "levels/rain/scenarios/TT7.json",
                        "nextScenario": "TT8",
                    },
    
                    "TT8":
                    {
                        "title": "TT8",
                        "description": "Part 8",
                        "path": "levels/rain/scenarios/TT8.json",
                        "nextScenario": "TT9",
                    },
    
                    "TT9":
                    {
                        "title": "TT9",
                        "description": "Part 9",
                        "path": "levels/rain/scenarios/TT9.json",
                        "nextScenario": "TT10",
                    },
    
                    "TT10":
                    {
                        "title": "TT10",
                        "description": "Part 10",
                        "path": "levels/rain/scenarios/TT10.json",
                        "nextScenario": "TT11",
                    },
    
                    "TT11":
                    {
                        "title": "TT11",
                        "description": "Part 11",
                        "path": "levels/rain/scenarios/TT11.json",
                        "nextScenario": "TT12",
                    },   
                    
                    "TT12":
                    {
                        "title": "TT12",
                        "description": "Part 12",
                        "path": "levels/rain/scenarios/TT12.json",
                    }       
                }
            }
        }
    }
    I hope third time's a charm ;)
     
  8. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    682
    Fantastic it's working. Dam syntax, I didn't go to programming school (sadly) I hate it when it's something silly like that. Thanks very much for your continued assistance. :)
     
    • Agree Agree x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice