Little coding melee weapon swing sound help!

Users who are viewing this thread

spiritwind

Squire
Hey everyone, this is Spiritwind requesting some help with  coding.
First off I want to make it known that the fallout team is looking for experienced Coders so that problems like this can easily been solved and we can get many new awesome features.  This position would grant you exclusive access to our boards as well as access to the latest team versions of the Fallout mod.  Ok, to the gist of this post.
Ok, here is the problem; The fallout mod contains weapons such as the Ripper and Super Sledgehammer that requires their own sounds for swinging and perhaps one for while in idle.  I have been turned over to a old post that was made when someone requested this same features to be written up for their mod.  Ok, heres the problem.  *Right now I am using a version of the code that the StarWars mod used, until I get this working and can edit the code to best fit the fallout mod*

#Ripper#
ripper_idle = (
  3, 0, 0, [],
      [ 
      (try_for_agents, ":agent"),   
        (agent_is_alive, ":agent"),   
        (agent_is_human, ":agent"),   
        (agent_get_wielded_item, ":handone", ":agent", 0),   
        (agent_get_wielded_item, ":handtwo", ":agent", 1),   
        #(this_or_next|eq, ":handone", "itm_special_weapon"),   
        #(this_or_next|eq, ":handone", "itm_lightsaber_green"),
        (this_or_next|is_between, ":handone", lightsaber_noise_begin, lightsaber_noise_end),
        #(eq, ":handtwo", "itm_special_weapon"),   
        #(eq, ":handtwo", "itm_lightsaber_green"),   
        (is_between, ":handtwo", lightsaber_noise_begin, lightsaber_noise_end),       
        #(agent_play_sound,":agent","snd_special_weapon_idle"), #This assumes it's a 1 second long clip, change trigger length if it's different
        (agent_play_sound,":agent","snd_ripper_hit"), #This assumes it's a 1 second long clip, change trigger length if it's different
      (try_end), 
      ]
)
ripper_agent = (
  3, 0, 0, [],
      [ 
      (try_for_agents, ":agent"),   
        (agent_is_alive, ":agent"),   
        (agent_is_human, ":agent"),   
        (agent_get_wielded_item, ":handone", ":agent", 0),   
        (agent_get_wielded_item, ":handtwo", ":agent", 1),   
        #(this_or_next|eq, ":handone", "itm_special_weapon"),   
        #(this_or_next|eq, ":handone", "itm_lightsaber_green"),   
        (this_or_next|is_between, ":handone", lightsaber_noise_begin, lightsaber_noise_end),
        #(eq, ":handtwo", "itm_special_weapon"),   
        #(eq, ":handtwo", "itm_lightsaber_green"),
        (is_between, ":handtwo", lightsaber_noise_begin, lightsaber_noise_end),                       
        (agent_get_combat_state, ":state", ":agent"),   
        (try_begin),     
          (eq,":state",4), #This is the combat state for melee swing     
          (agent_slot_eq,":agent",slot_agent_attack_sound, 0),     
          (agent_set_slot, ":agent", slot_agent_attack_sound, 1),     
          #(agent_play_sound,":agent","snd_special_weapon_attack"),   
          (agent_play_sound,":agent","snd_ripper_hit"),   
        (else_try),     
          (neq,":state",4),     
          (agent_set_slot, ":agent", slot_agent_attack_sound, 0),   
        (try_end), 
      (try_end), 
      ]
)
ripper_player = (
  0, 0, 1,    #there's a 1 second refresh timer to give the attack sound time to complete
      [(game_key_clicked, gk_attack),],
      [   
        (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|eq, ":handone", "itm_special_weapon"), 
        #(this_or_next|eq, ":handone", "itm_lightsaber_green"), 
        (this_or_next|is_between, ":handone", lightsaber_noise_begin, lightsaber_noise_end),
        #(eq, ":handtwo", "itm_special_weapon"), 
        #(eq, ":handtwo", "itm_lightsaber_green"), 
        (is_between, ":handtwo", lightsaber_noise_begin, lightsaber_noise_end),                       
        #(agent_play_sound,":agent","snd_special_weapon_attack"), 
        (agent_play_sound,":agent","snd_ripper_hit"), 
      ]
)

___
That was the code that is in module_mission_templates.py, which I know how to install coding into.  I’ve put the template to be read in all battle scenes and for some reason it is not working.  I’ve got all the right sounds i need, models, bla bla bla.  I’ve also applied the constant for lightsaber_noise_begin and lightsaber_noise_end.  I get no error messages when I compile everything, and the game loads 100% perfectly.  However, this has also caused another template that is binded to a key to stop working, which is placed above this template in the coding, and as cost me about 3 hours of my time trying to fix this stinking problem, so of course, I’m coming to the pros...
Here is an example of how I’m placing the templates into the scene, just incase that is where my error is.
    "village_attack_bandits",mtf_battle_mode,charge,
    "You lead your men to battle.",
    [
    (3,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
    (1,mtef_team_0|mtef_use_exact_number,0,aif_start_alarmed, 7,[]),
    (1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
    ],
    [
      common_battle_tab_press,
      %%%%%%*Suprise in the fallout mod, can’t let you see :wink:*,
      ripper_idle,
      ripper_agent,
      ripper_player,
If anyone knows the problems, please tell me!
Thanks ahead of time!,
~Spiritwind~
 
what is your lightsaber_begin & end listed as?  You could switch this check to something more basic if you only wanted to check a single item:
        (this_or_next|eq, ":handone", "itm_ripper"),   
        (eq, ":handtwo", "itm_ripper"),   
 
Anyone still know how I could get this working all together?
I've used the original version too and it still did not work.
 
Back
Top Bottom