Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: additional dialogue
| Re: New feature: additional dialogue[message #358587 is a reply to message #358195]
|
Tue, 03 December 2019 00:15 
|
|
| Flugente |
 |
Messages:3499
Registered:April 2009 Location: Germany |
|
|
So closely tied to this feature it might as well be a part of it, we can now replace lines a character says. Quite useful if, say, you are creating a new character from scratch and find that for some lines, you have several good ones and you don't want to sacrifice one.
For this purpose I added a new function in Overhead.lua, HandleReplaceQuote(...):
Toggle Spoiler
-- This function is used to replace dialogue quotes with new ones. This way we can have more variety - a merc doesn't always use the same lines when something happens.
-- If a line isn't replaced, it plays normally, so it is a good idea to not always replace lines.
--
-- functions used here:
-- path: path and name of soundfile we want to play (in .wav, .ogg or .mp3 format)
-- text: "Text that should appear"
-- SetReplaceDialogue(path, text)
-- Do not use this function in any lua calls outside of HandleReplaceQuote(..)!
--
-- handle
-- ubProfile is the merc for whom this is called
-- usQuoteNum is the quote that the game wants to play
function HandleReplaceQuote( ubProfile, usQuoteNum )
...
elseif ( ubProfile == Profil.WIDOW ) then
if ( usQuoteNum == Voiceline.QUOTE_KILLED_AN_ENEMY ) then
-- select comment at random
choicenr = math.random(1, 15)
if ( choicenr == 1 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_Ça_pique,_n'est-ce_pas_it_stings_doesnt_it.ogg", "Ça pique, n'est-ce pas?")
elseif ( choicenr == 2 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_did_that_hurt.ogg", "Did that hurt?")
elseif ( choicenr == 3 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_a_beautiful_death.ogg", "A beautiful death.")
elseif ( choicenr == 4 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_did_that_sting.ogg", "Aww, did that sting?")
elseif ( choicenr == 5 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_grounded.ogg", "Grounded.")
elseif ( choicenr == 6 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_i_always_hit_my_mark.ogg", "I always hit my mark.")
elseif ( choicenr == 7 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_next.ogg", "Next.")
elseif ( choicenr == 8 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_one_after_another.ogg", "One after another.")
elseif ( choicenr == 9 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_the_huntress_gets_her_prey.ogg", "The huntress gets her prey.")
elseif ( choicenr == 10 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_the_widows_kiss.ogg", "The widow's kiss.")
elseif ( choicenr == 11 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_too_easy.ogg", "Too easy.")
elseif ( choicenr == 12 ) then SetReplaceDialogue("Speech//Additional//Widow//kill_une_balle_un_mort_one_shot_one_kill.ogg", "Une balle, un mort.")
end
...
In the above example, a merc now has more to say after killing an enemy than just the same old line. This works for every voice line and every character.
While I strongly recommend to always use fitting GameDir data with an .exe, in this case the code is more tolerant. If the function isn't present in your outdated Scripts folder, nothing will happen.
Added to the code in r8712 & GameDir r2497.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
 |
|
New feature: additional dialogue
By: Flugente on Thu, 11 January 2018 01:37
|
 |
|
Re: New feature: additional dialogue
By: Randok on Thu, 11 January 2018 12:14
|
 |
|
Re: New feature: additional dialogue
By: Flugente on Mon, 15 January 2018 22:52
|
 |
|
Re: New feature: additional dialogue
By: Flugente on Wed, 28 February 2018 22:35
|
 |
|
Re: New feature: additional dialogue
|
 |
|
Re: New feature: additional dialogue
By: townltu on Tue, 26 June 2018 13:08
|
 |
|
Re: New feature: additional dialogue
|
 |
|
Re: New feature: additional dialogue
|
 |
|
Re: New feature: additional dialogue
By: Flugente on Mon, 21 January 2019 21:31
|
 |
|
Re: New feature: additional dialogue
By: ZedJA2 on Fri, 04 October 2019 03:38
|
 |
|
Re: New feature: additional dialogue
By: ZedJA2 on Fri, 04 October 2019 09:00
|
 |
|
Re: New feature: additional dialogue
By: Flugente on Tue, 03 December 2019 00:15
|
 |
|
Re: New feature: additional dialogue
By: Kitty on Thu, 05 December 2019 09:50
|
 |
|
Re: New feature: additional dialogue
|
Goto Forum:
Current Time: Sun Jun 07 02:25:47 GMT+3 2026
Total time taken to generate the page: 0.00641 seconds
|