Been trying to get firearms (Muskets, pistols etc.) to create sound effects that can be heard by everyone, rather than just by the client firing the weapon - in an attempt to fix this, I followed the following tutorial.
http://forums.taleworlds.com/index.php/topic,94854.0.html
I was previously able to get this workings for the native module system with no sweat, but because the PW module system is.. different, I'm not entirely sure where to go.
I added this snippet to the end of game recieve network message:
Everything was followed as-is in the tutorial (such as the header commons, except some tweaks to the names of the operations; from multiplayer -> server)
Below is a template for a firearm; specifically a pistol, demonstrating the sound changes.
Compiles without an issue; but no sound is produced whatsoever.
Any help would be greatly appreciated! Thanks!
http://forums.taleworlds.com/index.php/topic,94854.0.html
I was previously able to get this workings for the native module system with no sweat, but because the PW module system is.. different, I'm not entirely sure where to go.
I added this snippet to the end of game recieve network message:
Code:
# NEW EVENTS ADDED
(else_try),
(eq,":event_type", server_event_sound_made_by_player),
(neq,":player_no",0),
(store_script_param, ":sound", 3),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active,":cur_player"),
(multiplayer_send_2_int_to_player, ":cur_player", server_event_sound_at_player, ":sound",":player_no"),
(try_end),
(else_try),
# END NEW EVENTS ADDED
# NEW CLIENT EVENTS
(eq, ":event_type", server_event_sound_at_player),
(store_script_param, ":sound", 3),
(store_script_param, ":player", 4),
(player_get_agent_id,":agent",":player"),
(try_begin),
(neq,":agent",-1),
(display_message,"@BANG!"), # This is just a debug message, it isn't essential.
(agent_play_sound,":agent",":sound"),
(try_end),
# END NEW CLIENT EVENTS
Everything was followed as-is in the tutorial (such as the header commons, except some tweaks to the names of the operations; from multiplayer -> server)
Code:
##PWNM Event For Muskets##
server_event_sound_made_by_player = 28
server_event_sound_at_player = 29
Below is a template for a firearm; specifically a pistol, demonstrating the sound changes.
Code:
["pistol_template", "Pistol", [("flintlock_pistol_1",0)], itp_type_pistol |itp_merchandise|itp_cant_reload_while_moving|itp_cant_use_on_horseback|itp_primary ,itcf_shoot_pistol|itcf_carry_pistol_front_left|itcf_reload_pistol, 7300 , weight(1.5)|difficulty(0)|spd_rtng(35) | shoot_speed(160) | thrust_damage(70 ,pierce)|max_ammo(1)|accuracy(65),imodbits_none,
[(ti_on_weapon_attack, [(multiplayer_send_int_to_server,server_event_sound_made_by_player,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,36),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]],
Compiles without an issue; but no sound is produced whatsoever.
Any help would be greatly appreciated! Thanks!
Actually, sorry about this - a workaround was found, and so this wasn't needed. Sorry for the spam / pointless topic! Please remove if possible.