Distant musket sounds too quiet [Napoleonic wars]

Users who are viewing this thread

Dazzer

Sergeant Knight at Arms
I'm trying to add a separate sound for musket shots at a distance using the game_missile_launch script found in Napoleonic wars modsys. Here's the current code

Code:
 ("game_missile_launch",
    [
    (try_begin),
      (neg|multiplayer_is_dedicated_server),
      
      (store_script_param, ":agent_id", 1),
      (store_script_param, ":item_id", 2),
      (store_script_param, ":missile_weapon_id", 3),
      
      (agent_is_active,":agent_id"),
      (agent_is_alive,":agent_id"),
      (neq,":missile_weapon_id","itm_cannon_canister_dummy"),
      
      (set_fixed_point_multiplier, 100),
      (copy_position,pos41,pos1),
      
      (assign, ":sound_id", -1),
      (assign, ":muzzle_y", 0),
      (assign, ":muzzle_x", -16),
      (assign, ":muzzle_y_rot", 0),
      (assign, ":has_pan", 1),
     # (assign, ":pan_y", 0),
      (assign, ":smoke_size", 17),
      (assign, ":spark_size", 100),
      (assign, ":pan_smoke_size", 8),
      (try_begin),
        (is_between,":item_id","itm_french_cav_pistol","itm_french_mousquiton"), # Pistols
        (assign, ":sound_id", "snd_pistol"),
        (assign, ":muzzle_y", 44),
        (assign, ":muzzle_x", 0),
        (assign, ":muzzle_y_rot", -45),
        (assign, ":has_pan", 0),
        (assign, ":smoke_size", 14),
        (assign, ":spark_size", 40),
      (else_try),
        (is_between,":item_id","itm_french_mousquiton","itm_wheellock_carbine_1"), # MATCHLOCKS
        (mission_cam_get_position, pos5),
        (get_distance_between_positions_in_meters, ":dist", pos1, pos5),
         (try_begin),
            (ge, ":dist", 50),
            (assign, ":sound_id", "snd_musket_far"),
         (else_try),
            (assign, ":sound_id", "snd_musket"),
         (try_end),
        (assign, ":muzzle_y", 104),
      (else_try),
        (is_between,":item_id","itm_wheellock_carbine_1","itm_firelock_regular_long"), # WHELLLOCKS
        (assign, ":sound_id", "snd_wheellock"),
        (assign, ":muzzle_y", 90),
      (else_try),
        (is_between,":item_id","itm_firelock_regular_long","itm_french_art_off_sword"), # FLINTLOCKS
        (assign, ":sound_id", "snd_musket"),
        (assign, ":muzzle_y", 132),
      (try_end),
      
      (try_begin),
        (call_script, "script_client_get_my_agent"),
        (eq, ":agent_id", reg0), # shooting myself.
        
        # particles for myself 65% so i can see what I shoot at.
        (val_mul,":smoke_size", 65),
        (val_div,":smoke_size", 100),
        (val_mul,":pan_smoke_size", 65),
        (val_div,":pan_smoke_size", 100),
      (try_end),
      
      # Sounds
      (gt, ":sound_id", -1),
      (play_sound_at_position, ":sound_id", pos41),     

      # Default movement
      (position_move_x,pos41,":muzzle_x"),
      (position_move_y,pos41,18),

      # pan flash and smoke..
      (try_begin),
        (eq,":has_pan",1),
        
        (particle_system_burst_no_sync, "psys_pan_smoke", pos41, ":pan_smoke_size"),
        #(position_rotate_z, pos41, 45),
        (particle_system_burst_no_sync, "psys_pan_flash", pos41, 4),
        #(position_rotate_z, pos41, -45),
      (try_end),
      
      # the fire particles
      (position_rotate_z,pos41,":muzzle_y_rot"),
      (position_move_y,pos41,":muzzle_y"),
      (particle_system_burst_no_sync, "psys_musket_smoke", pos41, ":smoke_size"),
      (particle_system_burst_no_sync, "psys_musket_flash", pos41, ":spark_size"),
      #(particle_system_burst_no_sync, "psys_musket_sparks", pos41, ":spark_size"),
    (try_end),
  ]),

