Jump to content
Official BF Editor Forums

Different Voices per soldier


Recommended Posts

This will be a weird one.

Basically I have 3 characters assigned to one team, and I want each to play different set of VOs. So far this has been stupidly difficult.

Death sounds are easy, as they are assigned in each soldier's tweak file. DONE! Finished! Hurrah!

Injure noises are a little harder. They are assigned by each kit. So have a separate kit per character. Weapon pickups are going to break this unless we can build something fancy in the python coding to swap out the kits on pickup to the version with the correct VOs attached. Option 2 is to have python cliently change these on each pickup. Since injure sounds are played through the client it shouldn't affect other players to have python change it for them locally. Sadly the later sounds easier in concept, but a pain in the butt to code, with a small risk to change everyone's injury sounds each time someone picks up a kit if I am wrong.

Then comes the rest of the voicelines. BF2 sets these up per faction...... WHY?! Why couldn't they just make it ask for a class in the soldier's tweak that set which voice?! The only thing I can imagine is that they didn't set up functionality for it to check per player who is what voice? Maybe they thought that would sound confusing in a ranked match? Still why not leave the functionality to do it like they did with all the other noises?

Rant aside, this leaves very few options, most more speculation. My current thought is to find a way to make every "character" a separate faction. This sounds near impossible though because the level only sets 2 factions. I havn't tried adding more than 2, but I doubt it would work. Another idea I had was to try having python switch gameLogic.setTeamLanguage 2 "English"  over the client. but I realized later that that would make all teammates use the clients current set of voices for all characters. That won't work for what I need. So that leaves the possibly very tedious method of bypassing the entire voice system. basically remove all voices and write a huge chunk of python to play the sound files when those events are activated. It would work, it would also be a massive pain in the ass (excuse my language). I also hate jumping on the python bandwagon for every issue I have. Unfortunately, python can bypass nearly every limitation this game tends to throw at you in modding.

First I want to see if anyone has ever heard of a different way to bypass this. I know EoD had a female soldier for the NVA, but I can't remember if she used the same voice lines as her teammates. At the very least I want to know if any other longtime BF2 modders have any other outside the box ideas.


To those of you who remember me and UberWazuSoldier, HI! hope you are all doing well. It's been a damn long time.

And to those I do not know or have not met, that are still around on these forums. Hello! Glad to see modders still at it. I can try to help any new modders out there. I know a lot about the audio system and setting up HUDs in BF2. I never really posted around here back when we modded, but I know Uber put up plenty of tutorials that I see are still around. Glad to see them still in use.

Link to comment
Share on other sites

Sorry for the delayed response. Mostly all voices. I did realize I made a slight mistake with the OP. Injury sounds are in GameSounds.con Trying a few things with that currently..

But basically here is what is going on. For Operation Dead Dawn, we had 3 playable survivors, 2 male and 1 female. The plan was to have each soldier have a different sounding voice (so pretty much all VO lines) I currently have recordings for all the lines for 1 male and 1 female done by 2 friends recorded some time ago. I can write the list of voice lines but it's quite a few


That's not including death and injury sounds.

These are of course my own naming system with some that are mod specific, also I have each of these twice because I have a male version and a female version. Currently male is under the Common/Sound/English and Female is under Common/Sound/EU this is just for testing. I just have to switch out the map's Team1 language from English to EU or vise versa to switch. All recordings work (some need some fine tuning, but the files play correctly) I just want to find a way to use both in the same faction. When a soldier speaks having it use their set voicelines instead of ALL US faction using the same grunt voicelines.

Link to comment
Share on other sites

I have no idea if this will work as I havent tested it,but

Commrose sounds are called by the HudElementsRadioComm.con

Each button calls for text like this

hudBuilder.setButtonNodeConCmd        "RadioInterface.selectOrder 10" 0


Which leads to Radio.con

radioInterface.setStringMap Interface_1:10 HUD_COMROSE_GRUNT_thankyou        "game.radioMessage TCTeamAndLocalEnemies PLAYER_CONFIRM_thankyou"


If,maybe if,you specify a unique GUI number for each soldiers handweapons,which matches a GUI number specific commrose,and replace this


hudBuilder.setButtonNodeConCmd        "RadioInterface.selectOrder 10" 0


With something like this


hudBuilder.setButtonNodeConCmd        "sound.playSound Female_Thankyou" 0





Link to comment
Share on other sites

Interesting idea. That will lead to other issues if it works, but issues that are much easier to handle. That won't solve "Auttomatically Triggered" event voices, but again, we do have another idea to make that work through pybool and the award system. The draw back of that method is the amount of coding and time it would take to setup, so this could cut that work by a ton if that works. Even at worst, most the auto triggered events we may not even need XD.I'll get back to you as soon as I try that out.

Link to comment
Share on other sites

Whoops ok I'm clearly rusty at this. Which number above is the GUI number? in this case the "0" on the end of each line? I see 1-59 are all used. I used to be so familiar with HUD stuff, heck I have a fairly modified HUD for the mod that I made years ago still working just fine. I mainly changed up the spawn screen quite a bit. I do have an issue with the commorose where moving the mouse in the direction of the buttons can put it past the button sometimes. I feel like this issue was related with playing widescreen, again it's been too long since I've tinkered with HUD things now.

Link to comment
Share on other sites

Basically you are making several commroses,that are only shown ingame,when a player is holding a specific handweapon

hudBuilder.setNodeLogicShowVariable         EQUAL GuiIndex 666

