Some Idiot's Halo 4 mods. (WIP)

Some Idiot

New Member
Hey everyone! This thread will be where I post all of my mods here when I get the chance. Please give me your thoughts on anything that needs to be Fixed or changed.

CTF Flag Taken sound mod.
https://mega.co.nz/#!tIFnTLLT!fqSMQAQM_Ae1IonzqokBkV0-k1xKFZeU8F9mP9FQYc0

READ! There is a small problem that causes the game to play the Enemyflagtaken sound when a flag is grabbed in OD. Also the instructions to install the mod are included in the rar file.

Credit goes to Mizzu for Creating the scripts and Belberith for helping us use the correct lines in the scripts.

Player and weapon sounds mod.
to install place the sound folder in Legions/Game/legions/Data
https://mega.co.nz/#!YBl2QJpS!bT3-8l8cBtwIGjf_xzpus2jX-fhr7bQxO8zac9b8rdE

READ! Some sounds will seem louder but you will just have to change your audio settings. Please give me your thoughts on anything that needs to be Fixed or changed.
 
Last edited:

SNAKEOPS

Member
I got to try this mod out, and I didn't really enjoy it because the rocket sounds were too loud, it pretty much was louder than all the other sounds. Also, the jet sounds were similar to rockets too?
 

Mizzu

New Member
hi

you asked ingame whether it was possible to get a "your flag was taken" sound when someone grabs your team's flag so you actually now which flag was grabbed. I looked into that since I'd like to have that as well. Here's what I found out:

As of now the game only uses one file for both teams that plays when any flag is grabbed (\live\legions\data\sound\game\CTF\Flagtaken.mp2). Changing it to give each team an own file requires coding. I've skimmed through the files a bit and found the following lines in Legions Overdrive\live\client\scripts\message.cs:

Code:
addMessageCallback("MsgCtfFlagGrab", handleMsgCtfFlagGrab);
function handleMsgCtfFlagGrab( %msgType, %msgString, %team, %client, %speed, %flagTeam )
{
  %client = replaceTeamStrings(detag(%client));
  %team = replaceTeamStrings(detag(%team));

  sfxPlayOnce(CtfFlagTakenSound);
  clientCmdTopPrint(%team@" Flag Was \cp\c5\Grabbed\co By "@%client, 2000, 1);
}

Note the line sfxplayonce(ctfFlagtakenSound);. This tells the game to play the sound profile ctfFlagtakenSound as soon as any flag is grabbed. The profile is defined in \client\scripts\audio\profiles.cs. It looks like this:
Code:
new SFXProfile(CtfFlagTakenSound)
{
filename = "legions/data/sound/game/ctf/FlagTaken" @ $profileAudioExt;
description = AudioGameEvent;
preload = true;
};

If I understood all of this correctly you'd need to do the following now:
- Create a new sound profile in profiles.cs so you can put in a second file like flagalert2 or something. This is easy. I could do that.
- Create a new message in messages.cs that plays the new sound file when your flag is grabbed and modify the existing one to play the old soundfile when the enemy's flag is grabbed. I have no idea how to do this.
- Put the correctly named sound file into \live\legions\data\sound\game\CTF. Easy as pie.

In messages.cs, there are also different messages for Lama grabs, OD grabs etc. The one in the code above is only for normal grabs. The other ones would need editing too, but that would mainly be a copy-paste job and not actually hard. Those are the different messages, their code looks like the one above, so I didn't post it:
addMessageCallback("MsgCtfOdGrab", handleMsgCtfOdGrab)
addMessageCallback("MsgCtfLlamaGrab", handleMsgCtfLlamaGrab)
addMessageCallback("MsgCtfFlagCatch", handleMsgCtfFlagCatch)
addMessageCallback("MsgCtfFlagPickup", handleMsgCtfFlagPickup)

The catch and pickup messages currently have the sound disabled, but that would be easy to fix too. The lines are there but designated as comments.

Edit: Already had an idea so you don't have to actually create a new message: use an if function for the line sfxPlayOnce(CtfFlagTakenSound). Said function would look like this, maybe:
Code:
if (???)
sfxplayOnce(ctfFriendlyFlagTakenSound)
otherwise
sfxplayOnce(CtfFlagTakenSound)

whereby ??? would be something that uses the information which flag was actually grabbed. Maybe just %team, since that is 1 (which means true for the if function) for your team and 0 (which means false) for the enemy team i think?
 
Last edited:

Mizzu

New Member
I tried to get it to work, and everything worked out fine except what variable to use in the if statement. It should be one that gives "true" or "false" depending on which flag was grabbed. I can't find it out, but if anybody who knows is reading this, a bit of help would be appreciated.
 

