Search results for query: *

  1. Settlement Modding - Research and Development

    A few more notes:

    posX, posY determine position of the settlement.
    gate_posX, gate_posY determine position of settlements mapicon.
    Settlement and settlement map icon do not have to be in the same location.

    Working:
    change posX, posY to move settlement to location
    change gate_posX, gate_posY for training field. For Training field it's possible to move both it's location and it's map icon.

    Not working
    change gate_posX, gate_posY. It gets ignored and map_icon is shown at previous location. Exception is the training field, this can be moved with its mapicon to a new location.

    Best way to test: edit story_mode_settlements.xml and change either pos or gate_pos and notice how either the map icon moves, or the map icon stays at the same location, but when clicking on it, the player will travel to some different location to enter the training field.
  2. Enable stack trace?

    How does one enable Stack Trace to get more informative crash logs? Currently it just shows the crash popup: upload logs: yes no.
  3. Settlement Modding - Research and Development

    This is a good start.

    Is there any update for this?

    I'd like to add, that it's possible to change the location through posX, posY. The settlement does change it's location, however, the map icon indicating the village does not move. So the village will be invisible at the new location. The AI knows where the new settlement is and use it's location. Just the player needs to press on the icon which will then make the player travel to the hidden settlements location.

    So the real question is, where do the settlement icons receive their location from?
  4. Conquer bug

    After successfully conquering a castle/town, the players army is returned back to the siege position. Why would I have to return there after successfully breaching the enemies walls and defeating them? After the fight, there will be many wounded, many prisoners and the additional disorganisation...
  5. Documentation Coding Community Modding Documentation

    Ah, just figured the ui.toggle_debug_mode out.
    Enable it, then go back to Visual Studio change something, build and watch it update ingame.

    A quick question to modding the UI following the above linked tutorial:
    How to use:
    ui.toggle_debug_mode

    It doesn't seem to do anything. I tried that command on different screens, mainscreen, quest screen (where the modified title text does show), party screen, but it doesn't actually do anything.
  6. How to run console command on button press?

    Hi, I've followed to tutorial to create a new button in the start menu of Bannerlord currently labelled "Click Me". How would I go about running a console command when that button is pressed? Instead of typing manually in the console, I would like the button to do the same as this console...
  7. Bannerlord: Location of Perk and Skill data

    I'd recommend using harmony for modding, as you can just add new code to the game without decompiling dlls.

    Here's an example on how to access skills and how to set and retrieve the current values. You can use it so set the skills value to w/e. In this case 300.:
    Code:
                MBReadOnlyList<SkillObject> skillList = Game.Current.SkillList; // create a list with all skills
                foreach (SkillObject skills in skillList) // loop through the list
                {
                    Hero.MainHero.SetSkillValue(skills, 300); // set skill value for current skill
                    int cur_value = Hero.MainHero.GetSkillValue(skills); // get skill value (just for demo, as it's not used any further)
                }
  8. Stop the Conspiracy?

    From disassembling the dll's, I gather that the conspiracy quest will make all kingdoms declare war on the player kingdom, once the bar reaches 2000. It only goes up by 40 each time the stop conspiracy quest expires, so it will take some time before getting pwned
  9. Negative Influence after Policy in own Kingdom

    Indeed. Every proposed vote in your own kingdom ends up costing 149 influence and takes you up to 99 influence in the red, as the vote costs 50 and it only checks for 50 influence.
  10. Need More Info Castle Siege AI Break (repeatable)

    You can just spend half an hour and pop'em down with arrows or open the gate once you get bored :wink:
  11. You Shall Not Pass!

    Corbul said:
    Will this work with non-Native mods?

    Yes, it should work with any mod, for which you have the source code.

    Regardless of that, I haven't worked on this for 3 years, so all the previously mentioned bugs will unfortunately still occur...
  12. Modding Q&A [For Quick Questions and Answers]

    Somebody said:
    Code:
    (eq, pos1, pos5),
    will never work, it's a numerical comparison (so you're asking if 1 == 5). You need to do a distance check instead.
    It's possible to check positions are the same. Just need to get the x & y values for it:
    Code:
    (position_get_x, ":x_1", pos1),
    (position_get_y, ":y_1", pos1),
    (position_get_x, ":x_5", pos5),
    (position_get_y, ":y_5", pos5),
    (eq, ":x_1", ":x_5),
    (eq, "y_1, "y_5"),
  13. Fast edit-and-test cycle for modding?

    You can already do that. When you run warband in window mode, there are two options in the top left:
    File and Edit
    Under Edit select : Restore/reload module data
    It will load your new ms
  14. Modding Q&A [For Quick Questions and Answers]

    Thank you so much for the helpful response. Assigning reg0 to a local variable solved the issue  :party:


  15. Modding Q&A [For Quick Questions and Answers]

    I'm trying to write an Exodus script for a downgraded town, where some of the population turns into deserters, and some travel to nearby centers to make a living there.
    However, the faction is wrong, (commoners), and they just end up patrolling, instead of travelling to the center.
    The code is copied from spawning a village_farmers_party, so dunno why it doesn't work.

    Code:
    (store_script_param_1, ":source"),
            (store_faction_of_party, ":faction", ":source"),
    ###### Exodus begin ######
            # Spawn some deserters.
            (store_div, ":deserter_no", ":population", 100),
            # some inhabitants flee to nearby centers
    
            (val_sub, ":population", ":deserter_no"),
            (val_div, ":population", 3),
            (assign, ":max_dist", 50),
            (assign, ":total_deserters", 0),
            (set_spawn_radius, 0),
            (assign, ":end_cond", centers_end),
            (try_for_range, ":cur_center", centers_begin, ":end_cond"),
              (neq, ":cur_center", ":center_no"),
              (neq, ":cur_center", ":source"),
              (store_distance_to_party_from_party, ":cur_dist", ":source", ":cur_center"),
              (le, ":cur_dist", ":max_dist"),
              (try_begin),
                  (party_slot_eq, ":cur_center", slot_party_type, spt_town),
                  (store_random_in_range, ":deserter_no", 100, 200),
              (else_try),
                  (party_slot_eq, ":cur_center", slot_party_type, spt_castle),
                  (store_random_in_range, ":deserter_no", 30, 50),
              (else_try),
                  (party_slot_eq, ":cur_center", slot_party_type, spt_village),
                  (store_random_in_range, ":deserter_no", 20, 150),
              (try_end),
    
              (spawn_around_party, ":source", "pt_town_runaways"),
              (party_add_members, reg0, "trp_mercenary_e_townsman", ":deserter_no"),
             
              (party_set_flags, reg0, pf_default_behavior, 0), 
              (party_set_faction, reg0, ":faction"),
              (party_set_slot, reg0, slot_party_home_center, ":source"),
              (party_set_slot, reg0, slot_party_type, spt_town_runaway),
              (party_set_slot, reg0, slot_party_ai_state, spai_trading_with_town),
              (party_set_slot, reg0, slot_party_ai_object, ":cur_center"),
              (party_set_ai_behavior, reg0, ai_bhvr_travel_to_party),
              (party_set_ai_object, reg0, ":cur_center"),
                      
              (val_add, ":total_deserters", ":deserter_no"),
              (try_begin),
                (ge, ":total_deserters", ":population"),
                (assign, ":end_cond", ":cur_center"), #break
              (try_end),
            (try_end),
         
            ###### Exodus end ######
  16. Modding Q&A [For Quick Questions and Answers]

    That pasted code compiles fine.

    The error has to be elsewhere. There has to be some other code that you modified, and missed something like a "
  17. Modding Q&A [For Quick Questions and Answers]

    You messed up the code syntax somewhere.

    Would be helpful, if you post the one thing you changed.
  18. [WIP] Dynamic Settlements

    Unfortunately, I haven't reached a version, that's worth releasing yet. As I've definitely underestimated the work required to fully integrate this change into the game.

    Improving on the previously posted code, I got to a mostly bug-free version. However, after adding a construction phase, it was necessary to start from scratch, as the previous code did not allow for that and for some reason, the construction phase proved to be a nightmare. The current solution is to use a temp party on the global map for the construction site, give it a settlement icon & menu and only replace it with an actual settlement, once construction has been completed.

    Currently working:
    -build new village&castle (for player & AI)
    -advance village to town (currently only for AI)
    -downgrade town to village (happens automatically, when town has been hit hard by war)
    -destroy village (happens automatically, when village has been hit hard by war)
    -Quest to construct new settlement, given by village elder (slightly different requirements depending on region)
    -A settlement supporting construction of a new settlement will give for the duration all income towards the new settlement. So income from the settlement is disabled for the whole duration of construction (for player&AI)
    -New names are randomly chosen. There is a list of new settlement names included. The names are sorted into the following groups: forest, snow, desert, plain
    -New fiefs will get scenes appropriate to their region. Village, Castle & town scenes sorted into these region groups: snow, desert, others.
    -Dynamic trade routes updating to addition or removal of towns. (The trade routes are distance based, current limit is 125 ingame units)
    -New town upgrades, including horse stables, which increases max trade route distance, allowing for more and potentially more profitable trade routes

    Issues:
    -Not all villages are always visible on worldmap (some only show up when player is nearby)
    -Sometimes wrong font size is used
    -No scenes for construction site
    Bugtracker on redmine for some other stuff:
    http://dynamicworld.m.redmine.org/projects/dynamic-world/issues?set_filter=1&tracker_id=1

    However, the current holdup is the question on how to deal with villages&castles. I want to get rid of villages being tied to walled centers and replace it with a system, where:
    -Castles collect protection money of nearby castles
    -Villages do only transfer ownership based on relation. Not automatically, when a walled center gets captured
    -Villages can stand on their own, but will look for protection from nearby castles. If no same faction castle is nearby, the village will look for protection elsewhere and gain relation with the closest castle. Once a threshold is reached, it will accept the castles owner as its own
    -Player can raise relation with village like usual and have a new option to ask village to join his faction. (From 50-70 relation, there's a chance it works. Above that it always succeeds)

    This should allow for some more interesting decisions, such as building a castle deep in enemy territory near their villages to collect protection money from them.

    In any case, this last idea is not working as intended yet. Hopefully it will soon  :grin:
  19. Modding Q&A [For Quick Questions and Answers]

    When resting in a settlement, there's this message every night:

    Code:
    You pay for accomodation.
    You lost xx denar.

    I am trying to combine that info into a single line, however, I've been unable to find the second line anywhere.

    Edit:
    Is the message "You lost xx denar" really hardcoded?

    @kalarhan. Thank you for the previous answer. Had messed that up again.
  20. Modding Q&A [For Quick Questions and Answers]

    What can cause the following error?
    Code:
    Unrecognized opcode -2147483425.; LINE NO: 0: 
     At Simple trigger trigger no: 161. At Simple trigger trigger no: 161.

    Simple_triggers are numbered through. Accounting for the possibility of a slight numbering error, it has to be in one of the following simple_triggers:

    Code:
    #161
            (24 * 7, 
    		[
    		# Check temp parties 
    		(try_for_parties, ":party_no"),
    
    #162
    	(24,		#*14, 
    		[
    		(neg|check_quest_active, "qst_construct_settlement"),
    
    #163
     (24 * 7,
     	[
     	(try_for_range, ":cur_center", centers_begin, centers_end),
    
    #164
    (24, 
    	[
    	(try_for_parties, ":party_no"),
Back
Top Bottom