搜索结果: *

  1. BL Coding Extending existing game menus through AddGameMenuOption

    Yeah, you are right, it actually is. It seems like my problem was something else.

    Also I found a way to actually see the ID.

    插入代码块:
    CampaignEvents.GameMenuOpened.AddNonSerializedListener(this, OnMenuOpen);
    
    
    private void OnMenuOpen(MenuCallbackArgs args)
    {
        // args contain the menuContext -> GameMenu -> Menu_ID
    }

    With this you can check the ID of any Menu by registering the listener and looking at the menu object at runtime.
    That's godlike, thanks
  2. BL Coding Extending existing game menus through AddGameMenuOption

    Considering the ID for towns is "town" and castles is "castle", I am pretty sure the ID for villages is "village" lmao
  3. BL Other How to edit chat lines?

    Hi Mocb,

    I found you can add dialog lines to NPC conversations and player dialog, currently I have only overwritten lines for NPCs by using exisiting dialog IDs and adding more player dialog in response, again using exisiting ids. To do this, I Added the dialog to a gameStarterObject exposed as a parameter in "OnGameStart(...)". Take a look below.

    插入代码块:
    protected override void OnGameStart(Game game, IGameStarter gameStarterObject)
    {
                if(game.GameType is Campaign &&gameStarterObject is CampaignGameStarter campaignGameStarter)
                {
                    campaignGameStarter.AddDialogLine("bandit_start_attacker", "start", "bandit_attacker", "Hello world!", new ConversationSentence.OnConditionDelegate(this.bandit_neutral_greet_on_condition), new ConversationSentence.OnConsequenceDelegate(this.bandit_neutral_greet_on_consequence), 100, (ConversationSentence.OnClickableConditionDelegate)null);
                    campaignGameStarter.AddPlayerLine("common_encounter_ultimatum", "bandit_attacker", "common_encounter_ultimatum_answer", "That old spiel? Prepare to fight.", (ConversationSentence.OnConditionDelegate)null, (ConversationSentence.OnConsequenceDelegate)null, 100, (ConversationSentence.OnClickableConditionDelegate)null, (ConversationSentence.OnPersuasionOptionDelegate)null);
                    campaignGameStarter.AddPlayerLine("common_encounter_fight", "bandit_attacker", "bandit_attacker_leave", "Innocent noob, you may go.", (ConversationSentence.OnConditionDelegate)null, (ConversationSentence.OnConsequenceDelegate)null, 100, (ConversationSentence.OnClickableConditionDelegate)null, (ConversationSentence.OnPersuasionOptionDelegate)null);
                }
    }

    So this code first makes a check that that the game is the campaign, and casts(I don't know term C# code:smile:) the gameStarterObject as a CampaignGameStarter object, which has the dialog functions. Then it adds a dialog line to the bandit_start_attacker situation.
    Any idea where the lord's dialogues are located? I digged for hours but couldnt find them anywhere.
    All I can find are the persuasion dialogues, but not basic ones like "I am here to deliver my demands" and ****.
后退
顶部 底部