📂
Bannerlord Modding CN
  • 骑马与砍杀2 领主 Mod 制作文档
  • C# API Documentation
    • Core
      • MBObjectManager
      • GameModel
      • InformationManager
      • BasicCharacterObject
      • Game
      • ItemObject
    • Campaign System
      • GameMenu
      • Settlement
      • CampaignGameStarter
      • actions
        • ChangeOwnerOfSettlementAction
      • TournamentGame
      • Hero : MBObjectBase, ITrackableCampaignObject, ITrackableBase
      • CampaignBehaviorBase
    • Mount And Blade
      • MissionBehaviour
        • MissionView
        • MissionLogic
      • MBInitialScreenBase
      • Mission
      • MBSubModuleBase
      • agent
      • Team
    • Input System
      • Input
    • Engine
      • GlobalLayer
      • ScriptComponentBehaviour
      • Scene
      • GameEntity
    • Library
      • ModuleInfo
    • Platform Service
    • Save System
    • Localization
      • MBTextManager
      • TextObject
    • Network
    • Two Dimension
  • XML Documentation
    • NPCCharacters
      • NPCCharacter(NPC角色)
        • upgrade_targets
          • upgrade_target
        • equipmentSet
          • equipment
        • Face
          • BodyProperties
          • hair_tags
            • hair_tag
          • BodyPropertiesMax
          • beard_tags
            • beard_tag
          • face_key_template
        • equipment
        • skills
          • skill
        • Traits
          • Trait
    • 物品(大类) Items
      • 物品 Item
        • 物品组件 ItemComponent
          • 马匹 Horse
            • Materials
              • Material
                • MeshMultipliers
                  • MeshMultiplier
          • 防具 Armor
          • Weapon
            • WeaponFlags
          • 食物 Food
        • 旗帜 Flags
      • CraftedItem
        • Pieces
          • Piece
    • Items (XML)
    • Scenes
      • Scene
        • GameType
        • TerrainType
          • TerrainType
    • SPCultures (XML)
    • SPCultures
      • Culture
        • female_names
          • name
        • male_names
          • name
        • clan_names
          • name
    • Atmosphere (XML)
    • SubModule (XML)
    • Scenes (XML)
    • NPCCharacters (XML)
  • Gauntlet
    • Brush
    • GauntletLayer
    • GauntletMovie
    • SceneLayer
    • Movie (XML)
    • Widget
    • GauntletView
    • ScreenBase
    • ViewModel
    • ScreenManager
  • Introduction
    • 高级用法
    • 开始第一步
    • 文件夹结构
    • Defining custom data
  • Tutorials
    • 将你的mod打包上传至Vortex
    • Making Banners
    • 不需要C#的UI系统Mod入门 #
    • 基本 C# Mod
    • new_settlements
  • ru
    • _intro
      • Начало
      • Структура папок
Powered by GitBook
On this page
  • Accessible Methods:
  • public void ClearEmptyObjects()
  • public void AddBehavior(CampaignBehaviorBase campaignBehavior)
  • public void AddModel(GameModel model)
  • public void LoadGameTexts(string xmlPath)
  • public void LoadGameMenus(Type typeOfGameMenusCallbacks, string xmlPath)
  • public void AddGameMenu(string menuId, string menuText, OnInitDelegate initDelegate, GameOverlays.MenuOverlayType overlay = GameOverlays.MenuOverlayType.None, GameMenu.MenuFlags menuFlags = GameMenu.MenuFlags.none, object relatedObject = null)
  • public void AddWaitGameMenu(string idString, string text, OnInitDelegate initDelegate, OnConditionDelegate condition, OnConsequenceDelegate consequence, OnTickDelegate tick, GameMenu.MenuAndOptionType type, GameOverlays.MenuOverlayType overlay = GameOverlays.MenuOverlayType.None, float targetWaitHours = 0f, GameMenu.MenuFlags flags = GameMenu.MenuFlags.none, object relatedObject = null)
  • public void AddGameMenuOption(string menuId, string optionId, string optionText, GameMenuOption.OnConditionDelegate condition, GameMenuOption.OnConsequenceDelegate consequence, bool isLeave = false, int index = -1, bool isRepeatable = false)
  • Accessible Attributes:
  • public readonly bool IsTutorial
  • public ICollection<CampaignBehaviourBase> CampaignBehaviors
  • public IEnumerable<GameModel> Models
  • Example Use:

Was this helpful?

  1. C# API Documentation
  2. Campaign System

CampaignGameStarter

PreviousSettlementNextactions

Last updated 4 years ago

Was this helpful?

This class can be used to introduce behaviours, dialog, menus and models for campaigns, and implements the IGameStarter interface. This is useful in the OnGameStart method in , which is shown in the example.

NOTE: This page is incomplete, so if you find anymore information on the subject, please create a pull request and add to this growing Modding Documentation!

Accessible Methods:

public void ClearEmptyObjects()

(Work in progress)

public void AddBehavior(CampaignBehaviorBase campaignBehavior)

Adds the to the current campaign.

public void AddModel(GameModel model)

Adds the to the current campaign.

public void LoadGameTexts(string xmlPath)

(Work in progress) Loads XML file at the inputted path, introducing more texts to the game. These texts are in the same format as the comment_strings.xml file, with their purpose currently not determined.

public void LoadGameMenus(Type typeOfGameMenusCallbacks, string xmlPath)

(Work in progress) Loads XML file at the inputted path, introducing more menus to the game.

public void AddGameMenu(string menuId, string menuText, OnInitDelegate initDelegate, GameOverlays.MenuOverlayType overlay = GameOverlays.MenuOverlayType.None, GameMenu.MenuFlags menuFlags = GameMenu.MenuFlags.none, object relatedObject = null)

public void AddWaitGameMenu(string idString, string text, OnInitDelegate initDelegate, OnConditionDelegate condition, OnConsequenceDelegate consequence, OnTickDelegate tick, GameMenu.MenuAndOptionType type, GameOverlays.MenuOverlayType overlay = GameOverlays.MenuOverlayType.None, float targetWaitHours = 0f, GameMenu.MenuFlags flags = GameMenu.MenuFlags.none, object relatedObject = null)

(Work in progress)

public void AddGameMenuOption(string menuId, string optionId, string optionText, GameMenuOption.OnConditionDelegate condition, GameMenuOption.OnConsequenceDelegate consequence, bool isLeave = false, int index = -1, bool isRepeatable = false)

Accessible Attributes:

NOTE: All of these are get/read only

public readonly bool IsTutorial

Whether or not the campaign starts with a tutorial.

public ICollection<CampaignBehaviourBase> CampaignBehaviors

public IEnumerable<GameModel> Models

Example Use:

protected override void OnGameStart(Game game, IGameStarter gameStarter) 
{
    if(game.GameType is Campaign) 
    {
        //Current game is a campaign, so IGameStarter object must be CampaignGameStarter
        CampaignGameStarter campaignStarter = (CampaignGameStarter) gameStarter;
        //Can now use CampaignGameStarter
    }
}

See for use.

See for use.

Collection of all registered .

Enumerable Set of all registered

This is used within our class:

MBSubModuleBase
Campaign Behavior
Game Model
GameMenu
GameMenu
Campaign Behaviours
Game Models
MBSubModuleBase