OSP Code QoL MB Warband - Helmet View

Users who are viewing this thread



Intro: vimeo.com/84855412

This is an example of the mechanism for changing helmet views. If a hero wearing a helmet and the player presses the [R]-first-person-view, its review is limited to cut the helmet.

zip: dropbox
ru-board: http://rusmnb.ru/index.php?topic=18535.0


FAQ:
ElPadrino said:
Nice but imagine player has any Helmet, he will see that ?
When pressing the [R]-key is checks, is there anything on the head .. If yes - the presentation starting. The code of the presentation check, what kind of helmet is weared and what kind of texture to load .. (Google translate)
=================
Sherlock Holmes said:
Interesting but I'm wondering can we draw and apply unique visors to different helmets?
You can add your own checking and textures.
# Checking what king of helmet player has equip
  (try_begin),
            (troop_has_item_equipped, "trp_player", "itm_black_helmet"), # if  black_helmet
            (create_mesh_overlay, reg0, "mesh_helmet_T_inside"),        # сreate Т-visor
  (else_try),
            (create_mesh_overlay, reg0, "mesh_helmet_inside"), # else - else
  (try_end),
 
Oh, well-thought and good work. However, I advise you to decorate the design. Looks odd.
 
Sherlock Holmes said:
Interesting but I'm wondering can we draw and apply unique visors to different helmets?

Possible since it is OSP anyway. Play around with the presentations.
 
Nice, reminds me of a script from HokieBT, if my memory serves me right he did something similar. There is a small issue though, if you enter a battle in first person camera, once you click "R" for third person the presentation will start, I guess I will map it to the "H" key or something like that so the player decides when to use it, be it first or third person, unless there is a way to detect which camera "stance" is on.
 
Thank you !  :grin:

gcKfO.jpg
N-Xh0.jpg
7TRt4.jpg
KQDih.jpg

I've added a sound

