I'm currently using the following code for the lightsaber swing in my star wars mod.
The problem is, the sound plays when you first click the attack button, so if you hold the attack button down, and then release it the sound has already played. Is there anyway to modify this so that the sound is played when the attack button is released?
Code:
lightsaber_noise_player = (
#SW - special weapon noise code by Jinnai
0, 0, 1, #there's a 1 second refresh timer to give the attack sound time to complete
[
(game_key_clicked, gk_attack),
(neg|conversation_screen_is_active)
],
[
(get_player_agent_no, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_wielded_item, ":handone", ":agent", 0),
(agent_get_wielded_item, ":handtwo", ":agent", 1),
(this_or_next|is_between, ":handone", lightsaber_noise_begin, lightsaber_noise_end),
(is_between, ":handtwo", lightsaber_noise_begin, lightsaber_noise_end),
(agent_play_sound,":agent","snd_lightsaber_swing"),
]
)
The problem is, the sound plays when you first click the attack button, so if you hold the attack button down, and then release it the sound has already played. Is there anyway to modify this so that the sound is played when the attack button is released?