OSP Code Combat Shield Bash (OSP)

Users who are viewing this thread

Alright,got it to compile now.
Didnt get any errors client-side,will check server logs in a sec to check if I missed something there(WIll edit this post).

Edit:Checked Server logs,no errors.Also tried to use the bash in a hosted game(not a dedicated server),nothing happend.Will check back here once I get to upload the next version onto the server.
 
gdwitt said:
Do you guys have a script that I can include in BW for non-multiplayer?
Shield bash is advertised as working but doesn't.

Isn't it working currently?
 
i managed to apply all correctly or i think so.. since compile finished without errors.. but ingame shiled bash dont work...
 
Use this along with the same animations in the OP. I altered the scripts and added a constant. So now you bash with different wait times, based on your shield skill.

for module_scripts
Code:
#Shield Bash Script  
("shield_bash",[  
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),	
(get_player_agent_no,":player_agent"),
(store_skill_level,":shield_level", "skl_shield", "trp_player"),  
(store_sub, ":player_shield_bash_time", 13, ":shield_level"),
(store_mission_timer_a, ":current_time"),
(agent_get_slot, ":slot_last_shield_bash_time", ":player_agent", 27),
(store_add, ":time_to_shield_bash", ":player_shield_bash_time",":slot_last_shield_bash_time"),
(try_begin),
(ge, ":current_time", ":time_to_shield_bash"),
(try_begin),
(gt, ":player_agent", 0),
(agent_get_animation, ":anim", ":player_agent",0),
(agent_get_horse, ":my_horse", ":player_agent"),
(agent_get_wielded_item, ":shield_item", ":player_agent", 1),
(try_begin),
	(neq, ":anim", "anim_shield_bash"),
	(eq, ":my_horse", -1),
	(item_get_type, ":item_type", ":shield_item"),
	(eq, ":item_type", itp_type_shield),
	(agent_set_animation, ":player_agent","anim_shield_bash"),
	(agent_get_position, pos63,":player_agent"),
	(position_move_y,pos63,75),#75 cm directly ahead, so it's not a cuboid space around player center
	(agent_get_troop_id, ":id", ":player_agent"),
	(troop_get_type, ":type", ":id"),
	(try_begin),
		(eq, ":type", tf_male),
		(agent_play_sound, ":player_agent", "snd_man_yell"),
		(agent_set_slot, ":player_agent", 27, ":current_time"),
	(else_try),
		(agent_play_sound, ":player_agent", "snd_woman_yell"),	
        (agent_set_slot, ":player_agent", 27, ":current_time"),		
	(try_end),
	(try_for_agents,":agent"),
		(gt, ":agent", 0),
		(neg|agent_is_ally,":agent"),#don't bash allies
		(agent_is_human, ":agent"),#stop if not human			
		(agent_is_active,":agent"),
		(agent_is_alive,":agent"),
		(try_begin),
			(agent_get_position,pos62,":agent"),
			(get_distance_between_positions,":dist",pos63,pos62),		
			(lt,":dist",100),#Set this to whatever you like- 1 meter radius clears a big section of crowd
			(agent_get_horse, ":horse", ":agent"),
			(eq, ":horse", -1),	
			(neq,":agent",":player_agent"),	
			(agent_play_sound, ":player_agent", "snd_wooden_hit_low_armor_high_damage"),				
			(position_move_y,pos62,-25),			
			(agent_set_position, ":agent", pos62),
			(agent_set_animation, ":agent","anim_shield_strike"),			
		(try_end),
	(try_end),
	(try_end),
(try_end),
(else_try),
(display_message, "@You don't have enough shield skill to shield bash again this soon."),
(try_end),
]),  
#End Shield Bash Script

for module_constants
Code:
slot_agent_last_shield_bash_time  = 27  #RAMARAUNT ADD
 
Sorry to necro, but it doesn't work for me. I tried both the original code, and Ramaraunt's edited code, but pressing left Crtl does nothing.

Edit: No, scratch that, it works. I just forgot to add it to appropriate mission templates. Silly me.  :oops: :grin:
 
Back
Top Bottom