• Please note that we've updated the Mount & Blade II: Bannerlord save file system which requires you to take certain steps in order for your save files to be compatible with e1.7.1 and any later updates. You can find the instructions here.

Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.

Dawiduh

Squire
WB
dunde said:
Dawiduh said:
The banners are mocking me once again  :smile:

I have added a new type of world map banner that looks like this: http://davidstancu.com/pics/logo/fremen_sietch/mb20.jpg.

But when I look in the Notes tab at the character it looks like this: http://davidstancu.com/pics/logo/fremen_sietch/mb19.jpg

So I have a problem here. It was supposed tot use the banner's texture but it uses something another one as if the my texture is missing.

Any ideas?

Check "script_add_troop_to_cur_tableau_for_profile" or "script_add_troop_to_cur_tableau". You should adjust them according to your modification to banners.

I looked in those two and actually just script_add_troop_to_cur_tableau_for_profile messes with that banner. Following Caba'drin's earlier advice I looked in module_constants.py and discovered I forgot to add my new banner mesh inside the normal banner list in module_meshes/py, and the engine assigned the same random banner to everyone.

Now that I added the reference in, the banner disappears completely from the profile. I wonder if I can assign those manually also...
 

dunde

Count
WB
Dawiduh said:
Now that I added the reference in, the banner disappears completely from the profile. I wonder if I can assign those manually also...
I experienced the same trouble once I built custom banners. Well, as standard banners have no heraldic part, it's just mesh so, it can be put into the tableau, but as we have banners with heraldics, we can't do it anymore.
My trick was creating a dummy heraldic weapon with banner mesh to be carried by the character displayed on the tableau.
Code:
["banner_background1","Banner", [("background_banner_01",0)],itp_type_polearm|itp_offset_lance|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_parry_polearm|itcf_carry_sword_back,9, weight(3.5)|spd_rtng(120) | weapon_length(115)|swing_damage(0,blunt) | thrust_damage(0,blunt),imodbits_none,
 [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_custom_banner_default", ":agent_no", ":troop_no")])]],  
["banner_background2","Banner", [("background_banner_02",0)],itp_type_polearm|itp_offset_lance|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_parry_polearm|itcf_carry_sword_back,9, weight(3.5)|spd_rtng(120) | weapon_length(115)|swing_damage(0,blunt) | thrust_damage(0,blunt),imodbits_none,
 [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_custom_banner_default", ":agent_no", ":troop_no")])]],  
["banner_background3","Banner", [("background_banner_03",0)],itp_type_polearm|itp_offset_lance|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_parry_polearm|itcf_carry_sword_back,9, weight(3.5)|spd_rtng(120) | weapon_length(115)|swing_damage(0,blunt) | thrust_damage(0,blunt),imodbits_none,
 [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_custom_banner_default", ":agent_no", ":troop_no")])]], 
 

Azrooh

Baron
Tried just about everything, but maybe there's something I'm missing. Is there any way to change the player's vertical rotation in multiplayer?
 

dia151

Knight at Arms
M&BWBWF&SNWVC
Where is the part of the code that assigns trade routes between towns? I know I've seen it, but i cant remember it and dont know what to search for.

And also, where is the part where I can remove those "Join a caravan to Shariz" options at the beginning of a new game?
 

Dawiduh

Squire
WB
The caravans are in module_scripts.py  - initialize_trade_routes.

The join a caravan to Shariz is in module_game_menus.py, you'll just have to scroll down a bit.
 

Andrews

Sergeant
WB
Lav said:
Andrews said:
Anyone know where is the code (toople) that places a small image that indicates the type of death that had a player in multiplayer game?
As far as I know this message is hardcoded. Those icons aren't even referenced anywhere in the Module System.

are you sure that? you can not work with it?  :cry:
 

Caba`drin

Count
M&BWBWF&SNWVC
They are hardcoded. You can change the image or use the images elsewhere, but otherwise, their display in MP is handled by the engine.
 

Bravo2255

Knight at Arms
WBNW
Is there any good Coding tutorials, I want to get more familiar. I would like to learn where to make a button, activate something. Animations, and such.


I want to add a code, where the guy, fixes a bayonet, and it will load another mesh, with a bayonet on the musket. Can someone help me?
 

Lumos

Archduke
WBWF&SNWM&BVC
Bayonet attaching/detaching animations exist even in Warband (at least in the code, I've never checked them out). Use itp_has_bayonet on your item to allow attaching/detaching a bayonet on it. After that, I think you should just treat it as itp_next_item_as_melee. Not sure though.
 

Swyter

Grandmaster Knight
M&BWBWF&S
Bravo2255 said:
Is there any good Coding tutorials, I want to get more familiar. I would like to learn where to make a button, activate something. Animations, and such.


I want to add a code, where the guy, fixes a bayonet, and it will load another mesh, with a bayonet on the musket. Can someone help me?

Ehm, just a comment, your signature is horrifying me.
May I ask you politely to not put that kind of images on here? I would call that more than rude.

If you think that's funny we've a problem.

itW5r.gif

 

Andrews

Sergeant
WB
Caba`drin said:
They are hardcoded. You can change the image or use the images elsewhere, but otherwise, their display in MP is handled by the engine.

I see... it was an alternative way to reach the recognition of body hit strike zone
 

cmpxchg8b

Count
M&BWBWF&SNW
Caba`drin said:
They are hardcoded. You can change the image or use the images elsewhere, but otherwise, their display in MP is handled by the engine.
You can also customize the image for specific weapons.
Code:
def custom_kill_info(x): # you have to add ico_custom_x (where x is a number between 1 and 7) mesh in order to display it correctly.
  return (((bignum | x) & (itp_kill_info_mask >> itp_kill_info_bits)) << itp_kill_info_bits)
 

dunde

Count
WB
Is there any way to make the boots obey skf_use_morph_key_## ?
I have a problem with reskeletonized armors. There're gaps between them with the boots as the boots seems like always take frame 0.
 

Bravo2255

Knight at Arms
WBNW
Lumos said:
Bayonet attaching/detaching animations exist even in Warband (at least in the code, I've never checked them out). Use itp_has_bayonet on your item to allow attaching/detaching a bayonet on it. After that, I think you should just treat it as itp_next_item_as_melee. Not sure though.

No, I mean, where the musket, has no bayonet, and then, it will load a mesh with the bayonet. I want it, where you press "b", it will switch the mesh. Something like this.

Also, where would "Server Events" be placed?

 
Code:
#bayonet
         (0, 0, 3, [(key_clicked, key_b),
    ], [
        
         (multiplayer_get_my_player, ":playernum"),
         (player_get_agent_id, ":agentnum", ":playernum"),
         (agent_get_wielded_item, ":rifle",":agentnum"),
         (assign,":val",1),
        

     #infantry_musket to bayonet
         (try_begin),
         (eq, ":rifle", "itm_infantry_musket"),
         (assign,":val",1),
         (multiplayer_get_my_player,":player"),
         (assign,"$g_in_crouch",0),

Swyter said:
Bravo2255 said:
Is there any good Coding tutorials, I want to get more familiar. I would like to learn where to make a button, activate something. Animations, and such.


I want to add a code, where the guy, fixes a bayonet, and it will load another mesh, with a bayonet on the musket. Can someone help me?

Ehm, just a comment, your signature is horrifying me.
May I ask you politely to not put that kind of images on here? I would call that more than rude.

If you think that's funny we've a problem.

itW5r.gif

I do not see how this is offensive? I will remove it, if I get to many negative sayings, but people send me messages, laughing..

Anyway, I came here for help, not insults.
 

cmpxchg8b

Count
M&BWBWF&SNW
dunde said:
Is there any way to make the boots obey skf_use_morph_key_## ?
I have a problem with reskeletonized armors. There're gaps between them with the boots as the boots seems like always take frame 0.
No, morph works only on body armors (boots and helmet only with WSE).
 

dunde

Count
WB
Thanks again. I tested again with WSE and it works. It's look that I miss these :
cmpxchg8b said:
v2.8.0
- Fixed try_for_dict_keys and position_align_to_ground crashing the game under certain circumstances
- Fixed send_message_to_url_advanced calling the script with wrong parameters
- Added female frame support for boots
- Added operations prop_instance_set_vertex_keys_time_point, party_heal_members, process_advanced_url_messages, sleep_ms, player_set_banner_id

 

SnRolls

Sergeant at Arms
WB
SnRolls said:
Caba`drin said:
SnRolls said:
I saw that bro... where do i call the script?
and the registers contains the values i get from the php page?
Scripts that begin with "game_*" indicate that they are called from the engine at need. So long as you use the operation that I and now Lav have pointed out to you to send the message to your website--and do whatever you need to do with it on the website--the game will fire the script_game_receive_url_response whenever it receives a message from that website. Edit that script as you need to to deal with the information that is being returned to you.

You will then use store_script_param_1 to get the number of integers returned, so the script knows how many registers are full of numbers (starting at reg0) and then store_script_param_2 to get the numbers of strings returned (starting at s0), all as indicated by the comments in the script.

Belendor said:
I somehow need to clear the position just like "str_clear"
(init_position, <pos>) sets everything to 0s.
Thanks, i got it.
Now, i have some questions,
First, i tried to look for those in header_operations.py but didnt found them.
1.If there is an operation to get player_id by his character name, what is the operation?
2.How can i change a troop equips only for player(choosed by player_id) and check first if he choosed that troop?
Thank you very much.
:???:
 

Dawiduh

Squire
WB
TOTALLY OFF TOPIC

Bravo2255 said:
Swyter said:
Bravo2255 said:
Is there any good Coding tutorials, I want to get more familiar. I would like to learn where to make a button, activate something. Animations, and such.


I want to add a code, where the guy, fixes a bayonet, and it will load another mesh, with a bayonet on the musket. Can someone help me?

Ehm, just a comment, your signature is horrifying me.
May I ask you politely to not put that kind of images on here? I would call that more than rude.

If you think that's funny we've a problem.

itW5r.gif

I do not see how this is offensive? I will remove it, if I get to many negative sayings, but people send me messages, laughing..

Anyway, I came here for help, not insults.

I always thought you posted that animation as a critique or as a statement, not for fun. Seriously, someone getting a kick in the face from some uniformed guy is not exactly funny. And even if you think it is (you're free to) some other people might not.

Also, Swyter did not insult you. He sounded demanding but that was not an insult.

From my point of view I would disable all picture signatures because in the case of GIFs it might take a while to load up and also makes the whole page too vertically spread out. I have to scroll like crazy through posts containing 1 line of text 8-10 pixels high but having 3-4 lines of text and a big image as a signature. It is really annoying (for me).
 
My problem is in the module system.

I created script from the villages monasteries. My problem is that I do not get to recruit from the menu. I'm with the help of a friend 'get this code. Unfortunately this does not quite work. Why this error message.

begins on line 8968

module_game_menus.py


("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
#monastery begin
    ("recruit_volunteers",[(call_script, "script_cf_village_recruit_volunteers_cond"),]
          ,"Recruit Volunteers.",
        [
        (try_begin),
          (call_script, "script_cf_enter_center_location_bandit_check"),
          (else_try),
        (is_between, ":party_id", "p_start", "p_end"),
          (jump_to_menu, "mnu_recruit_volunteers"),
        (try_end),
        ]),
        #monastery end
      ],
      "Recruit them ({reg6} denars).",



error message

Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
Traceback (most recent call last):
  File "process_game_menus.py", line 47, in <module>
    save_game_menus(variables,variable_uses,tag_uses,quick_strings)
  File "process_game_menus.py", line 31, in save_game_menus
    save_game_menu_item(ofile,variable_list,variable_uses,menu_item,tag_uses,qui
ck_strings)
  File "process_game_menus.py", line 12, in save_game_menu_item
    save_statement_block(ofile,0, 1, menu_item[1], variable_list, variable_uses,
tag_uses,quick_strings)
  File "C:\Programme\Steam\SteamApps\common\mountblade warband\Modules\Module Sy
stem\src\process_operations.py", line 451, in save_statement_block
    save_statement(ofile,opcode,no_variables,statement,variable_list,variable_us
es,local_vars, local_var_uses,tag_uses,quick_strings)
  File "C:\Programme\Steam\SteamApps\common\mountblade warband\Modules\Module Sy
stem\src\process_operations.py", line 400, in save_statement
    ofile.write("%d %d "%(opcode, lenstatement))
TypeError: %d format: a number is required, not str
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Imported 56 global variables for saved-game compatability that are not used.
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .



I could help someone solve the problem what would be the correct code to remove the recruitment from the menu of the monasteries.

Thanks in advance Vikings




In german:

Mein problem ist im module system.

Ich habe aus dem Dörfer skript Klöster erschaffen. Mein problem ist das ich die Rekrutierung nicht aus dem Menü heraus bekomme. Ich hab mit hilfe eines freundes diesen code bekommen. Leider funktioniert dieser nicht ganz. Es kommt zu dieser Fehlermeldung.

Könnte mir da jemand helfen das problem zu lösen was der richtige code wäre um die Rekrutierung aus dem Menü der Klöster zu entfernen.

Danke vorab Vikinger
 

Lumos

Archduke
WBWF&SNWM&BVC
Bravo2255 said:
No, I mean, where the musket, has no bayonet, and then, it will load a mesh with the bayonet. I want it, where you press "b", it will switch the mesh.
Have you tried the itp_has_bayonet flag? You did, and you're certain it does not allow changing meshes?
Seems logical to me that if you're using it, you: Press X, your char sticks a bayonet on his rifle, and now you have a rifle with a bayonet. Or, you press X, you remove the bayonet from it and now you have a bayonetless rifle.
Don't go doing triggers when you could use ready-made stuff. Of course, I haven't tested that, so it's up to you to check it.

Good work on removing your siggie, btw. :wink:
 
Status
Not open for further replies.
Top Bottom