OSP Code Combat Deployable Pavise Shield (Multiplayer 6/6/2010)

Users who are viewing this thread

The code at 1st post is agent based. It's possible to make it work for any agents. The hard part is to make the ai agents ability to determine if they need to deploy their shield or not.

Is there any way to make if we 're close enough to the deployed pavise, the info window 's pop up will display 'deployed pavise shield' instead of 'destructable object' ?
 
dunde said:
The code at 1st post is agent based. It's possible to make it work for any agents. The hard part is to make the ai agents ability to determine if they need to deploy their shield or not.
Fair enough.

dunde said:
Is there any way to make if we 're close enough to the deployed pavise, the info window 's pop up will display 'deployed pavise shield' instead of 'destructable object' ?
I believe it can be overridden in the script "game_get_use_string".
 
Dawg of War said:
Life_Erikson said:
Dawg of War said:
I'm trying to figure out a heraldic version of this, so far i got the heraldic tableau mesh to work on the shield but as soon as you plant it the texture turns transparent. I'll continue working this out but if anyone has any suggestions let me know!

You need to take the heraldic shields script in the module_items.py text for it. Otherwise it will show up like that.

You need:
Code:
["pavise", "Pavise Shield",   [("tableau_shield_pavise_1" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield,
 [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_1", ":agent_no", ":troop_no")])]],

Instead of:
Code:
["pavise", "Pavise Shield",   [("pavise_wep" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield ],


And I still have the same problem with dropping the pavise. Could somebody please help me?

Yea that's what I have done from the beginning, but thanks for the feedback!

Also that is very odd about the problems you are having with the pavise, I have used both versions of those scripts and they both worked fine. Hows the resource file look? module scene props?  Hope you get it figured out.

I managed to use heraldic pavise shields. All you need is to call cur_scene_prop_set_tableau_material inside ti_on_init_scene_prop


Uploaded with ImageShack.us
 
dunde said:
Dawg of War said:
Life_Erikson said:
Dawg of War said:
I'm trying to figure out a heraldic version of this, so far i got the heraldic tableau mesh to work on the shield but as soon as you plant it the texture turns transparent. I'll continue working this out but if anyone has any suggestions let me know!

You need to take the heraldic shields script in the module_items.py text for it. Otherwise it will show up like that.

You need:
Code:
["pavise", "Pavise Shield",   [("tableau_shield_pavise_1" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield,
 [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_1", ":agent_no", ":troop_no")])]],

Instead of:
Code:
["pavise", "Pavise Shield",   [("pavise_wep" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield ],


And I still have the same problem with dropping the pavise. Could somebody please help me?

Yea that's what I have done from the beginning, but thanks for the feedback!

Also that is very odd about the problems you are having with the pavise, I have used both versions of those scripts and they both worked fine. Hows the resource file look? module scene props?  Hope you get it figured out.

I managed to use heraldic pavise shields. All you need is to call cur_scene_prop_set_tableau_material inside ti_on_init_scene_prop


Uploaded with ImageShack.us

AHAA! You the man!!!  I was working on this for a while then got distracted to other things, so thats all that was missing eh?
 
dunde said:
Dawg of War said:
Life_Erikson said:
Dawg of War said:
I'm trying to figure out a heraldic version of this, so far i got the heraldic tableau mesh to work on the shield but as soon as you plant it the texture turns transparent. I'll continue working this out but if anyone has any suggestions let me know!

You need to take the heraldic shields script in the module_items.py text for it. Otherwise it will show up like that.

You need:
Code:
["pavise", "Pavise Shield",   [("tableau_shield_pavise_1" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield,
 [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_1", ":agent_no", ":troop_no")])]],

Instead of:
Code:
["pavise", "Pavise Shield",   [("pavise_wep" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield ],


And I still have the same problem with dropping the pavise. Could somebody please help me?

Yea that's what I have done from the beginning, but thanks for the feedback!

Also that is very odd about the problems you are having with the pavise, I have used both versions of those scripts and they both worked fine. Hows the resource file look? module scene props?  Hope you get it figured out.

I managed to use heraldic pavise shields. All you need is to call cur_scene_prop_set_tableau_material inside ti_on_init_scene_prop


Uploaded with ImageShack.us

Can you give the code together with the AI?
 
Unfortunate double-post, but a small hopefully useful bump with thanks to Carthread for this system, models, etc.

In creating the system used in PBOD (by way of the Warband Script Enhancer's new operations) to allow player and AI deployment and recovery of shields, I created some basic props from Native's pavise meshes to allow for Native pavise shields to be deployed and displayed with their tableaus. These are just the native meshes, repositioned to the ground, tilted, and with Carthread's deployed pavise mesh's "stand legs" to prop them up. With LODs and collision meshes. Thought they might be useful to some without needing to dig through my mod's files:

http://www.mediafire.com/file/482xkas98c2rwm4/native_pavise_props.brf
 
is there a version of this for the latest mount and blade? and how would i add this as stanterd for my mod
 
I know i am probably necroing this one up,but can this code be used in the original Mount and Blade (v. 1.011)?
 
necroing this thread for interesting fact. New setting of module.ini of 1.153 grant possibility for scene prop tobe useable on single player. Now it's possible to take back the deployed pavise.
 
Cartread said:
Works for Warband 1.125

Updated 6/6/2010: multiplayer version below & at download

Updated 6/5/2010: single-player destructible version (at download)

Updated 6/2/2010: single-player deployable, collapsible version (at download)

Problem: you're at a big disadvantage against bowmen as a crossbowman, because you need cover to reload!

pavise_ss.jpg


Solution: http://www.youtube.com/watch?v=Olnq32yEmZQ

If you have the pavise equipped and hit g, the scene prop is set in front of you.
If you hit h and are near the prop, it changes back to an item. (1st version only)
As many pavise items there are, a prop is set.

Use in any mods you like, but send me a message so I can see what's happening with it!

Download: https://sites.google.com/site/cartread/mount-blade
Comments, suggestions for improvement welcome.

Multiplayer Deployable, destructible version:
For the multiplayer version to work, you have to place (in Edit mode) pavise scene props at z position -100 (far underground).
However many pavise scene props you place there, that is the limit for the players.
mission_temp:
Code:
      #pavise
      (0, 0, 0, [],
       [
        (try_for_agents, ":cur_agent"),
        
            (agent_is_human, ":cur_agent"),         
            (agent_is_alive, ":cur_agent"),  
            (agent_get_position, pos2, ":cur_agent"),
            #==click g && has pavise
            (try_begin),

                (agent_get_wielded_item, ":shield_item", ":cur_agent", 1),
                (eq, ":shield_item", "itm_pavise"),
                (key_clicked, key_g),
                (clear_omitted_keys),
            
                (scene_prop_get_num_instances, ":num_props", "spr_pavise"),
                (position_move_y, pos2, 50),
                (set_spawn_position, pos2),

                (assign, ":pav_found", 0),#pf
                #FOR # props if prop at LATENT spot
                (try_for_range, ":prop_no", 0, ":num_props"),
                    (eq, ":pav_found", 0),#pf
                    (scene_prop_get_instance, ":scene_prop_id", "spr_pavise", ":prop_no"),
                    (prop_instance_get_position, pos3, ":scene_prop_id"), #pos3 holds position of current prop
                    (position_get_z, ":z_coor", pos3),
                    (eq, ":z_coor", -100*100),#-100 LATENT spot

                    (prop_instance_set_position, ":scene_prop_id", pos2),#pavise move
                    (agent_unequip_item, ":cur_agent", "itm_pavise"),
                    (assign, ":pav_found", 1),#pf
                (try_end),
            (try_end),#click g
        (try_end),#for agents
        ]),#0,0,0 pavise
item:
Code:
["pavise", "Pavise Shield",   [("pavise_wep" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield ],
scene_props:
Code:
  ("pavise",sokf_moveable|sokf_destructible,"pavise_prop","bo_pavise", [
    #check_castle_door_use_trigger,

   (ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_no"),
      (scene_prop_set_hit_points, ":instance_no", 100),
    ]),
     
   (ti_on_scene_prop_destroy,
    [
      (play_sound, "snd_dummy_destroyed"),
      
      (assign, ":rotate_side", 86),
      
      (try_begin),
        (this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),

        (store_trigger_param_1, ":instance_no"),      
        (store_trigger_param_2, ":attacker_agent_no"),

        (set_fixed_point_multiplier, 100),
        (prop_instance_get_position, pos1, ":instance_no"),

        (try_begin),
          (ge, ":attacker_agent_no", 0),
          (agent_get_position, pos2, ":attacker_agent_no"),
          (try_begin),
            (position_is_behind_position, pos2, pos1),
            (val_mul, ":rotate_side", -1),
          (try_end),
        (try_end),
      
        (init_position, pos3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (position_move_y, pos3, -100),
        (else_try),
          (position_move_y, pos3, 100),
        (try_end),
      
        (position_move_x, pos3, -50),
        (position_transform_position_to_parent, pos4, pos1, pos3),
        (position_move_z, pos4, 100),
        (position_get_distance_to_ground_level, ":height_to_terrain", pos4),
        (val_sub, ":height_to_terrain", 100),
        (assign, ":z_difference", ":height_to_terrain"),
        #(assign, reg0, ":z_difference"),
        #(display_message, "@{!}z dif : {reg0}"),
        (val_div, ":z_difference", 3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (val_add, ":rotate_side", ":z_difference"),
        (else_try),
          (val_sub, ":rotate_side", ":z_difference"),
        (try_end),

        (position_rotate_x, pos1, ":rotate_side"),
        (prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
      (try_end),
    ]),       
  
    (ti_on_scene_prop_hit,
    [
      (store_trigger_param_1, ":instance_no"),       
      (store_trigger_param_2, ":damage"),
      
      (try_begin),
        (scene_prop_get_hit_points, ":hit_points", ":instance_no"),
        (val_sub, ":hit_points", ":damage"),
        (gt, ":hit_points", 0),
        (play_sound, "snd_dummy_hit"),
      (else_try),
        (neg|multiplayer_is_server),
        (play_sound, "snd_dummy_destroyed"),
      (try_end),

      (try_begin),
        (this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),

        (particle_system_burst, "psys_dummy_smoke", pos1, 3),
        (particle_system_burst, "psys_dummy_straw", pos1, 10),
      (try_end),      
    ]),
  ]),

Single-player Deployable, destructible version:
mission_temp:
Code:
      #pavise
      (0, 0, 0, 
        [],
        [
            (get_player_agent_no, ":player_agent"),
            (agent_get_position, pos2, ":player_agent"),
            (try_begin),

                (agent_get_wielded_item, ":shield_item", ":player_agent", 1),
                (eq, ":shield_item", "itm_pavise"),
                (key_clicked, key_g),

                (position_move_y, pos2, 50),
                (set_spawn_position, pos2),
                (spawn_scene_prop, "spr_pavise"),#pavise spawn
                (agent_unequip_item, ":player_agent", "itm_pavise"),
            (try_end),
        ]),#0,0,0 pavise
item:
Code:
["pavise", "Pavise Shield",   [("pavise_wep" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield ],
scene_props:
Code:
  ("pavise",sokf_moveable|sokf_destructible,"pavise_prop","bo_pavise", [
    #check_castle_door_use_trigger,

   (ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_no"),
      (scene_prop_set_hit_points, ":instance_no", 100),
    ]),
     
   (ti_on_scene_prop_destroy,
    [
      (play_sound, "snd_dummy_destroyed"),
      
      (assign, ":rotate_side", 86),
      
      (try_begin),
        (this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),

        (store_trigger_param_1, ":instance_no"),      
        (store_trigger_param_2, ":attacker_agent_no"),

        (set_fixed_point_multiplier, 100),
        (prop_instance_get_position, pos1, ":instance_no"),

        (try_begin),
          (ge, ":attacker_agent_no", 0),
          (agent_get_position, pos2, ":attacker_agent_no"),
          (try_begin),
            (position_is_behind_position, pos2, pos1),
            (val_mul, ":rotate_side", -1),
          (try_end),
        (try_end),
      
        (init_position, pos3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (position_move_y, pos3, -100),
        (else_try),
          (position_move_y, pos3, 100),
        (try_end),
      
        (position_move_x, pos3, -50),
        (position_transform_position_to_parent, pos4, pos1, pos3),
        (position_move_z, pos4, 100),
        (position_get_distance_to_ground_level, ":height_to_terrain", pos4),
        (val_sub, ":height_to_terrain", 100),
        (assign, ":z_difference", ":height_to_terrain"),
        #(assign, reg0, ":z_difference"),
        #(display_message, "@{!}z dif : {reg0}"),
        (val_div, ":z_difference", 3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (val_add, ":rotate_side", ":z_difference"),
        (else_try),
          (val_sub, ":rotate_side", ":z_difference"),
        (try_end),

        (position_rotate_x, pos1, ":rotate_side"),
        (prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
      (try_end),
    ]),       
  
    (ti_on_scene_prop_hit,
    [
      (store_trigger_param_1, ":instance_no"),       
      (store_trigger_param_2, ":damage"),
      
      (try_begin),
        (scene_prop_get_hit_points, ":hit_points", ":instance_no"),
        (val_sub, ":hit_points", ":damage"),
        (gt, ":hit_points", 0),
        (play_sound, "snd_dummy_hit"),
      (else_try),
        (neg|multiplayer_is_server),
        (play_sound, "snd_dummy_destroyed"),
      (try_end),

      (try_begin),
        (this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),

        (particle_system_burst, "psys_dummy_smoke", pos1, 3),
        (particle_system_burst, "psys_dummy_straw", pos1, 10),
      (try_end),      
    ]),
  ]),

Single-player Deployable, collapsible, indestructible version:
mission_temp:
Code:
      #pavise
      (0, 0, 0, 
        [],
        [

            (get_player_agent_no, ":player_agent"),
            (agent_get_position, pos2, ":player_agent"),
            #==click g && has pavise
            (try_begin),
                #(agent_has_item_equipped, ":player_agent", "itm_pavise"),
                (agent_get_wielded_item, ":shield_item", ":player_agent", 1),
                (eq, ":shield_item", "itm_pavise"),
                (key_clicked, key_g),
                (clear_omitted_keys),
            
                (scene_prop_get_num_instances, ":num_props", "spr_pavise"),
                (position_move_y, pos2, 50),
                (set_spawn_position, pos2),

                (assign, ":pav_found", 0),#pf
                #FOR # props if prop at LATENT spot
                (try_for_range, ":prop_no", 0, ":num_props"),
                    (eq, ":pav_found", 0),#pf
                    (scene_prop_get_instance, ":scene_prop_id", "spr_pavise", ":prop_no"),
                    (prop_instance_get_position, pos3, ":scene_prop_id"), #pos3 holds position of current prop
                    (position_get_z, ":z_coor", pos3),
                    (eq, ":z_coor", -100*100),#-100 LATENT spot

                    (prop_instance_set_position, ":scene_prop_id", pos2),#pavise move
                    (get_player_agent_no, ":player_agent"),
                    (agent_unequip_item, ":player_agent", "itm_pavise"),
                    (assign, ":pav_found", 1),#pf
                (try_end),

                (try_begin),
                    (lt, ":pav_found", 1),#pf

                    (spawn_scene_prop, "spr_pavise"),#pavise spawn
                    (get_player_agent_no, ":player_agent"),
                    (agent_unequip_item, ":player_agent", "itm_pavise"),
                (try_end),
            (try_end),

            (scene_prop_get_num_instances, ":num_props", "spr_pavise"),
            #==click h && near proped pavise
            (try_begin),
                (key_clicked, key_h),
                (clear_omitted_keys),
                #FOR # props if prop close to player
                (try_for_range, ":prop_no", 0, ":num_props"),
                    (scene_prop_get_instance, ":scene_prop_id", "spr_pavise", ":prop_no"),
                    (prop_instance_get_position, pos3, ":scene_prop_id"), #pos3 holds position of current prop
                    (get_distance_between_positions, ":player_distance", pos2, pos3),
                    (le, ":player_distance", 100),

                    (position_set_z, pos3, -100*100),#-100 LATENT spot
                    (prop_instance_set_position, ":scene_prop_id", pos3),#pavise move

                    (set_spawn_position, pos2),
                    (position_move_y, pos2, 50),
                    (spawn_item, "itm_pavise"),#pavise spawn
                (try_end),
                #(scene_prop_set_visibility, ":scene_prop_id", 0),
                #(init_position, pos1),
            (try_end),

        ]),#0,0,0 pavise
item:
Code:
["pavise", "Pavise Shield",   [("pavise_wep" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,  
488 , weight(6.6)|hit_points(660)|body_armor(16)|spd_rtng(60)|shield_width(57)|shield_height(132),imodbits_shield ],
scene_prop:
Code:
("pavise",sokf_moveable,"pavise_prop","bo_pavise",[]),

sorry to necro, but i have some important question, im trying to add it to multiplayer first edition, where in mission templates should i put the first code?
 
dunde said:
necroing this thread for interesting fact. New setting of module.ini of 1.153 grant possibility for scene prop tobe useable on single player. Now it's possible to take back the deployed pavise.

What is it and where reviews of this interesting addition?
 
FALX said:
What is it and where reviews of this interesting addition?

dunde said:
("pavise_shield1",sokf_moveable|sokf_destructible|sokf_enforce_shadows|spr_use_time(1),"pavise_shield1","bo_pavise_shield1",

the scene prop will be usable now, just press F.
You will need WB v1.15x and you must set can_use_scene_props_in_single_player = 1 on module.ini to use this feature.
 
dunde said:
necroing this thread for interesting fact. New setting of module.ini of 1.153 grant possibility for scene prop tobe useable on single player. Now it's possible to take back the deployed pavise.
dunde said:
FALX said:
What is it and where reviews of this interesting addition?

dunde said:
("pavise_shield1",sokf_moveable|sokf_destructible|sokf_enforce_shadows|spr_use_time(1),"pavise_shield1","bo_pavise_shield1",

the scene prop will be usable now, just press F.
You will need WB v1.15x and you must set can_use_scene_props_in_single_player = 1 on module.ini to use this feature.

Thank you very much for this help .
This perspective is a list of new features in the new version in 1153 for inclusion in various other scripts.
 
Back
Top Bottom