Yes I know pickup kits/drop kits will mess things up

Do you want this for humans,bots or both ?


This controls the area the cursor can move to

hudManager.setCommSize            490 300

By default the area the cursor can move,is much larger then the position of the buttons  hudBuilder.setButtonNodeMouseArea

hudBuilder.createButtonNode         RadioRose RadioDownLeft 181 324 190 26
hudBuilder.setButtonNodeMouseArea     -46 49 190 103

Edited by DEVILMAN
Link to comment
Share on other sites

I thought it used to not be bigger like that, pretty easy fix with some math though.

I see what your saying. That is pretty damn brilliant. Kits drops won't be that big of a problem really. I mean yes it will take some work, but a pretty fair trade off. We already have a check in python that checks to see what is picking up the kit to keep zombies from picking up guns and shooting everyone. So it should be relatively easy to add an elseif to check which survivor is picking it up and giving them the correct version of the kit instead (I'd just have multiple versions of each kit copy and pasted with the different GUI set for each.

It will be for AI and bots. Again only one faction is set to be able to pick up the kits anyways, so It will only be the players plus MAYBE 1 teammate bot.

If we get this working I will try and post the python code if anyone want's to see how we go about it.

Thank you again for the help Devilman

Link to comment
Share on other sites

If the area on the screen of all the commrose buttons is say 400 x 300
Your mouse/cursor can move say 600 x 450

Meaning each button has a larger clickable area ,then the visual/measured size of its button,making selection less sensitive


hudBuilder.createButtonNode         RadioRose RadioDownLeft 181 324 190 26
hudBuilder.setButtonNodeMouseArea     -46 49 190 103

Button is 26 pixels tall,clickable area is 103 pixels tall

Link to comment
Share on other sites

The overall idea for fixing the voices works, but also doesn't work.

 "sound.playSound Female_Thankyou" 0 plays a client side sound. I realized that before even putting it in. There is a work around for that, but it involves making a bunch of "fun" changes If you want I can detail them all. Right now I havn't had a version of it work eactly so I'm holding off. You wind up having to change so many files, that it is easy to get an error. I don't have BF Editor installed yet so I don't get the luxury of having bf2_r to tell exactly what broke, but it has something to do with objects, most likely the weapon when I added the unique GUI.

That being said having them work that way has some pretty huge drawbacks. This won't solve voices for automatically triggered voicelines "Grenade!, "Clear!", "Recharging!", "Have first aid!", etc also page up and page down don't work for that method. This means pyBool way be the better option in the long run for what we will end up needing it for.

I have not tried changing the button sizes for the commorose, but that was more or less what I was thinking of doing. Thank you again for the help thus far.

Link to comment
Share on other sites

There is absolutely no way that a unique GUI for a handweapon,or any other item can cause any issues

I have hundreds of them,without a single issue


Try renaming this,and adding it to automatically triggered voices renamed

rem ---BeginComp:Radio ---
ObjectTemplate.createComponent Radio
ObjectTemplate.Radio.failMessage recharging_female
ObjectTemplate.Radio.useMessage AUTO_MOODGP_usingshockpaddles
rem ---EndComp ---


I think, with a bit of "thinking outside of the box", more can be acheived then you would assume

Link to comment
Share on other sites

I'm not saying the GUI was the cause, It's more likely I didn't initiate something correctly, I was typing all of that in on very little sleep, and with so many files I was dealing with again it's possible it didn't compress to the zip correctly. That will cause any file to react exactly like that, I just didn't take the time to go through each one and make sure they were all added correctly. It's not that I'm not thinking outside the box, It's just not a gamebreaking feature. I'd like it to work, but we have a lot of other things to work on as well, so I havn't fully devoted my time to it. The method UberWazuSoldier wants to use is pretty interesting, and it's something we discovered back when we proved a campaign could be scripted into BF2.
You would code all the situations that would play all the sounds into pyBool and when the conditions are met it would give each player an award. Each "award" can be set to have a separate image and sound used. What makes this kind of extra awesome is you can switch the medals with character portraits and have the text what is being said. The award system leaves an insane amount of things you can put into it. Well over 200, with pyBool being able to define them per map as well. You would just remove all of the voice files and have pyBool read what localization is asking for when a comm is attempted to be played. The ONLY drawback is the amount of coding to set it up, but once set up it becomes easier to modify and change.

Again I'd still like to try your idea, and I certainly will, I only spent about an hour on that first attempt, I just have to prioritize gameplay first if I want to get our mod in a more complete state. Right now I've been improving our AI and had a small problem with that, but I know the issue is related to something we previously made, not with BF2 itself.

Anyways, thank you again for the help. I'll post here again as soon as I take another shot at it. I might try again if I need a break from another portion of the mod. I kept all the coding from my previous attempt, so I may go DL the editor and see what error it is giving.

Link to comment
Share on other sites

  • 1 month later...

I don't think using the active weapon to change the HUD will work when you enter vehicles.

Also if this is an online mod I don't think you can modify the language as that's a client-side variable AFAIK.

Some ideas...

Create a vehicle with no model that plays different sounds depending on the health. Use voice overs as the damage sounds. Spawn with python and set health depending on event.

Force certain soldiers into being squadleader and use the squadleader voice over.

Use radio filters as actual voice overs. (gamelogic.messages.addRadioFilter "heli" "Sound/VO/Activate_radio.wav")

Modify server binary to override voice overs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...