OSP Code MP Open/Close Helmet

Users who are viewing this thread

Woelfie

Master Knight
So.. I was just returning to Warband for a day and decided to start giving back to the community a little after all the help I've had. So let's begin.

First of all I saw [kit][OSP]open/close helmet and took inspiration from it so here's my multiplayer version. I have tested it and it works but its in a very basic state.

Code:
helmet_visors = ( #decide what equipment the troops get
 0, 0, 0, [(key_clicked, key_q)], 
 [
   (store_trigger_param_1, ":agent_id"),
   (multiplayer_get_my_player, ":player"), # Get player info
   #(multiplayer_get_my_troop, ":trooptype"), #Incase you want to do it only for certain troops
   (player_get_agent_id, ":agent_id", ":player"), # Get agent ID of player
   (agent_get_item_slot,":item_needed",":agent_id",4), # Get item slot for head
   (try_begin),
    # (eq, ":trooptype", "trp_scottish_royal_knight"), # If you want to use it for more han 1 use this_or_next
	(try_begin),
     (eq, ":item_needed", "itm_pigface_klappvisor_open"), # Make sure agent has this item
     (call_script, "script_agent_equip_sync_multiplayer", ":agent_id", "itm_pigface_klappvisor"),#Use script to change helmet
	(else_try),
	 (eq, ":item_needed", "itm_pigface_klappvisor"), # Make sure agent has this item
     (call_script, "script_agent_equip_sync_multiplayer", ":agent_id", "itm_pigface_klappvisor_open"),#Use script to change helmet
	(else_try),
	 (display_message, "@Your helmet has no visor!"), # Display message for player trying to change helemt
    (try_end),
  (try_end),    
 ])

The above can also be changed for armours, boots (say if you wanted to put spurs on) and gloves.

Code:
("agent_equip_sync_multiplayer",
   [(store_script_param, ":agent_id", 1),
    (store_script_param, ":item_id", 2),

    (try_begin),
      (agent_is_active, ":agent_id"),
      (agent_is_alive, ":agent_id"),
      (agent_equip_item, ":agent_id", ":item_id"),
      (get_max_players, ":max_players"),
      (try_for_range, ":other_player_id", 1, ":max_players"),
        (player_is_active, ":other_player_id"),
        (multiplayer_send_2_int_to_player, ":other_player_id", multiplayer_event_agent_equip_sync, ":agent_id", ":item_id"),
      (try_end),
    (try_end),
    ]),

Code:
multiplayer_event_agent_equip_sync                            = 113

The above could be changed to do a lot of different things, It just depends on the person using it. I will say this from experience: You learn nothing from copying and pasting so if you're new and copying this then try and experiment with it! :smile:. For example you could try and get Vertex anims to work with it for the visors or add a mesh to your screen for eye holes (similar to WoTR).

My Thanks to:
Ikaguia - Inspiration.
Specialist - Helping me with a mod a long time ago and the many discussions we've had.

P.S. I'll get this moved to OSP as soon as possible!

Wolf.
 
Not work :sad:

This is my module_mission_templates script:
Code:
helmet_visors = ( #decide what equipment the troops get
 0, 0, 0, [(key_clicked, key_o)], 
 [
   (store_trigger_param_1, ":agent_id"),
   (multiplayer_get_my_player, ":player"), # Get player info
   (multiplayer_get_my_troop, ":trooptype"), #Incase you want to do it only for certain troops
   (player_get_agent_id, ":agent_id", ":player"), # Get agent ID of player
   (agent_get_item_slot,":item_needed",":agent_id",4), # Get item slot for head
   (try_begin),
     (eq, ":trooptype", "trp_swadian_man_at_arms"), # If you want to use it for more han 1 use this_or_next
	(try_begin),
     (eq, ":item_needed", "itm_arming_cap"), # Make sure agent has this item
     (call_script, "script_agent_equip_sync_multiplayer", ":agent_id", "itm_norman_helmet"),#Use script to change helmet
	(else_try),
	 (eq, ":item_needed", "itm_norman_helmet"), # Make sure agent has this item
     (call_script, "script_agent_equip_sync_multiplayer", ":agent_id", "itm_arming_cap"),#Use script to change helmet
	(else_try),
	 (display_message, "@Your helmet has no visor!"), # Display message for player trying to change helemt
    (try_end),
  (try_end),    
 ])
 
Back
Top Bottom