Mizzu

New Member
see above. My goal is to have the game play a different sound when the player's flag is taken. Brief summary:

I'd like to edit the following section of live\client\scripts\message.cs:
Code:
addMessageCallback("MsgCtfFlagGrab", handleMsgCtfFlagGrab);
function handleMsgCtfFlagGrab( %msgType, %msgString, %team, %client, %speed, %flagTeam )
{
  %client = replaceTeamStrings(detag(%client));
  %team = replaceTeamStrings(detag(%team));

  sfxPlayOnce(CtfFlagTakenSound);
  clientCmdTopPrint(%team@" Flag Was \cp\c5\Grabbed\co By "@%client, 2000, 1);
}

Now I want to change the line sfxplayonce(ctfFlagtakenSound); to look like this: ((???) being the part I don't know what to put in)
Code:
  if (???)
  sfxPlayOnce(CtfFriendlyFlagTakenSound);
  else
  sfxPlayonce(CtfEnemyFlagTakenSound);
This, once working, should tell the game which sound to play depending on which flag was grabbed.
 

Fixious

Test Lead
I think the Blaster firing sound is a bit too long. It'd sound better if it were just the first part of the sound file.
 

Some Idiot

New Member

Fixious

Test Lead
Yes and no. There's a way to change it, but it'll only work on your server. It requires creating a new specific profile for the boost sound, which is actually pretty easy to do. But as it stands this is a server-side thing and any changes you make won't be played on any server but your own.
 
Last edited:

Belberith

Legions Developer
Now I want to change the line sfxplayonce(ctfFlagtakenSound); to look like this: ((???) being the part I don't know what to put in)
Code:
  if (???)
  sfxPlayOnce(CtfFriendlyFlagTakenSound);
  else
  sfxPlayonce(CtfEnemyFlagTakenSound);
This, once working, should tell the game which sound to play depending on which flag was grabbed.
The variable on the client storing which team you are on is $CurrentTeam. So your if statement should be:
Code:
if (%flagTeam == $CurrentTeam)
EDIT: Should be %flagTeam, not %team
 
Last edited:

Belberith

Legions Developer
Oops, %team is a string. Use %flagTeam instead of %team:
Code:
if (%flagTeam == $CurrentTeam)
sfxPlayOnce(CtfFriendlyFlagTakenSound);
else
sfxPlayonce(CtfEnemyFlagTakenSound);
 

Some Idiot

New Member
So it should look like this?

{
%client = replaceTeamStrings(detag(%client));
if (%flagTeam == $CurrentTeam)
sfxPlayOnce(CtfFriendlyFlagTakenSound);
else
sfxPlayonce(CtfEnemyFlagTakenSound);
clientCmdTopPrint(%team@" Flag Was \cp\c5\Grabbed\co By "@%client, 2000, 1);
}
 

Some Idiot

New Member
Well I tried what I posted above but no sound played under the circumstances that it should. I think it is only because I am doing it wrong. Help please?
 

Mizzu

New Member
I tested it for a few games now and everything works as intended for me except OD flag grabs will always cuase the game to play the Enemyflagtaken sound which means that OD grabs always return a false on (%flagTeam == $CurrentTeam).

Anyway, I uploaded the necessary .cs files to pastebin as of their current state.

Profiles.cs (this is located in live/client/scripts/audio)

Message.cs (this is located in live/client/scripts)

Now you need an enemyflagtaken.mp2 and a friendlyflagtaken.mp2 and put them into live\legions\data\sound\game\CTF

A player on Red picks up the Blue flag and only the player who picked it up hears "Carrying flag"

Someone has already made that and I use it. You can find the mod here. With our current changes this will also play Enemyflagtaken.mp2 for the carrier though. So you hear both files simultaneously.
 

Some Idiot

New Member
I tested it for a few games now and everything works as intended for me except OD flag grabs will always cuase the game to play the Enemyflagtaken sound which means that OD grabs always return a false on (%flagTeam == $CurrentTeam).

Anyway, I uploaded the necessary .cs files to pastebin as of their current state.

Profiles.cs (this is located in live/client/scripts/audio)

Message.cs (this is located in live/client/scripts)

Now you need an enemyflagtaken.mp2 and a friendlyflagtaken.mp2 and put them into live\legions\data\sound\game\CTF



Someone has already made that and I use it. You can find the mod here. With our current changes this will also play Enemyflagtaken.mp2 for the carrier though. So you hear both files simultaneously.
Thank you so much!
 
Top