Results 1 to 11 of 11

Thread: Sound Event Tags

  1. #1

    Default Sound Event Tags

    Does anyone have a list of sound event tags that can be used as arguments for the play_sound_event and stop_sound_event commands? I know that we can define our own tags after the play_sound_event command, but are these custom tags the only ones that we can use? The docudemons uses the tag PREBATTLE_TEST as its example for both commands, but I can't find anything else about this.

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Sound Event Tags

    The relevant (valid) sound events are listed in descr_sounds_narration and there is no limit of creating your own events. I would think that the 'stop' command is only useful if you use long sound tracks but wish to curtail them, using 'wait' between 'play' and 'stop'.

    Example from EBII, narration
    Code:
                      event Successor_1
                               
                                        folder data/sounds/SFX/Events
                                        successor.mp3
                               end
    Use, script
    Code:
            if not I_IsFactionAIControlled f_carthage
                console_command give_trait this CarthWarLeader 1
                console_command give_trait this M_mhnt 2
                set_event_counter warleader_scroll 0
                historic_event HE_f_carthage_warleader_selected                 ; optional
                play_sound_event Successor_1
                set_event_counter carth_war_leader_exists 1
            end_if
    Last edited by Gigantus; March 25, 2021 at 09:08 AM.










  3. #3

    Default Re: Sound Event Tags

    I don't think the sound events are limited to descr_sounds_narration. Most of the sounds files have defined events and it seems like you can call any of them using play_sound_event. The problem is that stop_sound_event only seems to accept the tag as an argument, not the event name. The docudemons confirm this.

    Code:
    play_sound_event EVENT_NAME tag = Custom_Audio_Tag
    The EVENT_NAME can be taken from any sound file with events. But I have no idea where "Custom_Audio_Tag" comes from. Is it user-defined input that I just made up at some point and forgot about? If that's the case, and stop_sound_event only takes tags, then stop_sound_event is totally useless for stopping any sounds other than those we've already defined with custom tags.

    I have a script that involves lots of spawned armies moving around and I'm trying to suppress all the "Leaving the army", "Splitting the troops" spam that accompanies the script event. These are 'vocal Joins_Army' and 'vocal Leaves_Army' in export_descr_sounds_stratmap_voice.txt, not events. I don't see any way to suppress that audio. I was hoping there would be a pre-defined tag that corresponded to those types of events.

  4. #4
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Sound Event Tags

    If you look at the stop example in the docudemons you will see that the <tag> parameter equals the event name. Whereas in play that is the <event_id>.
    To be honest I wouldn't know what is meant by <tag> or even <index>.

    Looking at the custom battle script, eg hastings, reveals tag use:
    Code:
        monitor_conditions I_CompareCounter get_on_with_it > 0
        and I_CompareCounter shieldwall_compromised < 1        
            play_sound_event Hastings_Sergeant_2 tag = Hastings_Sergeant_2
        terminate_monitor
        end_monitor
    There is however no other referencing of 'Hastings_Sergeant_2' other then twice in each of the 3 'play' lines, once as event name and once as tag. It continues in the same vein with every other sound event and seems to be totally superfluous.

    I haven't tried to use events from outside the narration file so couldn't say anything about it. As to the strat char's sound events - you would need to know how to check when they get triggered in order to stop them, should that indeed be possible via the stop_event_sounds command.

    Have you thought of simulating the keyboard muting shortcut to suppress those event sounds? On second thought, can shortcuts be simulated? Mouse clicks can...
    Last edited by Gigantus; March 25, 2021 at 10:52 AM.










  5. #5

    Default Re: Sound Event Tags

    So it seems like the tags are indeed user-defined. At any rate, I don't think I'll ever find audio events corresponding to Joins_Army and Leaves_Army, let alone script events. I already tried the naive approach of simply supplying these as arguments to stop_sound_event and that did absolutely nothing, as expected.

    Muting all audio may be the best solution if it can be unmuted by simply issuing the command again. I see that MUTE is an accepted key value, but not an effect in descr_shortcuts. I presume the effect would be toggle_sound. So we would have:

    Code:
    call_object_shortcut preferences toggle_sound
    campaign_wait x ;however long the annoying audio lasts
    call_object_shortcut preferences toggle_sound

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Sound Event Tags

    export_descr_sounds_stratmap_voice - vocal Joins_Army

    That's what you are looking for. Note 'vocal' instead of 'event' - totally different format, the reason why it never occurred to me actually try that with play_sound_effect.


    Ah yes, 'call_object' - that might be the way. I am not familiar with it's use, withwnar may have more detailed feedback on it. The only time I have used it was to accelerate movement (space bar effect), the coding might be of some help:
    Code:
        monitor_event FactionTurnStart FactionIsLocal
            call_object_shortcut strat_ui speedup_ai
            move J-1021-ShangSheng, 162, 82
            move J-1011-ZhouXin, 167, 87
            call_object_shortcut strat_ui speedup_ai
            terminate_monitor
        end_monitor
    from text\descr_shortcuts:
    Code:
        strat
            save_stratmap                S CTRL
            load_stratmap                L CTRL
            speedup_ai                    SPACE
            stop_character                BACKSPACE
            capital_zoom                HOME    H
    toggle_sound is in the misc section, so it's probably misc_ui, not preferences:
    Code:
        misc
            inc_scale                    F2
            dec_scale                    F3
            toggle_unit_visibility        F3 CTRL        hidden
            select_all                    A  CTRL
            select_siege                B  CTRL
            select_infantry                I  CTRL
            select_cavalry                C  CTRL
            select_missile                M  CTRL
            select_melee                H  CTRL
            select_next                    TAB
            select_prev                    TAB SHIFT
            deselect_all                ENTER
            deselect_all                NUM_ENTER
            hide_gui                    SCROLL_LOCK        hidden
            show_console                GRAVE_ACCENT  ;  hidden
            toggle_sound                S ALT
            show_help                    F1
            quit                        ESC        hidden
    ;        reveal_advice                Z
            dismiss_advice                X
            screen_grab                    SYSRQ
    On the other hand the 'hide the ui' script is using object_manager (hide_gui), but it's not with call_object:
    Code:
    monitor_event ShortcutTriggered ShortcutTriggered object_manager hide_gui
    Last edited by Gigantus; March 25, 2021 at 12:45 PM.










  7. #7

    Default Re: Sound Event Tags

    For some reason, I can't get call_object_shortcut to work for all of the shortcuts, including toggle_sound. It works for some but not others and I don't see a pattern.

    I can only get toggle_sound itself to work when it's keyed to ALT + S, in misc, and grouped under preferences. Changing anything about that makes the shortcut not work. But, when it's set up like this, it refuses to be called using call_object_shortcut.

  8. #8

    Default Re: Sound Event Tags

    Seems indices (and tags?) are there to differentiate between separate instances of the same sound event, export_descr_sounds_units_battle_events.txt uses indices for example. Maybe you can stop different instances of the same event at different points in time? Didn't test it and don't think it has been made use of in vanilla or any of the DLCs (as far as I know). But yeah, looks like that won't help with your specific problemanyway, since you want to stop vocals.


    Try some different syntax formats for call_object_shortcut, this works for example:

    call_object_shortcut - screen_grab

    Another weird quirk of the game that Jojo00182 extracted from the .exe.

  9. #9

    Default Re: Sound Event Tags

    I tried:

    Code:
    call_object_shortcut preferences toggle_sound
    
    call_object_shortcut toggle_sound
    
    call_object_shortcut - toggle_sound
    
    call_object_shortcut - preferences toggle_sound
    
    call_object_shortcut preferences - toggle_sound
    And I've tried moving toggle_sound to different groups and categories in descr_shortcuts, and couldn't get anything to work. Alt + S still works, but not my test shortcut (Shift + T) calling any of the above commands.

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Sound Event Tags

    I failed similarly - I even used 'object_manager' in place of preferences. Most likely this function was only meant for the UI_elements (see docudemons) and by some fluke works with some of the keyboard short cuts.










  11. #11
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Sound Event Tags

    Code:
    call_object_shortcut preferences toggle_sound
    ... should be the correct choice. No idea why it doesn't work.

    If that's the case, and stop_sound_event only takes tags, then stop_sound_event is totally useless for stopping any sounds other than those we've already defined with custom tags.
    Yes, that's my understanding of it. It can only be used with a tag that was defined by a scripted play_sound_event.

    Some discussion here.
    Last edited by Withwnar; March 28, 2021 at 05:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •