defiller said:it seems that i dont have a constant.py and animation.py in my module folder, need help! where do i put it then? i am currently using m&b warband v1.132
Kaesar said:Happy Christmas
If someone can help me.
I have added it in the game.It looks fun.but ai does not do it.
I find this here :
Also you need to define the variables $sp_shield_bash and $sp_shield_bash_ai to 1 if you want the triggers to activate. Put this into the game_start script:
(assign, "$sp_shield_bash", 1),
(assign, "$sp_shield_bash_ai", 1),
I don't know the definite place where to put in.
Could someone help me?
thanks in advance
#script_game_start:
# This script is called when a new game is started
# INPUT: none
("game_start",
[
(assign, "$sp_shield_bash", 1),
(assign, "$sp_shield_bash_ai", 1),
Put it toward the top, by the other "common_" triggers. Or, put it right after the pilgrim outfit is defined.Specialist said:Where do I put the code in mission_templates? At the top above everything else? Or at every battle trigger?
Caba`drin said:Put it toward the top, by the other "common_" triggers. Or, put it right after the pilgrim outfit is defined.Specialist said:Where do I put the code in mission_templates? At the top above everything else? Or at every battle trigger?
Then, in each template that you want shield bash active (such as "lead_charge") add the line
common_shield_bash,
with other "common_TRIGGERNAME_HERE," lines.
Just add to the scripts in this case. It takes frames from existing animations.Guacamolez said:Hi im kinda new at this i got a question: do you have to download an animation for this? or do you just have to add the scripts??
Caba`drin said:Just add to the scripts in this case. It takes frames from existing animations.Guacamolez said:Hi im kinda new at this i got a question: do you have to download an animation for this? or do you just have to add the scripts??
mp_shield_bash = (
0, 0, 0,
[
(game_key_is_down, gk_defend),
(game_key_clicked, gk_attack),
(game_is_in_multiplayer_mode),
],
[
(multiplayer_send_message_to_server, mp_shield_bash_server),
])
#Server/client events.
#Copy-paste this stuff right after the store_script_params in game_receive_network_message.
(try_begin),
(eq, ":event_type", mp_shield_bash_server),
#Get sender data & max players.
(player_is_active, ":player_no"),
(player_get_agent_id, ":agent_no", ":player_no"),
(agent_is_active, ":agent_no"),
(get_max_players, ":max_players"),
#Check if the sender is in the correct condition.
(agent_get_wielded_item, ":shield", ":agent_no", 1), #Offhand item.
(is_between, ":shield", "itm_wooden_shield", "itm_steel_shield_herald03"),
(agent_get_defend_action, ":action", ":agent_no"),
(eq, ":action", 2), #Blocking.
(agent_get_animation, ":anim", ":agent_no", 0),
(neq, ":anim", "anim_shield_bash"),
(agent_get_horse, ":horse", ":agent_no"),
(eq, ":horse", -1), #No horse.
#If everything is correct, then set the sender agent up for bash.
(agent_set_animation, ":agent_no", "anim_shield_bash"),
(player_get_troop_id, ":troop_no", ":player_no"),
(troop_get_type, ":type_no", ":troop_no"),
(try_begin),
(eq, ":type", tf_male),
(try_for_range, ":player", 0, ":max_players"),
(player_is_active, ":player"),
(multiplayer_send_2_int_to_player, ":player", mp_agent_play_sound_client, ":agent_no", "snd_man_yell"),
(try_end),
(else_try),
(eq, ":type", tf_female),
(try_for_range, ":player", 0, ":max_players"),
(player_is_active, ":player"),
(multiplayer_send_2_int_to_player, ":player", mp_agent_play_sound_client, ":agent_no", "snd_woman_yell"),
(try_end),
(try_end),
#Bash. Get the closest agent within 175cm~1.75m.
(agent_get_position, pos1, ":agent"),
(assign, ":minimum_distance", 400),
(assign, ":victim", -1),
(try_for_agents, ":suspect"),
(neq, ":suspect", ":agent"), #Suspect can't be our local agent.
(agent_is_active, ":suspect"),
(agent_is_alive, ":suspect"),
(agent_is_human, ":suspect"),
#Compare distances.
(agent_get_position, pos2, ":suspect"),
(neg|position_is_behind_position, pos2, pos1),
(get_distance_between_positions, ":distance", pos1, pos2),
(le, ":distance", ":minimum_distance"),
#If distance is sufficient..
(assign, ":minimum_distance", ":distance"),
(assign, ":victim", ":suspect"),
(try_end),
#If we have the victim, aka the closest agent, then deal with him. Else, do nothing.
(ge, ":victim", 0),
(agent_get_horse, ":horse", ":victim"),
(eq, ":horse", -1), #No horse.
(try_for_range, ":player", 0, ":max_players"),
(player_is_active, ":player"),
(multiplayer_send_2_int_to_player, ":player", mp_agent_play_sound_client, ":victim", "snd_wooden_hit_low_armor_high_damage"),
(try_end),
(agent_get_position, pos2, ":victim"),
(position_move_y, pos2, -25),
(position_get_distance_to_ground_level, ":distance", pos2),
(try_begin),
(le, ":distance", 25),
(agent_set_position, ":victim", pos2),
(agent_set_animation, ":victim", "anim_shield_strike"),
(else_try),
(gt, ":distance", 25),
(agent_set_animation, ":victim", "anim_shield_strike"),
(try_end),
(else_try),
(neq, multiplayer_is_server),
(try_begin),
(eq, ":event_type", mp_agent_play_sound_client),
(store_script_param, ":agent", 3),
(store_script_param, ":sound", 4),
(agent_play_sound, ":agent", ":sound"),
(try_end),
(try_end),
#These animations go into module_animations.py
#They MUST replace existing unused animations.
##################
##Copyright: xenoargh. ##
##################
["shield_bash", 0, amf_play|amf_priority_defend|amf_use_defend_speed|amf_client_owner_prediction,
[0.75, "defend_shield_parry_all", 1, 50, blend_in_defense], #Adjust duration for balance. Currently at 0.75 seconds, fixed.
[0.75, "defend_shield_right", 1, 50, blend_in_defense],
[0.75, "defend_shield_left", 1, 50, blend_in_defense],
[0.75, "defend_shield_right", 1, 50, blend_in_defense],
],
["shield_strike", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[1.0, "anim_human", blow+5000, blow+5010, arf_blend_in_3|arf_make_custom_sound],
[1.7, "anim_human", blow+5400, blow+5453, arf_blend_in_2|arf_make_custom_sound],
[1.44, "anim_human", blow+5400, blow+5445, arf_blend_in_2|arf_make_custom_sound],
],