Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I need help in Mount & Blade Warband Version 1.153 the lords always leave there kingdoms so fast & join another Kingdom & that make game bad so is there any way to edit some thing to make them more loyalty for the lords ?!  :roll:
 
Cozur said:
Is it possible to force a lord from one of the kingdoms to always stay in his castle? To simulate stuff like disabilities or sloth?
Modify the scripts about lord decision ai. It's very possible, as I did it to make the lords not leaving the tournament town if they're still compete in the tournament.
djogloc02 said:
How do you tell to a guy to use the modify button?  :razz:
It's as hard as telling the guys to use search button or google. As The questions about always war and always peace between certain factions are here so many times.
Commando said:
I need help in Mount & Blade Warband Version 1.153 the lords always leave there kingdoms so fast & join another Kingdom & that make game bad so is there any way to edit some thing to make them more loyalty for the lords ?!  :roll:
If you read carefully module system files, you will find that certain lords are made having absolute loyal to their faction. Just do the same thing with some degrees of tolerance to another lords.
 
Dunde, have any idea about this?

grailknighthero said:
How does the game calculate the actual price of an item?  Let's say I have an item with a value of 2000.  The Buying price says it is 2988, the buy price factor from script_game_get_item_buy_price_factor is 180.  So how does the game put 2000 and the buy price factor of 180 together to get 2988?
 
Commando said:
I mean I don't want them to defects or treason & I want every faction vassals to be with them kingdom always

