搜索结果: *

  1. How to Set Lord Personalities (M&B:W)

    Considering your list of lords is in order, exactly as it appears in module_troops.py, without skipping any lords in between, you could use a loop to make the code shorter.
    Python:
    (store_add,":list_end",trp_knight_1_20,1),
    (try_for_range,":lord","trp_knight_1_1",":list_end"),
        (troop_set_slot,":lord",slot_lord_reputation_type,lrep_upstanding),
    (try_end),
    Variable ":list_end: is the last entry that loop will not reach, so it's your last troop on the list + 1 (that's why we do store_add +1 on it)
    Loop goes through your list of lords, and on each repetition the current lord is stored to the variable ":lord" that we provided.
    Then we just use 1 command, and executing it on ":lord". Because The loop puts 1 lord at a time into that variable and continues doing so until the end of the list, we only write 1 command, but it gets executed for all lords that get put into ":lord" by the loop.

    Good luck with future coding! Loops are your friends :smile:

    Also, you may wanna look into script "initialize_aristocracy" - that's where the game sets the lord personalities and other aristocracy related stuff.
    The easiest solution would be to just insert your code at the bottom of that script in module_scripts.py.
    So just look for "initialize_trade_routes" and go a bit up to the previous script block and that's where you want your code.
    Keep in mind that according to my best knowledge this script is called only once, when new game is started.
    But so is initialize_npcs, so you need to start a new game for this to appear in your game anyway.
    Thanks for the refinement info! I can see how putting this kind of code under initialize aristocracy would be much more logical. The loop thing makes sense and would work for a faction with the same reputation. I ended up doing that for one faction, but I still wanted some variation in the other factions, even if they lean one way or another. I shall continue trying to understand loops, and thanks for the encouragement!
  2. Introduction/Hello thread

    Hi there! Liked the game's mechanics, so I wanted to slap one of my favorite game worlds into it. I've never modded before, but have learned soooo much from this website. What a goldmine!

    I created this account so I could submit one of my own successful experiments with changing the code. Just a small thing, but I couldn't find it elsewhere.

    Otherwise, I'm just an internet traveler who wanted to express gratitude. Y'all are great!
  3. How to Set Lord Personalities (M&B:W)

    Hello! New modder here. I was looking for how to set Lord personalities definitively in my mod, via modulesystem. I wanted to use different behaviors as reflective of different factions' overall behavior. I.E., Faction 1's general culture is more aggressive and militant than other factions: set...
后退
顶部 底部