Moshein_Gunn said:Maybe you guys can help me then, I'm not sure if I'm looking to do what you were just explaining, but I know nothing about the module strings or triggers, but I want to try and play a sound file for the text in the dialog screens. Basically a sound file voicing what is written in the dialog text. What exacctly would be the script I would put in before the dialog trigger to have it play the sound file?
sphere said:Moshein_Gunn said:Maybe you guys can help me then, I'm not sure if I'm looking to do what you were just explaining, but I know nothing about the module strings or triggers, but I want to try and play a sound file for the text in the dialog screens. Basically a sound file voicing what is written in the dialog text. What exacctly would be the script I would put in before the dialog trigger to have it play the sound file?
iirc, there should be a way to add it in module_dialogs.py as an optional parameter after the usual elements in a dialog entry.
[anyone,"bandit_introduce", [
(store_random_in_range, ":intro", "str_bandit_intro_1", "str_bandit_outro_1"),
(str_store_string, s5, ":intro"),
], "{s5}", "bandit_talk",[[b](play_sound,"snd_encounter_bandits")[/b]]],
Moshein_Gunn said:But can I do it like that for each option or can you only put the script at the end and use it for all options?
("mmm",sf_priority_9|sf_vol_9, ["mmm.ogg"]),
("sigh",sf_priority_9|sf_vol_9, ["sigh.ogg"]),
xenoargh said:Module_strings is basically just a giant data dump; it's no sweat. Calling a sound right before you call a string isn't a big deal- if it's for a Menu / Dialog that will show next, just add a quarter-second delay to the sound so that it seems to happen simultaneously with the action.
[party_tpl|pt_village_farmers,"start", [(eq,"$talk_context",tc_party_encounter),
(agent_play_sound, "$g_talk_agent", "snd_encounter_farmers"),
],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(eq, "$g_talk_troop_met", 0),
(troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
(str_store_string, 5, ":intro"),
(str_store_party_name, 20, "$g_encountered_party"),
],
"{s5}", "companion_recruit_intro_response", [
(troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
]],
[anyone|plyr, "companion_recruit_intro_response", [
(troop_get_slot, ":intro_response", "$g_talk_troop", slot_troop_intro_response_1),
(str_store_string, 6, ":intro_response")
], "{s6}", "companion_recruit_backstory_a", []],
"{s5}", "companion_recruit_intro_response", [
(troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
(store_sub, ":offset", "$g_talk_troop", companions_begin),
(val_add, ":offset", "snd_npc1_squeal"),
(agent_play_sound, "$g_talk_agent", ":offset"),
]],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(eq, "$g_talk_troop_met", 0),
(troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
(str_store_string, 5, ":intro"),
(str_store_party_name, 20, "$g_encountered_party"),
(try_begin),
(eq, "$g_talk_troop", "trp_npc3"),
(play_sound, "snd_squeal_like_a_little_girl"),
(try_end),
],
"{s5}", "companion_recruit_intro_response", [
(troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
]],
[anyone|plyr, "companion_recruit_intro_response", [
(troop_get_slot, ":intro_response", "$g_talk_troop", slot_troop_intro_response_1),
(str_store_string, 6, ":intro_response")
], "{s6}", "companion_recruit_backstory_a", []],
"companion_recruit_intro_response", [
(troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
(try_begin),
(eq,"$g_talk_troop","trp_npc3"),
(play_sound,"snd_screamofjoy"),
(else_try),
(eq,"$g_talk_troop","trp_npc7"),
(play_sound,"snd_sigh"),
(try_end),
]],
"companion_recruit_backstory_a", [(troop_get_slot, ":backstory_a", "$g_talk_troop", slot_troop_backstory_a),
(str_store_string, 5, ":backstory_a"),
(str_store_string, 19, "str_here_plus_space"),
(str_store_party_name, 20, "$g_encountered_party"),
(store_sub, ":offset", "$g_talk_troop", "trp_npc3"),
(val_add, ":offset", "snd_npc3_mmm"),
(agent_play_sound, "$g_talk_agent", ":offset"),
],