module_presentations

  ("helmet_view", prsntf_read_only|prsntf_manual_end_only, 0, [
    (ti_on_presentation_load,
    [(set_fixed_point_multiplier, 1000),
     
  #
  (try_begin),
     
(this_or_next|troop_has_item_equipped, "trp_player", "itm_hounskull"), #
(this_or_next|troop_has_item_equipped, "trp_player", "itm_bb_hounskull_bp"), #
(troop_has_item_equipped, "trp_player", "itm_pigface_klappvisor"), #
        (create_mesh_overlay, reg0, "mesh_helmet_inside"),
      (play_sound, "snd_helm_down"),#
  (else_try),
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_bb_armet"), #
(this_or_next|troop_has_item_equipped, "trp_player", "itm_bb_armet2"), #
(this_or_next|troop_has_item_equipped, "trp_player", "itm_bb_massivehelm_bp"), #
            (troop_has_item_equipped, "trp_player", "itm_new_helmet_tournament_blue_1"), #
        (create_mesh_overlay, reg0, "mesh_helmet_T_inside"),
      (play_sound, "snd_helm_down"),
      (else_try),#
          (create_mesh_overlay, reg0, "mesh_helmet_invisible"),   
  (try_end),
     
      (position_set_x, pos1, 0), #
      (position_set_y, pos1, 0),
      (overlay_set_position, reg0, pos1),
      (position_set_x, pos2, 1020), #
      (position_set_y, pos2, 76:cool:, #
      (overlay_set_size, reg0, pos2), #
     
      (presentation_set_duration, 999999),
      ]),
   
    ]),
 
Hmpf! :razz: Have been looking for such a modification for a loooong time.. love it.. just I'm not experienced with M&B modding, so I can't manage to get it to work :razz: Could someone explain to me in some steps how to "install / activate" it?

I've placed most of the files in the according directories of the mod I'm currently playing, but I don't know what to do with the python files that execute the commands for the view modification... So if someone could explain to me what to do with the content of the zip here, I would very much appreciate :wink: Thanks!
 
Lord Kensington said:
Hmpf! :razz: Have been looking for such a modification for a loooong time.. love it.. just I'm not experienced with M&B modding, so I can't manage to get it to work :razz: Could someone explain to me in some steps how to "install / activate" it?

I've placed most of the files in the according directories of the mod I'm currently playing, but I don't know what to do with the python files that execute the commands for the view modification... So if someone could explain to me what to do with the content of the zip here, I would very much appreciate :wink: Thanks!

How to install modmerge-pack
 
I deleted the code for I couldnt make it work. So i dont have any screens right now.

The problem was with the mission templates, the code doesnt seem to work because of the syntax > = . Not really sure why that happens.
 
Try getting rid of all the comments (pieces of text starting with hash marks that explain the code) in Cyrilic and the ones looking like <======== to the right of these lines of code.
 
Dusk Voyager said:
Try getting rid of all the comments (pieces of text starting with hash marks that explain the code) in Cyrilic and the ones looking like <======== to the right of these lines of code.

Cyrilic was the problem thank you, i never thought that would be the problem.  :roll:
 
Hi guys I have some trouble with this code, I've successfully implemented the feature to my mod but I couldnt make it work for multiple helmets. I mean I want to make helmet view for several other helmets with different visors each but only the first 2 part of the code (mesh) works and the rest is (the other 4 meshes) not working, it applies the first code for the rest of the helmets in the mod no matter they have visors or not, it simply ignores the other parts of the code. Any help would be great. My code :



Presentations.py
Code:
  ("helmet_view", prsntf_read_only|prsntf_manual_end_only, 0, [
    (ti_on_presentation_load,
     [(set_fixed_point_multiplier, 1000),
      
	  
	  (try_begin),
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_2visoredsugar"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_1visoredsugar"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_hadvog_sallet_visor3"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_hadvog_sallet_visor2"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_hadvog_sallet_visor"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_hadvog_sallet_visor_open"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_hadvog_sallet_visor_open2"), # 
      (troop_has_item_equipped, "trp_player", "itm_hadvog_sallet_visor_open3"), #
       (create_mesh_overlay, reg0, "mesh_helmet_sugar"),
	  (else_try),	  
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_lyle_bascinet_gilded"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_lyle_bascinet_gilded_open"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_lyle_bascinet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_great_bascinet_open"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_great_bascinet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_pigface_klappvisor_open"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_pigface_klappvisor"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_great_helmet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_black_helmet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_hounskull_black"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_hounskull_bascinet"), # 
      (troop_has_item_equipped, "trp_player", "itm_winged_great_helmet"), #
       (create_mesh_overlay, reg0, "mesh_helmet_T_inside"),
	  (else_try),
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_1zitta_bascinet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_2zitta_bascinet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_3zitta_bascinet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_4zitta_bascinet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_5zitta_bascinet"), # 
      (troop_has_item_equipped, "trp_player", "itm_6zitta_bascinet"),
       (create_mesh_overlay, reg0, "mesh_helmet_T_inside2"),
	  (else_try),
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_2greatbascinet2"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_klappvisier5"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_greatbascinet2"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_greatbascinet3"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_greatbascinet4"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_greatbascinet5"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_greatbascinet6"), # 
      (troop_has_item_equipped, "trp_player", "itm_greatbascinet7"), #
       (create_mesh_overlay, reg0, "mesh_helmet_inside5"),
	  (else_try),	  
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_clsbas"), # 
      (troop_has_item_equipped, "trp_player", "itm_openbas"), #
       (create_mesh_overlay, reg0, "mesh_helmet_inside0"),	  
	  (else_try),	
	
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_polovtsian_helmet"), # 
      (this_or_next|troop_has_item_equipped, "trp_player", "itm_nikloskoe_helmet_warrior"), # 
      (troop_has_item_equipped, "trp_player", "itm_seljuk_helmet"), #
       (create_mesh_overlay, reg0, "mesh_helmet_b"),

	  (try_end),
      
      (position_set_x, pos1, 0), 
      (position_set_y, pos1, 0),
      (overlay_set_position, reg0, pos1),
      (position_set_x, pos2, 1020), 
      (position_set_y, pos2, 768), 
      (overlay_set_size, reg0, pos2), 
      
      (presentation_set_duration, 999999),
      ]),
    
    ]),

meshes.py
Code:
##helmetview
 ("helmet_inside", 0, "helmet_inside", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_T_inside", 0, "helmet_T_inside", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_rus_inside", 0, "helmet_rus_inside", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_inside5", 0, "helmet_inside5", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_T_inside11", 0, "helmet_T_inside11", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_inside0", 0, "helmet_inside0", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_T_inside2", 0, "helmet_T_inside2", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_b", 0, "helmet_b", 0, 0, 0, 0, 0, 0, 1, 1, 1),
 ("helmet_sugar", 0, "helmet_sugar", 0, 0, 0, 0, 0, 0, 1, 1, 1),




mission_templates

Code:
show_hide_helmet_view = (
    0, 0, 0, [(key_clicked, key_t)],
    [
	  (try_begin),
	    (neg|is_presentation_active, "prsnt_helmet_view"), 
		(troop_get_inventory_slot, ":cur_helmet", "trp_player", 4), 
		(try_begin),
		  (ge, ":cur_helmet", 0),
		  (start_presentation, "prsnt_helmet_view"), 
		(try_end),
	  (try_end),
	  (presentation_set_duration, 0), 
      ])

 
Back
Top Bottom