Code:
  #Auto-indictment or defection
  (try_begin), 
    (this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), 
    (eq, ":troop_no", trp_player),      
    (try_begin), 
      (eq, ":troop_no", trp_player), 
      (assign, ":faction", "$players_kingdom"), 
    (else_try), 
      (store_faction_of_troop, ":faction", ":troop_no"), 
    (try_end), 

    (faction_get_slot, ":faction_leader", ":faction", slot_faction_leader), 
    (neq, ":troop_no", ":faction_leader"), 
            
    #I don't know why these are necessary, but they appear to be
    (neg|is_between, ":troop_no", "trp_kingdom_1_lord", "trp_knight_1_1"), # Make new range or use series of (neq, ":troop_no", <<a 100% loyal lord id1>>), (neq, ":troop_no", <<a 100% loyal lord id2>>),  here
    (neg|is_between, ":troop_no", pretenders_begin, pretenders_end), 
            
    (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"), 
    (le, reg0, -50), #was -75

    (call_script, "script_cf_troop_can_intrigue", ":troop_no", 0), #Should include battle, prisoner, in a castle with others 
    (store_random_in_range, ":who_moves_first", 0, 2), 
            
    (try_begin), 
      (neq, ":who_moves_first", 0), 
      (neq, ":troop_no", trp_player), 
                
      #do a defection

grailknighthero said:
Dunde, have any idea about this?

grailknighthero said:
How does the game calculate the actual price of an item?  Let's say I have an item with a value of 2000.  The Buying price says it is 2988, the buy price factor from script_game_get_item_buy_price_factor is 180.  So how does the game put 2000 and the buy price factor of 180 together to get 2988?

Read script_get_trade_penalty. It applies your trading skill and your relation to the merchant's center to final price.
 
If there's one mystery I can't figure out with Mount and Blade, it's got to be this one.

How does the engine evaluate party strength and decides who chases whom on the map?
There are modsys-side scripts and (troop level based) calculations for party strength, but they are not hardcoded/callbacks and therefore usable by the engine (or are they?), so the engine has to have its own hidden formula. Aggressiveness and courage are applied as modifiers, but what determines base strength?
 
Got a couple more questions.

Been making a template for adding in lore-based NPC's, simply because I've run out of other stuff to do. Basically, the player can walk up to them, talk a bit, and then hear about events taking place.

So did this:

Code:
 #Lore begin
   [trp_sandor, "start", [(eq, "$g_talk_troop_met", 1)],
     "Hail and well met. I am Master Grazmak mo Senko, of the great city of Astapor, most favoured of the great Harpy, the jewel of the east and heir to the Ghiscari Empire!",
     "sandor_introduce_1", []],
   [trp_sandor|plyr, "sandor_introduce_1", [],
     "Greetings. Where is Astapor?", "sandor_introduce_2", []],
   [trp_sandor, "sandor_introduce_2", [],
     "Astapor lies in Slaver's Bay, close to the Isle of Cedars. The Good Masters, of whom I am amongst, deal with the most magnificent soldiers in the world, the Unsullied! Trained from childhood, they're the fiercest, most stalwart, most loyal soldiers in the world! None might stand before them! Being the barbarian that you are, I imagine that you are not familiar with the story of the Three Thousand of Qohor? Khal Temmo and his khalasar was defeated by three thousand Unsullied. Only four hundred remained at the end of the battle, but Khal Temmo was dead and so was all his sons and twelve thousand of his warriors!",
     "sandor_introduce_3", []],
   [trp_sandor|plyr, "sandor_introduce_3", [],
     "I see. You're selling slave soldiers. If they're really that good, why are they not part of every army in the world?",
     "sandor_introduce_4", []],
   [trp_sandor, "sandor_introduce_4", [],
     "Bah! Petty lords and knights, would-be kings and princes, filthy khals and greedy magisters, they do not understand warfare. They think any soldier is the same. The Unsullied training starts a age five and is from dawn to dusk. It is brutal, designed not only to teach them how to fight, but to strip away all individuality, empathy, and self-worth. Only one in three survive, and those that fail at any stage are killed. They are fully castrated - penis and testicles cut - and their manhoods burned at the altar of the Lady of Spears. They regularly consume an elixir called the Wine of Courage to deaden their sensitivity to pain. They will obey every command, even fall on their sword should you wish it.",
     "sandor_introduce_5", []],
   [trp_sandor|plyr, "sandor_introduce_5", [],
     "You have roused my interest Master Grazmak, what can you offer me?.",
     "sandor_introduce_6", []],
   [trp_sandor, "sandor_introduce_6", [],
     "Usually, we sell Unsullied by the century, so as to not split them up. They have a tendency to become fat and bloated. Keeping them together ensures that their discipline and fighting prowess keeps. However, I have heard worrying news from the east, talk of dragons and brimstones. So I am looking to settle down in this area and as such will only be able to sell Unsullied in small groups.",
     "sandor_master_talk", []],

   [trp_sandor|plyr, "sandor_master_talk", [], 
     "Can you tell me the history of Slaver's Bay?", "sandor_master_customize", []],
   [trp_sandor, "sandor_master_customize", [],
     "When the Doom came to Valyria, the ancient and proud cities of Astapor, Meereen and Yunkai rose once again to prominence. We deal in slaves, and it has made us rich and powerful. The Meereenese train slaves of all sorts, while the Yunkai specialize in bedslaves. In Astapor, we train the Unsullied, the heirs of the lockstep legions of Old Ghis. Further to the south, New Ghis claims to be the true heir to the Ghiscari Empire, but I say it is we, the masters of Astapor, who are the true descendants of Grazdan the Great!", "sandor_master_talk", []],
   [trp_sandor|plyr, "sandor_master_talk", [], 
     "Tell me your story again.", "sandor_introduce_2", []],
   [trp_sandor|plyr, "sandor_master_talk", [],
     "Goodbye.", "close_window", []],
#Crooks

Code:
#Sandor
["sandor", "Sandor Clegane", "Sandor Clegane", tf_hero|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield, scn_town_18_castle|entry(11), reserved, fac_kingdom_9, [itm_bo_vae_t3_leather,itm_crossbearer], def_attrib|level(5), wp(20), knows_common, 0x0000000ff70c700526736ccb2c30b71300000000001ed4ca0000000000000000 ],
##Companions

However, the second time I talk to the troop, I get this. The dialog works the first time, but not the second.

Think it's got something to do with this:

Code:
#Tavern Talk (with troops)

  [anyone, "start", [
                     (eq, "$talk_context", tc_tavern_talk),
					 (neg|troop_is_hero, "$g_talk_troop"),
                     (neg|is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
					 (assign, ":mercenary_amount", -1),
                     #(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
                     #(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
                     (try_begin),                                            #Extra mercenaries in tavern
						 (party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
						 (eq, "$g_talk_troop", ":mercenary_troop"),
						 (party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
                     (else_try),
						(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type_2),
						(eq, "$g_talk_troop", ":mercenary_troop"),
						(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount_2),
                     (try_end),                                              #Tavern end
                     (gt, ":mercenary_amount", 0),
                     (store_sub, reg3, ":mercenary_amount", 1),
                     (store_sub, reg4, reg3, 1),
                     (call_script, "script_game_get_join_cost", ":mercenary_troop"),
                     (assign, ":join_cost", reg0),
                     (store_mul, reg5, ":mercenary_amount", reg0),
                     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
                     (val_min, ":mercenary_amount", ":free_capacity"),
                     (store_troop_gold, ":cur_gold", "trp_player"),
                     (try_begin),
                       (gt, ":join_cost", 0),
                       (val_div, ":cur_gold", ":join_cost"),
                       (val_min, ":mercenary_amount", ":cur_gold"),
                     (try_end),
                     (assign, "$temp", ":mercenary_amount"),
                     ],
   "Do you have a need for sellswords, {sir/madam}?\
 {reg3?Me and {reg4?{reg3} of my mates:one of my mates} are:I am} looking for a master.\
 We'll join you for {reg5} denars.", "mercenary_tavern_talk", []],

  [anyone, "start", [
  (eq, "$talk_context", tc_tavern_talk),
  ],
   "Any orders?", "mercenary_after_recruited", []],

  [anyone|plyr, "mercenary_after_recruited", [],
   "Make your preparations. We'll be moving at dawn.", "mercenary_after_recruited_2", []],
  [anyone|plyr, "mercenary_after_recruited", [],
   "Take your time. We'll be staying in this town for a while.", "mercenary_after_recruited_2", []],

  [anyone, "mercenary_after_recruited_2", [], "Yes {sir/madam}. We'll be ready when you tell us to leave.", "close_window", []],

So basically, what I would like is being able to have a curt, short, response pop up the second time you talk to the troop, something along the lines of "**** off" or whatever, but being able to customize the dialog for every individual troop, and not have them reply like a regular soldier.
 
You're supposed to have another one linking to the conversation state sandor_master_talk for other values of $g_talk_troop_met. If you want another fallback dialog, do something like this

Code:
anyone, "start", [
  (troop_is_hero, "$g_talk_troop"),
  (eq, "$talk_context", tc_tavern_talk),
  ],
   "u wot m8?", "close_window", [(agent_play_sound, "$g_talk_agent", "snd_encounter_nobleman")]],
 
So Ive found myself another problem I cant find solution to. Im replacing trees on the worldmap, the ones for plains are ok (map_tree_a,map_tree_b...). I have brf with these, the names of them are the same as Native obviously and I comment out the line in module.ini that loads brf with Native trees so the objects dont collide (there are errors if the line remains uncommented). So far so good, trees are displayed correctly, there is randomness. Now I try to also load custom trees for other biomes (snow, steppe) and here goes trouble. None of the biome trees get used and there are only map_tree_a all over the place. Also sometimes, and this seems to be random, it throws error at me that it cannot find map steppe tree "name"  (this error pops up when trying to start a new game or load, not on startup. Also it doesnt crash the game like other missing object errors do, rather the models are just missing on the map)

Help pretty please?  :oops:
 
MadVader said:
If there's one mystery I can't figure out with Mount and Blade, it's got to be this one.

How does the engine evaluate party strength and decides who chases whom on the map?
There are modsys-side scripts and (troop level based) calculations for party strength, but they are not hardcoded/callbacks and therefore usable by the engine (or are they?), so the engine has to have its own hidden formula. Aggressiveness and courage are applied as modifiers, but what determines base strength?
As far as I know, that is what the engine uses. Back when I was working on Hiridia, I was able to override the party strength calculations and the aggressiveness of parties. Maybe there is some engine-side code but those scripts still effect the AI.
 
Are you saying that the engine calls script_party_calculate_strength? It's possible, but I think highly unlikely as it's not a callback like various script_game_xxx scripts.
 
Well my memory isn't the best and I don't have my module system at hand right now but I think that the engine calls that script somehow. However, it may be indirectly (through another script or trigger).
 
I think it's all done by engine, although we can make a trigger to loop certain parties calculate their own strength and parties they saw around by our calculation then force them to attack what we count as weaker by (party_set_ai_behavior, <party_id>,  ai_bhvr_attack_party),  and (party_set_ai_object, <party>, <our calculated weaker party>),  
 
I also think it's hidden in the engine... but how does it calculate party strength?
You can't really bypass it as you will hog the CPU while checking every party very often and overriding party behavior.
 
Sorry for (almost) doubleposting but I got one more question. Where does MnB take the snowy hilltop texture from? Cause its not the same snow it uses when you explicitly draw snow material on the map. I need to override it so it is the same texture as mountain = there is no snowy top even though the mountain is already in the height where the engine automaticaly makes it snowy. And please dont suggest moving the whole mesh down, thats what Im doing now and the problem is there appears some kind of fog if you zoom in all the way as the camera gets "under the sea level" (I dont know what it really is, but Im sure its because the camera is too low).

Thanks again
 
Hello,

I recently had a campaign map designed and I was wondering if any one had any tips for rotating it so the present northern region is south, basically rotating the map 180 degrees. Any tips would be much appreciated.

Thanks
 
Status
Not open for further replies.
Back
Top Bottom