What puzzles me is that in older posts I've read nobody had any complaints when using a very similar code, but in this case the sounds are very quiet, practically nonexistent. I'd like the sounds to be similar to those in WFaS which uses a different method alltogether that didn't seem to work when I tried it. So unless I'm doing something wrong I'm guessing it's gonna require a lot more intricate code?
 
In singleplayer firearms already have separate sound files for far. Look in module_sounds for musket sounds.
If you can't find them, then they are missing and you can just copy the entries from for example Napoleonic Wars.
Far sounds and near sounds are separate entries so you can tweak their volume separately.
The only limitation I can think of is setting volume to 15 and still feeling like that too quiet. Because that's max volume.
The only way to overcome volume limits is to remove all flags - my testing shows that sounds without flags are much louder than volume 15. So you could set near musket to no flags, and far musket to 15.
 
Upvote 0
It makes a difference if you try to do it in Singleplayer or Multiplayer. What are you trying to do?

Sound of shots by bots (MP) (multiple posts in a row)
Pistol shot sound (MP)

Simple Gunshot Sounds Based on Distance w/o WSE (SP)
I'm using the NW modsys specifically so this is all handled already. The game_missile_launch script should work both for SP (ie custom battles) and MP. The only problem is the sounds just don't sound right. They should sound like loud bangs even from a distance. Warband mods like L'aigle and The Deluge handle it perfectly but I don't know how, and WFaS handles this in module_sounds itself.

In singleplayer firearms already have separate sound files for far. Look in module_sounds for musket sounds.
If you can't find them, then they are missing and you can just copy the entries from for example Napoleonic Wars.
Far sounds and near sounds are separate entries so you can tweak their volume separately.
The only limitation I can think of is setting volume to 15 and still feeling like that too quiet. Because that's max volume.
The only way to overcome volume limits is to remove all flags - my testing shows that sounds without flags are much louder than volume 15. So you could set near musket to no flags, and far musket to 15.
I'm not sure what you mean, are you referring to WFaS? I'm doing a mod for NW.
 
Upvote 0
I'm using the NW modsys specifically so this is all handled already. The game_missile_launch script should work both for SP (ie custom battles) and MP. The only problem is the sounds just don't sound right. They should sound like loud bangs even from a distance. Warband mods like L'aigle and The Deluge handle it perfectly but I don't know how, and WFaS handles this in module_sounds itself.


I'm not sure what you mean, are you referring to WFaS? I'm doing a mod for NW.
Sorry, WFaS.
 
Upvote 0
WFaS uses the next_for_far flag for sounds which doesn't work for NW because it's overriden by the game_missile_launch script. Also I don't think I'm allowed to use their stuff except for some models and textures.
 
Upvote 0
WFaS uses the next_for_far flag for sounds which doesn't work for NW because it's overriden by the game_missile_launch script. Also I don't think I'm allowed to use their stuff except for some models and textures.
Don't take the sound files, no need.
Also next_for_far does nothing, engine-wise.
Engine reacts to sound id, not this flag.
I think they were *planning* to introduce a flag for that, but for now it's all hardwired to sound id.

As long as u use the same name (id) for the sound, flag is irrelevant.
 
Upvote 0
Don't take the sound files, no need.
Also next_for_far does nothing, engine-wise.
Engine reacts to sound id, not this flag.
I think they were *planning* to introduce a flag for that, but for now it's all hardwired to sound id.

As long as u use the same name (id) for the sound, flag is irrelevant.
I tried removing the flag just for fun and the sounds stopped working.

Anyway this doesn't matter since it's not applicable to my mod.
 
Upvote 0
Back
Top Bottom