Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: additional dialogue
New feature: additional dialogue[message #351982] Thu, 11 January 2018 01:37 Go to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Each of our mercenaries has up to ~145 soundfiles. While that seems a lot (especially when you create new ones from sound files out of other games that somehow have no file for their character announcing they'll go to sleep), more would be better. Of course, given that there are so many different situations where a file would or would not fit, this is hard to simply code in. Additionally, standardization of files (which file is played when) would be equally annoying. Even more, text translations are stored in .EDT files. In case you want to hear a 5-minute rant from me on why .edt files are suboptimal, ask me on Discord.

Anyway, thus the solution is to move the entire part of who says what when to a lua function. That way modders can decide exactly that. So I did. Which is what this feature is. For obvious reasons we have no additional dialogue for existing mercs (if we had, it would already be in the game and not be additional, no?). So while creating new mercs out of Mass Effect Andromeda, I also added extra dialogue for them to demonstrate this.



If you are familiar with JA2 (which you are, because you are here), you will notice that these mercs use more lines than normally, and even do so in response to other mercs. This is all defined in lua. To be precise, in Overhead.lua:
Toggle Spoiler

Basically, HandleAdditionalDialogue is called upon several actions, and allows one or more mercs to say a line. See the comments in the script on what the arguments mean. We can either let a merc talk, like

SetAdditionalDialogue(ubProfile, iFaceIndex, "Speech//Additional//Lara//snowstorm1.wav", "I'm gonna freeze to death out here.")


or just play a simple sound file (in the video we do so when we enter the non-profile merchant's inventory)

PlaySound("Speech//Additional//Sara//merchant15.wav")


The function is called upon the following events:
  • a merc discovers a room. In the video Scott sometimes talks about the contents of rooms he discovers. We only do so the first time the room is entered at all, otherwise this would get annoying very fast.
  • another merc uses a voice line. In the video, Sara comments upon meeting Pacos, Fatima and Ira, Scott comments on Ira running out of ammo & Sara talking to herself, while Shepard isn't too happy with Ira for insubordination ;-)
  • mercs drop into Omerta. Normally only IMPs do a voice line in that case - here Lara, Sara & Scott also do so.
  • mercs enter a new sector. This is similar to the comments rebels like Ira give on some sectors.
  • a merc deals with a non-profile shopkeeper (like the wheelchair dude in the basement). You do know about that feature, do you?
  • We use friendly/direct/threaten/recruit/repeat choice in dialogue. Provided you have enough voice files, this means you can make the entire dialogue system fully voiced.
  • We successfully recruit an RPC, as seen with Ira, Sara & Shepard. This would also work via intercepting the voice line, but as the actual numbers of the specific line differ from RPC to RPc, this is a convenience option.
  • We have sex. Yup. This is kinda amusing to mod, as these files weren't exactly used with that usage in kind originally. Context matters! angel
  • The weather in sector the merc is changes, as seen at the end of the video.
  • We use a skill, like Sara's radio skills.
  • A delayed grenade is dropped nearby, as demonstrated by Scott on Lara & Shepard.
  • We consume an item (applying camo/food/drink/elixir/clothes/drugs), can be used for specific items.
Of course many more events are thinkable (I assume this thread will see some ideas in that regard). But I think the point should be clear by now.

The sound files itself can be stored and named however the modder likes. I propose using Speech/Additional/name of merc/name of file that is meaningful.ogg or .wav.

As these mercs are obviously not of JA-canon, they will obviously not enter any official 1.13 release, but of course the script with descriptions will (lua will still require the new function to be present, even if it's empty). There are also no options here. If you don't want the sounds, just empty the function contents.

I am somewhat positive this will be useful to future modders. I only really fleshed out Sara, the other mercs are still somewhat limited in what they say, but now I need a few weeks away from listening to endless amounts of .wav files, and look forward to coding something else.

This is fully savegame compatible.

This has been added to the trunk in r8516 & GameDir r2400. Using the new exe without the new GameDir will get you a rating of 13 on Metacritic.

[Updated on: Wed, 28 February 2018 22:36]




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

Captain

Re: New feature: additional dialogue[message #351990 is a reply to message #351982] Thu, 11 January 2018 12:14 Go to previous messageGo to next message
Randok is currently offline Randok

 
Messages:323
Registered:March 2004
Introducing new weather conditions is very interesting. It would be nice to make a fog (in the whole sector or in a selected area, for example a river, a lake, a swamp).
Sandstorm in the desert.



Many thanks to all those who make new features for Jagged Alliance 2.

Report message to a moderator

Master Sergeant
Re: New feature: additional dialogue[message #352041 is a reply to message #351990] Mon, 15 January 2018 22:52 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
We already have some of that. I've thought about fog, but that either requires altering the palette, which requires reloading tactical at minimum, or making heavy use of overlays, which will still look... off.


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

Captain

Re: New feature: additional dialogue[message #352585 is a reply to message #352041] Wed, 28 February 2018 22:35 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As of r8531, we can also play sounds when consuming items (applying camo/food/drink/elixir/clothes/drugs), the dialogue event is
ADE_CONSUMEITEM = 15,					-- we applied an item to us, aData1 is the item index



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

Captain

Re: New feature: additional dialogue[message #353831 is a reply to message #352585] Tue, 19 June 2018 00:26 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Thanks to townltu providing Wizardry8 sound files, I have added a few additional dialogue files for Buns in GameDir r2428, so now we have an example of how this works in stock. Mind you though, these aren't many files - the original files were for a chaos follower, so most of them don't fit her personality that well.

Unless, similar to Larry's drunken personality, I also code a personality change for her, but except for alcohol, she yearns for blood devil suprised

Food for thought...

Anyway, this should provide a good stock example of how this works.



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

Captain

Re: New feature: additional dialogue[message #353890 is a reply to message #353831] Tue, 26 June 2018 13:08 Go to previous messageGo to next message
townltu

 
Messages:384
Registered:December 2017
Location: here
Can you add another action event to trigger specific speech,
of which the game is already "aware" of, i.e. when merc is hit by friendly fire?


There is the option to trigger speech on entering a sectors building with specific number,
while Skyriders speech is, as far as i can see, triggered by distance to specific tile id,
so is there already a way to use skyriders (assumed by me;) tile specific function
if [profile&sector check] == true and [PythSpacesAway( Profil.[charName],[tile_ID] ) < [distance_in_tiles] ...
somehow in DialogActionEvent or would that require additional coding?


Besides& somewhat OT, ADE_sector_commentary is not entirely limited to one comment per sector,
if imp makes sector comment we can add ADE_dialogue_reaction to trigger a rebels sector comment.

Report message to a moderator

Master Sergeant
Re: New feature: additional dialogue[message #353895 is a reply to message #353890] Tue, 26 June 2018 23:31 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Both triggers are doable, I'll check it out when I have the time.


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

Captain

Re: New feature: additional dialogue[message #354133 is a reply to message #353895] Tue, 24 July 2018 00:05 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As of r8585, we have another event: mercs can comment on the death of another character. Example will be added soon-ish.

Given that a buddy relation has 4 soundfiles, 2 of which are contract-related and thus rarely heard, I'm toying with the idea of also allowing a 'Witnessed merc killing someone/succeeded at doing stuff' comment... that would effectively allow us to circumvent the 5+1 buddy limitation (apart from the mentioned contract-related shenanigans). Not that we have that many soundfiles, but I guess I could scrap some more together for Shepard. Decisions, decisions...



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

Captain

Re: New feature: additional dialogue[message #356522 is a reply to message #354133] Mon, 21 January 2019 21:31 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
I'm still alive! Also, as of r8648 & GameDir r2458, we have several new additional dialogue events, many of them seen TODO LINK:

  • a merc can comment upon someone passing a skillcheck or being observed killing someone. This also works for the observer themselves, which is why Max Payne now has 50+ lines commenting his kills big grin
  • a merc can comment upon starting/finishing bandaging, and starting/finishing receiving bandaging. Which is why Mercy will happily chat away whiel treating your mercs.
  • the original comment upon landing in Omerta has been expanded - it now kicks in any time someone arrives in Arulco.
Remember that any buddy relation only has up to 4 sound files:

  • comment upon buddy dying
  • 'witnessing' (Sirtech Fury Road fandom confirmed) buddy passing a skillcheck/getting a kill, only plays once per day
  • agreeing to contract only because buddy is here (AIM only)
  • agreeing to renew contract only because buddy is here (AIM only)
It's easy to see that the first two can now be recreated with additional dialogue, while the latter two are only relevant for AIM mercs and even then are used very rarely. This means we can now set up mercs to be buddies with as many people as we like (provided we have fitting soundfiles).

As for hatreds, there are four files as well:

  • comment upon hatred arriving in country
  • stating how much you hate them due to internal hatred reaching notable threshold
  • refusing contract because hatred is here (AIM only)
  • refusing to renew contract because hatred is here (AIM only)
The first one is easily doable via dialogue event, the other two not really at this point... but as there are so many events, one can easily play a file when a merc's hatred says or does something. See my mercs, there are quite a few examples in there.

[Updated on: Mon, 21 January 2019 21:39]




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

Captain

Re: New feature: additional dialogue[message #358192 is a reply to message #356522] Fri, 04 October 2019 03:38 Go to previous messageGo to next message
ZedJA2

 
Messages:202
Registered:January 2018
There are currently several problems with using the Additional Dialog feature with the various Additional Mercs. Kermi Server is down, a declared variable or parameter is renamed in the Overhead.lua from the Additional Mercs version to the current SCI release GAMEDIR, and so on. I go into much greater detail in the post linked below. The main issue is finding the most current download of the full Additional Mercs to merge with the GAMEDIR of current SCI, as the Overhead.lua has to be rebuilt to work correctly:

[url=http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23994&goto=358191&#msg_358191]

http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23994&goto=358191&#msg_358191
[/url]

If anyone can point to a new link to replace the Kermi Server link and point to that, it would help greatly to keep Flugente's great work alive to enjoy. Thanks ahead of time to all.

[Updated on: Fri, 04 October 2019 03:40]

Report message to a moderator

Sergeant 1st Class
Re: New feature: additional dialogue[message #358195 is a reply to message #358192] Fri, 04 October 2019 09:00 Go to previous messageGo to next message
ZedJA2

 
Messages:202
Registered:January 2018
Found the new link to a backup server for the Kermi Server that had the files. The files are also more up to date (dated as modified only 20 days ago). There are, as before on Kermi Server, plenty of other files here as well worth browsing thru. It is organized similarly to the OneDrive Server, but has many other files. Here is the direct URL for Flugente's Additional Mercs (you can also find it off the Flugente folder, there are other mods here as well):

https://storage.rcs-rds.ro/links/4729f8d6-f44b-42b7-aa3e-e0ddc6deead6?path=%2FJA_2%2FMods_v1.13%2FFlugente%2FAdditional_ Mercs

I am currently downloading it. But since it took me some time to find the info, I figured I'd place it in the necessary Thread here and in Additional Dialog features on the Flugente Magicka Workshop.

There is also an archive of previous versions of the file for those using other release versions of JA2v113. I placed a copy of this post over in the Mercy (Overwatch) thread as well, just in case.

Report message to a moderator

Sergeant 1st Class
Re: New feature: additional dialogue[message #358587 is a reply to message #358195] Tue, 03 December 2019 00:15 Go to previous messageGo to next message
Flugente

 
Messages:3507
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

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. happy

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

Captain

Re: New feature: additional dialogue[message #358599 is a reply to message #358587] Thu, 05 December 2019 09:50 Go to previous messageGo to next message
Kitty

 
Messages:473
Registered:October 2017
Location: Germany
Flugente wrote on Tue, 03 December 2019 00:15


... For this purpose I added a new function in Overhead.lua, HandleReplaceQuote(...):

...
Is there a way to use this for text that shows up in merchants dialogue?

Like in when we make a npc to be an additionalDealer and the inventory pops up.
Depending on who is chosen, those lines can be rather unfitting for a merchant/dealer.
So I wonder, if this feature might be used for replacing those lines with fitting ones?

I made Jenny a dealer for medical stuff and disease countermeasures like facemasks and gloves
and would like to see a wellcome line (which she has) instead of the line about the virus.

Is there a chance/way to use this feature for this outcome?




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: New feature: additional dialogue[message #364260 is a reply to message #351982] Sat, 29 January 2022 13:06 Go to previous message
No-Nothing is currently offline No-Nothing

 
Messages:81
Registered:March 2013
Hello! Great Job! As Always!
I'm quite interested in HandleReplaceQuote function, want to give it a try. But how do I know this part "usQuoteNum == Voiceline.xxx" for all 149 standard lines? Can someone share the list? And I sure would want to know the commands for "BattleSNDS"!
Also I am intimidated by method used, like stirring insides of critical file "Overhead.lua". Why not to make separate files for such secondary purposes? Or at least some kind of incremented files like "Overhead_001.lua,Overhead_002.lua...". It would make this work convenient and sharing too... what is highly expected for voicesets.

[Updated on: Sat, 29 January 2022 13:18]

Report message to a moderator

Corporal 1st Class
Previous Topic: Absurdly small code changes
Next Topic: New feature: Covert operations
Goto Forum:
  


Current Time: Mon Nov 11 20:17:05 GMT+2 2024

Total time taken to generate the page: 0.01070 seconds