Ironsights

From Mount&Blade Modding Wiki
Revision as of 19:23, 16 June 2011 by Wolfstar (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[edit] Ironsights for Multiplayer & Singleplayer

Coded by: doomsayer

Python File Used: Module_Mission_Templates.py

How to install:

1. Open Mission_templates.py

2. Search for: pilgrim_disguise = [itm_pilgrim_hood,itm_pilgrim_disguise,itm_practice_staff, itm_throwing_daggers]

af_castle_lord = af_override_horse | af_override_weapons| af_require_civilian

3. Paste the code (seen below) below the af_castle_lord line and then add the mission template shortcut into the mission template eg 'multiplayer_bt'

4. In-game hold shift to go into ironsights.

CODE:

singleplayer_ironsight_mode = (
 
0, 0, 0, [],
 
       [
 
         (get_player_agent_no, ":player_agent"),
 
#         (ge, ":player_agent", 0),
 
         (try_begin),
 
           (game_key_is_down, gk_view_char),
 
           (mission_cam_set_mode, 0),
 
         (else_try),
 
           (agent_get_wielded_item, ":player_item", ":player_agent", 0),
 
           (this_or_next|eq, ":player_item", "itm_tutorial_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_practice_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_hunting_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_light_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_heavy_crossbow"),
 
           (eq, ":player_item", "itm_sniper_crossbow"),
 
           (game_key_is_down, gk_zoom),
 
           (agent_get_look_position, pos1, ":player_agent"),
 
           (position_move_x, pos1, 7),
 
           (position_move_z, pos1, 40),
 
           (init_position, pos2),
 
           (init_position, pos3),
 
           (position_copy_rotation, pos3, pos1),
 
           (position_copy_rotation, pos1, pos2),
 
           (position_move_z, pos1, 127),
 
           (position_copy_rotation, pos1, pos3),
 
           (mission_cam_set_mode, 1),
 
#          whatever you do to zoom...
 
           (mission_cam_set_position, pos1),
 
           (mission_cam_set_aperture, 45),
 
         (else_try),
 
           (agent_get_wielded_item, ":player_item", ":player_agent", 0),
 
           (this_or_next|eq, ":player_item", "itm_tutorial_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_practice_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_hunting_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_light_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_heavy_crossbow"),
 
           (eq, ":player_item", "itm_sniper_crossbow"),
 
           (game_key_is_down, gk_attack),
 
           (agent_get_look_position, pos1, ":player_agent"),
 
           (position_move_x, pos1, 7),
 
           (position_move_z, pos1, 40),
 
           (init_position, pos2),
 
           (init_position, pos3),
 
           (position_copy_rotation, pos3, pos1),
 
           (position_copy_rotation, pos1, pos2),
 
           (position_move_z, pos1, 127),
 
           (position_copy_rotation, pos1, pos3),
 
           (mission_cam_set_mode, 1),
 
           (mission_cam_set_position, pos1),
 
         (else_try),
 
           (mission_cam_set_mode, 0),
 
         (try_end),
 
         ])
 
 
 
multiplayer_ironsight_mode = (
 
0, 0, 0, [],
 
       [
 
         (multiplayer_get_my_player, ":my_player_no"),
 
         (player_get_agent_id, ":player_agent", ":my_player_no"),
 
         (ge, ":player_agent", 0),
 
         (try_begin),
 
           (game_key_is_down, gk_view_char),
 
           (mission_cam_set_mode, 0),
 
         (else_try),
 
           (agent_get_wielded_item, ":player_item", ":player_agent", 0),
 
           (this_or_next|eq, ":player_item", "itm_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_heavy_crossbow"),
 
           (eq, ":player_item", "itm_sniper_crossbow"),
 
           (game_key_is_down, gk_zoom),
 
           (agent_get_look_position, pos1, ":player_agent"),
 
           (position_move_x, pos1, 7),
 
           (position_move_z, pos1, 40),
 
           (init_position, pos2),
 
           (init_position, pos3),
 
           (position_copy_rotation, pos3, pos1),
 
           (position_copy_rotation, pos1, pos2),
 
           (position_move_z, pos1, 127),
 
           (position_copy_rotation, pos1, pos3),
 
           (mission_cam_set_mode, 1),
 
#          whatever you do to zoom...
 
           (mission_cam_set_position, pos1),
 
           (mission_cam_set_aperture, 45),
 
         (else_try),
 
           (agent_get_wielded_item, ":player_item", ":player_agent", 0),
 
           (this_or_next|eq, ":player_item", "itm_crossbow"),
 
           (this_or_next|eq, ":player_item", "itm_heavy_crossbow"),
 
           (eq, ":player_item", "itm_sniper_crossbow"),
 
           (game_key_is_down, gk_attack),
 
           (agent_get_look_position, pos1, ":player_agent"),
 
           (position_move_x, pos1, 7),
 
           (position_move_z, pos1, 40),
 
           (init_position, pos2),
 
           (init_position, pos3),
 
           (position_copy_rotation, pos3, pos1),
 
           (position_copy_rotation, pos1, pos2),
 
           (position_move_z, pos1, 127),
 
           (position_copy_rotation, pos1, pos3),
 
           (mission_cam_set_mode, 1),
 
           (mission_cam_set_position, pos1),
 
         (else_try),
 
           (mission_cam_set_mode, 0),
 
         (try_end),
 
         ])

Wolf.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox