Recent content by aigle_360

  1. Discussion Suggestion More pathfinding options for MobileParty

    I tested this feature on the campaign map. However, I don't think it fully matches the requirement.

    I noticed as from v1.2.X that the method called "GetPathBetweenAIFaces" from the "MapScene" class has a new parameter called "excludedFaceIds".

    Instinctively, I would assume that by giving the id of a navmesh face, it would ignore the face from the pathfinding algorithm as the argument's name suggests.
    So, for testing purposes, I created the following Harmony patch which allows the exclusion of hardcoded FaceIds for all parties.
    Note that the tests are conducted on the v1.2.9.34019 build.

    Code:
        [HarmonyPatch]
        public static class DynamicNavmeshPatch
        {
            [HarmonyPrefix]
            [HarmonyPatch(typeof(MapScene), "GetPathBetweenAIFaces")]
            public static bool Prefix(object[] __args)
            {
                // excludedFaceIds argument is the 7th argument and is null by default
                if (__args.Length == 7 && __args[6] == null)
                {
                    // var excludedFaceIds = new[] { 4447 }; // FaceId of the bridge near Amithatys
                    var excludedFaceIds = new[] { 6 }; // FaceGroupId --> Fording terrain type
                    __args[6] = excludedFaceIds;
                }
                return true;
            }
        }

    We can naturally test this out with a bridge. We can use the one near Amitatys as lots of different parties come through there.

    Amythatys-1.jpg


    The following screenshot shows the FaceId of the relevant navmesh faces:

    Amythatys-2-face-index.jpg


    We can notice that the light blue navmesh face corresponds to the bridge which FaceId has the 4447 value. It also has the Fording terrain type.
    So if we include the value 4447 in the excludedFaceIds argument, parties should not be able to cross over the bridge. However, this is not the case.

    As a second test, we can try the value 6 which corresponds to the Fording terrain type. Technically, the value comes from the FaceGroupId (PathFaceRecord class)
    As a result, parties do not cross the bridge. In fact, it excludes all navmesh faces with the Fording terrain type. In other words, bridges can not be crossed.

    Here is a short video showcasing this behaviour:



    In conclusion, I think that FaceIds should be the one to be excluded rather than the FaceIdGroup. Maybe both can be supported ?
    Currently, a unique terrain type value has to be added for each strategic chokepoint in order to be managed individually.
    If I have tens of different chokepoints, it becomes very tedious to manage. On top of that, the navigation mesh needs to be modified via the modding tools.

    It's also not possible to disable random navmesh faces on the fly. There are use cases for this. For instance, dynamically creating new settlements in unforeseen areas or implementing random events such as floods. With the current system, these all have to be pre-defined which limits the experience of an advanced sandbox.

    Anyway, that's my opinion on the matter and I hope some of you found this enlighting. I do hope this will looked at.
  2. 2 Mods I need help to get started on

    If you want to choose which troops to come with you in combat, you could check the code related to hideout attacks. There is already a UI for this. :smile:
    You could create a CampaignBehaviour to add the morale debuff. There are many examples in mods.
  3. OSP Shaders Grandmasters Shaders - Basic Seasons & Wind effects (Version 1.0 RELEASED)

    Emogma said:
    I don't think you can change the texture of the campaign map to go along with this mod? Or is there something out there that does that?

    Easiest way is to manually replace the grass campaign map texture with the snow one when you hit Winter. Then, reverse it back for the other seasons.
  4. Mount & Blade II: Bannerlord Old Discussion Thread

    No idea for the soldier icon and the last row. ^^

    Edit : I figured out that the last row is for the "upgrades"
  5. Mount & Blade II: Bannerlord Old Discussion Thread

    Well, I guess that this video confirms that lords can be killed in battles.
    You can see Achios in the "death row"

    1471437053-gg.png
  6. Banners

    Runea said:
    This code makes it so all generals/counts in the faction use the same banner as their faction leader without having to have a ton of copies of that banner.  I needed it for my mod where the faction mattered more than the individual; and also so armies look more unified under that one banner.

    Atm, I believe the banner will carry over even if they exile/defect to another faction; not sure how to fix that.  Assuming exiled generals don't get a castle or town, it won't be noticeable; and hopefully not enough lords will defect to make things odd :razz:

    Code:
                #faction banners
          (faction_set_slot, "fac_kingdom_1", slot_faction_banner, "mesh_banner_f09"),
          (faction_set_slot, "fac_kingdom_2", slot_faction_banner, "mesh_banner_kingdom_f"),
          (faction_set_slot, "fac_kingdom_3", slot_faction_banner, "mesh_banner_kingdom_c"),
          (faction_set_slot, "fac_kingdom_4", slot_faction_banner, "mesh_banner_f10"),
          (faction_set_slot, "fac_kingdom_5", slot_faction_banner, "mesh_banner_kingdom_e"),
          (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_a"),
    
    
    ##Run code start here
    
    (try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
            (faction_get_slot, ":cur_faction_king", ":cur_faction", slot_faction_leader),
            (faction_get_slot, ":cur_faction_banner", ":cur_faction", slot_faction_banner),
            (val_sub, ":cur_faction_banner", banner_meshes_begin),
            (val_add, ":cur_faction_banner", banner_scene_props_begin),
            (troop_set_slot, ":cur_faction_king", slot_troop_banner_scene_prop, ":cur_faction_banner"),
          (try_end),
      #    (assign, ":num_khergit_lords_assigned", 0),
      #    (assign, ":num_sarranid_lords_assigned", 0),
      #    (assign, ":num_other_lords_assigned", 0),
    
          (try_for_range, ":kingdom_hero", active_npcs_begin, active_npcs_end),
            (this_or_next|troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero),
            (troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_inactive_pretender),
    
            (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
            (neg|faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"),
    #        (try_begin), 
    #          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate
              #(store_add, ":kingdom_3_banners_begin", banner_scene_props_begin, khergit_banners_begin_offset),
              #(store_add, ":banner_id", ":kingdom_3_banners_begin", ":num_khergit_lords_assigned"),
    #          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
              #(val_add, ":num_khergit_lords_assigned", 1),
    #        (else_try),
    #          (eq, ":kingdom_hero_faction", "fac_kingdom_6"), #Sarranid Sultanate
              #(store_add, ":kingdom_6_banners_begin", banner_scene_props_begin, sarranid_banners_begin_offset),
              #(store_add, ":banner_id", ":kingdom_6_banners_begin", ":num_sarranid_lords_assigned"),
    #          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
    #          (val_add, ":num_sarranid_lords_assigned", 1),
    #        (else_try),
    #          (assign, ":hero_offset", ":num_other_lords_assigned"),
    #          (try_begin),
    #            (gt, ":hero_offset", khergit_banners_begin_offset),#Do not add khergit banners to other lords
    #            (val_add, ":hero_offset", khergit_banners_end_offset),
    #            (val_sub, ":hero_offset", khergit_banners_begin_offset),
    #          (try_end),
    #          (try_begin),
    #            (gt, ":hero_offset", sarranid_banners_begin_offset),#Do not add sarranid banners to other lords
    #            (val_add, ":hero_offset", sarranid_banners_end_offset),
    #            (val_sub, ":hero_offset", sarranid_banners_begin_offset),
    #          (try_end),
    #          (store_add, ":banner_id", banner_scene_props_begin, ":hero_offset"),
    #          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
    #          (val_add, ":num_other_lords_assigned", 1),
    #        (try_end),
    
            (try_begin), 
              (eq, ":kingdom_hero_faction", "fac_kingdom_1"), #Swadia
              (faction_get_slot, ":cur_faction_banner", "fac_kingdom_1", slot_faction_banner),
              (val_sub, ":cur_faction_banner", banner_meshes_begin),
              (val_add, ":cur_faction_banner", banner_scene_props_begin),
              (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
            (else_try),
              (eq, ":kingdom_hero_faction", "fac_kingdom_2"), #Vaegir
              (faction_get_slot, ":cur_faction_banner", "fac_kingdom_2", slot_faction_banner),
              (val_sub, ":cur_faction_banner", banner_meshes_begin),
              (val_add, ":cur_faction_banner", banner_scene_props_begin),
              (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
            (else_try),
              (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate
              (faction_get_slot, ":cur_faction_banner", "fac_kingdom_3", slot_faction_banner),
              (val_sub, ":cur_faction_banner", banner_meshes_begin),
              (val_add, ":cur_faction_banner", banner_scene_props_begin),
              (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
            (else_try),
              (eq, ":kingdom_hero_faction", "fac_kingdom_4"), #Nords
              (faction_get_slot, ":cur_faction_banner", "fac_kingdom_4", slot_faction_banner),
              (val_sub, ":cur_faction_banner", banner_meshes_begin),
              (val_add, ":cur_faction_banner", banner_scene_props_begin),
              (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
            (else_try),
              (eq, ":kingdom_hero_faction", "fac_kingdom_5"), #Rhodok
              (faction_get_slot, ":cur_faction_banner", "fac_kingdom_5", slot_faction_banner),
              (val_sub, ":cur_faction_banner", banner_meshes_begin),
              (val_add, ":cur_faction_banner", banner_scene_props_begin),
              (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
            (else_try),
              (eq, ":kingdom_hero_faction", "fac_kingdom_6"), #Sarannid
              (faction_get_slot, ":cur_faction_banner", "fac_kingdom_6", slot_faction_banner),
              (val_sub, ":cur_faction_banner", banner_meshes_begin),
              (val_add, ":cur_faction_banner", banner_scene_props_begin),
              (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
            (try_end),
    
        #    (try_begin),
        #      (this_or_next|lt, ":banner_id", banner_scene_props_begin),
        #      (gt, ":banner_id", banner_scene_props_end_minus_one),
        #      (display_message, "@{!}ERROR: Not enough banners for heroes!"),
        #    (try_end),
    
    ##Run code end here
    
            (store_character_level, ":level", ":kingdom_hero"),
            (store_mul, ":renown", ":level", ":level"),
            (val_div, ":renown", 4), #for top lord, is about 400
    
    		(troop_get_slot, ":age", ":kingdom_hero", slot_troop_age),
            (store_mul, ":age_addition", ":age", ":age"),
            (val_div, ":age_addition", 8), #for top lord, is about 400
    		(val_add, ":renown", ":age_addition"),

    It works with more than 6 factions as well, just add another

    Code:
            (else_try),
              (eq, ":kingdom_hero_faction", "fac_kingdom_7"), #New Faction
              (faction_get_slot, ":cur_faction_banner", "fac_kingdom_7", slot_faction_banner),
              (val_sub, ":cur_faction_banner", banner_meshes_begin),
              (val_add, ":cur_faction_banner", banner_scene_props_begin),
              (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
            (try_end),

    code section and bump up the number to 7, then paste it again for 8, etc.  Just make sure the "(try_end)," is after the last one and not after any others.

    And these simple triggers will update lords banner to their current faction. Centers will also have their banner updated

    Code:
        #Eagle
        (24, #Updates every lord's banner to their current faction.
       [
            (try_for_range, ":lord_no", active_npcs_begin, active_npcs_end),
                (this_or_next|is_between, ":lord_no", lords_begin, lords_end),
                (is_between, ":lord_no", companions_begin, companions_end),
                (troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
                (store_faction_of_troop, ":lords_faction", ":lord_no"),
                (faction_get_slot, ":lords_king", ":lords_faction", slot_faction_leader),
                (troop_get_slot, ":faction_banner", ":lords_king", slot_troop_banner_scene_prop),
                (troop_set_slot, ":lord_no", slot_troop_banner_scene_prop, ":faction_banner"),
            (try_end),
        ]),
    
      (24, #Updates every town/castle's banner to their current faction.
       [
           (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
                (party_get_slot, ":town_lord", ":center_no", slot_town_lord),
                (gt, ":town_lord", 0),
                (troop_get_slot, ":faction_banner", ":town_lord", slot_troop_banner_scene_prop),
                (gt, ":faction_banner", 0),
                (val_sub, ":faction_banner", banner_scene_props_begin),
                (val_add, ":faction_banner", banner_map_icons_begin),
                (party_set_banner_icon, ":center_no", ":faction_banner"),
           (try_end),
      ]),
        #Eagle
  7. Mount & Blade II: Bannerlord Old Discussion Thread

    Marton96 said:
    Yabloko said:
    Marton96 said:
    Dest45 said:
    At least it gave Bannerlord Publicity. thats what matters you turds

    They are gaining new fans because of E3, but loosing their old fans because of the late release date.

    Would it be better to rush the game?

    Yes. They can fix it later. I actually wish they didn't make singeplayer for the game, only multi.

    Haha good one.
  8. Modding Q&A [For Quick Questions and Answers]

    I 'm wondering if it is possible to  get the amount of a specific agent in a party for instance p_main_party?
  9. OSP Code Combat Perfectly Smooth, Mouse-Enabled Deathcam V1.4

    I don't know if it is the best spot to write this, well anyway, I implemented this death camera kit, it works properly, all smooth. I have also added the TPE source (http://forums.taleworlds.com/index.php/topic,182926.0.html) and was wondering how I could add the first kit to the second source. It simply means that I am  willing to have access to the camera when I will be knocked down in tournaments. It is set so the "tournament battle" continues while the player has been injured. :grin:
    I currently use modmerger to get TPE working.

    Basically, I tried to add this portion of code at certain places of the module_mission_templates
    Code:
          common_init_deathcam,
          common_start_deathcam,
          common_move_deathcam,
          common_rotate_deathcam,

    At first, I was inspired by the Floris mod pack and used their TPE source kit. I was looking somehow to add the previous code to the following one as I am not very experienced in coding.
    Unfortunatly, I didn't manage to get it working as Floris uses a different Death cam which uses a particular script and the one from this topic relies on triggers.  This is TPE (modmerger)'s specific trigger :
    Code:
    	# TRIGGER 18: Player dies, round continues.  Warning of this feature to the player.
    	(0, 0, ti_once, [(main_hero_fallen),],
    	   [(display_message, "@You have fallen during this round, but will be able to continue onto the next round when only one team remains."),
    	    (troop_set_slot, "trp_tpe_presobj", tpe_time_of_death, "$g_wp_tpe_timer"),
    	    # (try_begin),
    			# (eq, MOD_PBOD_INSTALLED, 1), # (dependency) PBOD - Custom camera
    			# (display_message, "@You may move your camera around using the arrow keys."),
    			# # Sets up camera for free movement.
    			# (call_script, "script_cust_cam_init_death_cam", cam_mode_free),
    		# (try_end),
    		]),

    Then, I tried to implement the first code to native's mission_template (of course via the module system) in the "arena_melee_fight" section.
    Code:
        "arena_melee_fight",mtf_arena_fight,-1,
        "You enter a melee fight in the arena.",
        [
          (0,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_red, itm_red_tourney_helmet]),
    [...]
          (31,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
    
    #32
          (32, mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword]),
    [...]
          (39,mtef_visitor_source|mtef_team_4,af_override_all,aif_start_alarmed,1,[itm_practice_staff]),
    #40-49 not used yet
          (24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
    [...]
          (24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
    
          (50, mtef_scene_source,af_override_horse|af_override_weapons|af_override_head,0,1,[]),
          (51, mtef_visitor_source,af_override_horse|af_override_weapons|af_override_head,0,1,[]),
          (52, mtef_scene_source,af_override_horse,0,1,[]),
    #not used yet:
          (53, mtef_scene_source,af_override_horse,0,1,[]),(54, mtef_scene_source,af_override_horse,0,1,[]),(55, mtef_scene_source,af_override_horse,0,1,[]),
    #used for torunament master scene
    
          (56, mtef_visitor_source|mtef_team_0, af_override_all, aif_start_alarmed, 1, [itm_practice_sword, itm_practice_shield, itm_padded_cloth, itm_segmented_helmet]),
          (57, mtef_visitor_source|mtef_team_0, af_override_all, aif_start_alarmed, 1, [itm_practice_sword, itm_practice_shield, itm_padded_cloth, itm_segmented_helmet]),
        ],
        tournament_triggers
      ),

    At last, I put it in tournement_triggers with no satifying result.
    My main problem is that I don't know where to put the first code since my knowledge of triggers isn't that great, haha. I probably implemented in triggers sources which of course creates errors. That's why I would like some help. :smile:
    Thank you and I hope it is understandable!

    Edit : fixed

    Code:
    	# TRIGGER 18: Player dies, round continues.  Warning of this feature to the player.
          common_init_deathcam,
          common_start_deathcam,
          common_move_deathcam,
          common_rotate_deathcam,	
               (0, 0, ti_once, [(main_hero_fallen),],
    	   [(display_message, "@You have fallen during this round, but will be able to continue onto the next round when only one team remains."),
    	    (troop_set_slot, "trp_tpe_presobj", tpe_time_of_death, "$g_wp_tpe_timer"),
    	    # (try_begin),
    			# (eq, MOD_PBOD_INSTALLED, 1), # (dependency) PBOD - Custom camera
    			# (display_message, "@You may move your camera around using the arrow keys."),
    			# # Sets up camera for free movement.
    			# (call_script, "script_cust_cam_init_death_cam", cam_mode_free),
    		# (try_end),
    		]),
  10. MP Oriental [WB] Samurai: Japan in Flames - DEAD

    Encore bon courage, vraiment hâte !
    GL again, hopefully its release ! :wink:
  11. [ND3] - Duel Results Thread

    Imperial_Eagle 9 : 2 Theotian

    Theotian will confirm.
  12. Nditions' European Duelling Tournament III!

    Add me please : Imperial_Eagle
    Thx
  13. B Medieval [WB] Crusader - Way to expiation

    It's looking great especially the soldier's armors !
    I'll be very attentive over all your future activities.
    Good luck guys ! :grin:
Back
Top Bottom