Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 6 (modified by binderm, 8 years ago) (diff)

How to add a level to the Campaign Menu:

There are severel steps you have to follow, if you want to add a level to the campaign menu:

  • Create a button for the level in CampaignMenu.layout
  • Add the level to CampaignMenu.lua
  • Add the level to the LevelManager:
    • The LevelManager only knows the level listed in config/orxonox.ini. Therefore you have to add your level to this file. Search for [LevelManager] and enter campaignMissions_[i]="yourlevelname".
    • Next step is to include your level into the structure of the campaign.
      When you know where you want to include the level, you go to the LevelManager, search for the function buildallLevelStatus() and include your level into the structure of the campaign.
      • How to include it:
        You have to make a new v={1,0,2,….} (This says, what happens with the jth-levels when your level is allready won: activated(1), not activated(0), or only visible(2). With this vector you include your level into the campaign mode) and then allLevelStatus_[i]→nextLevels=v; (as it is done for all the others).
        You also have to think at what point of the mission your level should be shown or not. To implement that, you have to add a 0/½ to all the other v's.(same principle as for your own v)
        At the end all v's (also the one you initilize) should have the length of your campaignMission_ (=number of levels).