Mod SDK Guide
Please note that when copying code from the tutorials, you may have to replace the speech marks with your own as this has been known to cause problems.
How to change unit icons
So, this, is, the, cameo tutorial. Cameos, in case you didn’t know, are those images that you use for the icons of units, so
when you train something at a building, or build a building, you know what you’re training. So as you see, this is very important
for new units, or editing existing ones. So, today we’re going to edit the cameo for a new unit, lets take that mytank one.
Currently, here’s it’s main settings:
<GameObject id=”mytank” inheritFrom=”BaseVehicle” SelectPortrait=”Portrait_AlliedAntiVehicleVehicleTech1″ ! ButtonImage=”Button_AlliedAntiVehicleVehicleTech1_on” ! Side=”Allies” SubGroupPriority=”425″ EditorSorting=”UNIT” HealthBoxHeightOffset=”25″ BuildTime=”10″ CommandSet=”mytankCommandSet” KindOf=”SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS SCORE VEHICLE CAN_BE_FAVORITE_UNIT T2_UNIT” WeaponCategory=”CANNON” VoicePriority=”188″ EditorName=”mytank” Description=”Desc:mytank” TypeDescription=”Type:mytank” UnitIntro=”Allied_GuardianTank_UnitIntro”> <DisplayName xai:joinAction=”Replace” xmlns:xai=”uri:ea.com:eala:asset:instance”>Name:mytank</DisplayName>
The two things that will change our cameos is the two areas:
Now, we just change both the things in the quotations to: “Portrait_mytank” Of course, the script asks for a button and a portrait,
and yes, you could do two different images, but for the sake of basics, we’ll make both the same portrait.
Now, close it, and we’re going to our images folder in: C:\RA3 MOD SDK\Art\images
If you see the harbringer portraits, you got the right place. Now, we’re going to copy the .xml which is SampleUpdatedPackedImages, lets
just call it SampleUpdatedPackedImages 2, now, open it up, and delete everything untill you got something that looks like this:
<?xml version=’1.0′ encoding=’UTF-8′?> <AssetDeclaration xmlns=”uri:ea.com:eala:asset” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”> <Texture id=”Portrait_AlliedHarbingerGunship” File=”Portrait_AlliedHarbingerGunship.tga” OutputFormat=”A8R8G8B8″ GenerateMipMaps=”false” AllowAutomaticResize=”false”/> <PackedTextureImage id=”Portrait_AlliedHarbingerGunship” Texture=”Portrait_AlliedHarbingerGunship” Rotated=”false”> <Dimensions x=”128″ y=”128″/> <Coords x=”0″ y=”0″/> <TextureDimensions x=”128″ y=”128″/> </PackedTextureImage> </AssetDeclaration>
Ok, now, what we do is that we change every instance that says “Portrait_AlliedHarbringerGunship” to “Portrait_mytank” There are 4.
Once you’ve done all that, save and quit the .xml. Now, what we need to do, is actually make the portrait. Use your favorite drawing
program that can make tga’s (I made my picture in flash, then copied it over to gimp) but the important thing is THAT YOU NAME IT”Portrait_mytank” and you MUST save it in the images folder alongside the portrait for the allied harbringer.
Note: The dimensions are optimal at 128 X 128 or 76 X 106, in reality, it’s going to get resized anyway, but, I did it like that.
Now let me just explain what we just did, any new cameo assets MUST be taken in through the SampleUpdatedPackedImages, or else, they won’t be used.
Ok, one final step left here, go to your mod.xml, and at the bottom, before the /assetdeclaration tag, put this:
<!– New sample portrait –> <Include type=”all” source=”ART:Images/SampleUpdatedPackedImages2.xml” />
Now, build your mod, and enjoy, if it’s not working, go check your names, they must all be EXACTLY the same.
How to edit sounds
Ohai again, and welcome to the second tutorial I (EvilConker) am making for this fine site right here. Ok, so, today, we’re going to be changing unit
sounds (oh boy!) This is helpfull, if you want to make a unit, but don’t want to re-use any sound banks. Just a note, sound bank is a term for a unit’s sounds
and voices. Ok, we’re going to be using our new unit, mytank, that Jackal and Overmind helped you make in the last couple of tuturiols (see: Modding your first unit)
Now, what we do, is that we open up mytank.xml (or whatever you named it) and we’re going to go to the deep bottom of the file, you should see something
like this at the last lines of the file:
<AudioArrayVoice> <AudioEntry Sound=”ALL_Guardian_VoiceAttack” AudioType=”voiceAttack” /> <AudioEntry Sound=”ALL_Guardian_VoiceCreate” AudioType=”voiceCreated” /> <AudioEntry Sound=”ALL_Guardian_VoiceMoveAttack” AudioType=”voiceAttackAfterMoving” /> <AudioEntry Sound=”ALL_Guardian_VoiceMove” AudioType=”voiceMove” /> <AudioEntry Sound=”ALL_Guardian_VoiceRetreat” AudioType=”voiceRetreatToCastle” /> <AudioEntry Sound=”ALL_Guardian_VoiceSelectMS” AudioType=”voiceSelect” /> <AudioEntry Sound=”ALL_Guardian_VoiceSelectBattleMS” AudioType=”voiceSelectBattle” /> <AudioEntry Sound=”ALL_Guardian_VoiceSelectBattleMS” AudioType=”voiceSelectUnderFire” /> </AudioArrayVoice>
If you can’t find it, search for “AudioArrayVoice.”
Now we’re going to need to change all of these names, they just point to what MP3’s we want to use for the voices in SoundEffects.xml which we’ll get
to in a moment.
So, change all the things that say Gaurdian, to mytank, leave all the ALL’s and anything that comes after the mytank. So, it should look like this:
<AudioArrayVoice> <AudioEntry Sound=”ALL_mytank_VoiceAttack” AudioType=”voiceAttack” /> <AudioEntry Sound=”ALL_mytank_VoiceCreate” AudioType=”voiceCreated” /> <AudioEntry Sound=”ALL_mytank_VoiceMoveAttack” AudioType=”voiceAttackAfterMoving” /> <AudioEntry Sound=”ALL_mytank_VoiceMove” AudioType=”voiceMove” /> <AudioEntry Sound=”ALL_mytank_VoiceRetreat” AudioType=”voiceRetreatToCastle” /> <AudioEntry Sound=”ALL_mytank_VoiceSelectMS” AudioType=”voiceSelect” /> <AudioEntry Sound=”ALL_mytank_VoiceSelectBattleMS” AudioType=”voiceSelectBattle” /> <AudioEntry Sound=”ALL_mytank_VoiceSelectBattleMS” AudioType=”voiceSelectUnderFire” /> </AudioArrayVoice>
Ok, we’re done here, close, and go to the sample mod, here you’ll find a number of xml’s, we need the one called “SoundEffects.xml” Copy it, and bring it to
your mod’s folder.
So, I assume now that you have it open, so, you should see a ton of random stuff, DON’T DELETE ANYTHING I DON’T TELL YOU TO.
Delete everything from:
<!– === ALLIED GUNSHIP HARBINGERGUNSHIP HARBINGER GUNSHIP EP1 === –>
<!– ========================== ALLIED HARBINGER GUNSHIP HARBINGERGUNSHIP GUN SHIP EP1 ========================== –>
Because those are all for sound effects, which I’m assuming you don’t have. We’re focusing on voices here, but sound effects work almost exactly the same way.
So what we do is that we’re going to look at the first block:
<AudioEvent id=”ALL_HarbingerGunship_VoiceAttack” inheritFrom=”AudioEvent:BaseUnitResponse” Volume = “110″ <— how high the voice goes, sometimes you have a low sound, and you need it to be more hearable. MinVolume = “105″ <— If you noticed, when you scroll away from a unit, they’re voice gets quiter, this determines how quiet they can go. Priority = “HIGH” <— Don’t touch this Type = “WORLD PLAYER VOICE” <— Don’t touch this SubmixSlider = “VOICE” > <— Don’t touch this <PitchShift Low=”-1″ High=”1″ /> <— Don’t touch this <!– EP1 –> <Sound>AUHarbi_voiAttacka</Sound> <—jackpot <Sound>AUHarbi_voiAttackb</Sound> <Sound>AUHarbi_voiAttackc</Sound> <Sound>AUHarbi_voiAttackd</Sound> <Sound>AUHarbi_voiAttacke</Sound> <Sound>AUHarbi_voiAttackf</Sound> </AudioEvent>
This is the voice bank for the unit’s attack voice, when you tell it to go destroy something.
Now, what we’re going to first, change the name of the sound bank, just remove the Harbringer part, and replace it with “mytank” so it should read:
So, now we have a list of random text that has labeled around them.
Their names only hold organizational value, but, just to be organized, change the “AUHarbi” to “AUmyta” On each one, so you should now have a list of files saying:
<Sound>AUmyta_voiAttacka</Sound> <Sound>AUmyta_voiAttackb</Sound> <Sound>AUmyta_voiAttackc</Sound> <Sound>AUmyta_voiAttackd</Sound> <Sound>AUmyta_voiAttacke</Sound> <Sound>AUmyta_voiAttackf</Sound>
These tell the game which sounds it can randomly pick from when your clicking on a unit (since we’ve evolved since the 1990’s, units won’t say the same thing twice,) you can have more or less then the ones given.
So now you’re going to actually make the sounds, for skimming it purposes, unless you’re going to use them, delete every other little box of text under this one
but be carefull not to delete or bad things will happen.
Now, you have to make a bunch of Wav’s of your unit talking, a wav is just a sound file, most voice recording and sound recording programs can make them, while naming your files
I need to bring your attention to the last part of those names we just edited.
See where it says voiAttacka? Well, that last letter, as you might know, isn’t the last word in Attack, it’s the first letter in the alphabet, see how the
next one has a random b at the end of voiAttack, so the next one’s voiAttackb? Well, in case you didn’t notice what I’m getting at, it’s organized
so that each file has a different letter in the alphabet, this has numerous advantages, such as the fact that it keeps all your sound files in one place.
So I suggest you do it.
Anyways, back to making those unit sounds, so make some wavs of your unit saying stuff, and BE SURE TO SAVE THEM AT THIS ADRESS:
Your wrote: C:\RA3 MOD SDK\audio\Sounds
This points to your sound folder that’s in the audio folder that’s right under the art folder in the main MOD SDK folder.
THIS IS WHERE ALL YOUR SOUNDS SHOULD BE.
The harbringer probably has a couple there already, as they came with the mod sdk.
So, where were we?
Oh yes, so now that you have files labeled “AUmytan_voiAttack” with the last letter going from a-f, go to your audio folder in the main Mod SDK folder.
Here you’ll find two folder’s named ModkitMP3Examples, and Sound, which is where our unit speeches are located, you’ll also find a file called AudioAssets.
This is the file we’re looking for, now, we need to copy it, and name it “AudioAssets2″ Open it up, delete everything from:
<?xml version=”1.0″ encoding=”utf-8″?> <AssetDeclaration xmlns=”uri:ea.com:eala:asset” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”> <Tags /> <Includes> </Includes>
BUT DO NOT DELETE THOSE.
Ok, now just paste this in the middle:
<AudioFile id=”AUmyta_voiAttacka” File=”AUDIO:sounds\AUmyra_voiAttacka.wav” GUIPreset=”Default” /> <AudioFile id=”AUmyta_voiAttackb” File=”AUDIO:sounds\AUmyra_voiAttackb.wav” GUIPreset=”Default” /> <AudioFile id=”AUmyta_voiAttackc” File=”AUDIO:sounds\AUmyra_voiAttackc.wav” GUIPreset=”Default” /> <AudioFile id=”AUmyta_voiAttackd” File=”AUDIO:sounds\AUmyra_voiAttackd.wav” GUIPreset=”Default” /> <AudioFile id=”AUmyta_voiAttacke” File=”AUDIO:sounds\AUmyra_voiAttacke.wav” GUIPreset=”Default” /> <AudioFile id=”AUmyta_voiAttackf” File=”AUDIO:sounds\AUmyra_voiAttackf.wav” GUIPreset=”Default” />
Now, let me explain what these peices of codes are, I’ll break it down.
<AudioFile id=”AUmyta_voiAttacka” - This is it’s ID, and you must call it that whenever you want to use this file. File=”AUDIO:sounds\AUmyra_voiAttacka.wav” - This is the adress for the file, if you note, whenever we’re talking about a main SDK file, such as audio or sage, we just say it’s name in caps, and put: and then we say the rest of the adress. GUIPreset=”Default” - I don’t honestly know, but, just don’t touch it, EVER.
So, now that we’re done here, lets GTFO the file, and go to mod.xml in our mod’s file.
And at the end of it, but not before AssetDeclaration , past this in:
<!– Sounds for the Mytank –> <Include type=”all” source=”DATA:<your mod name here>/Data/SoundEffects.xml” /> <Include type=”all” source=”AUDIO:AudioAssets2.xml” />
Then build, and we’re done.
If it doesn’t work, remember, you have to rewrite every quotation mark you copy from here.
Sorry for the long time between tut post, as I was learning myself. I'll have more sooner than last time. And Remember, Have Fun, and Happy Modding!