At this point, you should have installed the mod SDK and placed the dummy files in the Art folder of the mod SDK.
Your mod SDK folder should look a little bit like this:
Now, go into the Mods folder and create a new folder. The name of this folder will be the name of you mod. In this folder, create a folder with the name 'Data' and create a file called mod.xml in that folder. Congrats, your first mod is basically finished! The mod.xml file is the only file that a mod has got to have. Your directory structure should now look like this: RA3 MOD SDK -> Mods -> MyMod (or whatever you might have called it) -> Data -> mod.xml.
Because this is a bit of a nonsense mod, we should probably go edit the mod.xml file, as it is where all the magic happens. Now, open mod.xml in your favorite XML editor (I would recommend Notepad++, because it has syntax highlighting for XML, but plain old notepad is fine too.) and paste the following code:
<?xml version="1.0" encoding="UTF-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Tags></Tags>
<Includes>
<!-- These includes need to be in all mod.xml files -->
<Include type="reference" source="DATA:static.xml" />
<Include type="reference" source="DATA:global.xml" />
<Include type="reference" source="DATA:audio.xml" />
</Includes>
</AssetDeclaration>
Let me give you a basic explanation of what we're doing here. (I sure hope you've read some xml guides by now!) The AssetDeclaration tag is the main tag of RA3 modding. It'elements are Tags and Includes. We are only going to use the second element for this one. The Include element of Includes is pretty self-explanary. The three includes that are already in the file are references to the normal data of the game. If you are interested in these files, you can find them in the RA3 MOD SDK -> SageXml folder (Sage is the engine that RA3, and most other C&C games, uses). These files are filled with references to all of the other standard files. If we make references to our own files below these includes we are able to overwrite values of the standard game files (note that if you would add references to your own files above these standard declarations they would get overwritten by the standard game files and just get the standard game). If we build the mod like this, it would come out as the normal game.
Now we are going to add our new unit. It will basically be a Guardian Tank, but with some modifications. In order to do that, we must add an xml file for the tank. But we also want to be able to actually build the tank. To do that, we have to edit the building options of the Allied Armor Facility. So, let's get cracking.
Go to the SageXml folder (it's inside the RA3 MOD SDK folder) and find the xml files for the Guardian tank and the command sets (for the Armor Facility queue) and copy (do NOT, I repeat, NOT move them, or else you wouldn't be able to create mods with these files, and you don't want that) them to the folder with mod.xml in it.
Guardian tank: RA3 MOD SDK\SageXml\Allied\Units\AlliedAntiVehicleVehicleTech1.xml
Command sets: RA3 MOD SDK\SageXml\GlobalData\LogicCommand.xml
RA3 MOD SDK\SageXml\GlobalData\LogicCommandSet.xml
Now go ahead and rename the Guardian Tank file to something like mytank.xml, we don't want to overwrite the original file; we are going to add it as a new file.
We are only going to edit some minimal things. Change AlliedAntiVehicleVehicleTech1 to mytank on lines 38, 51, 52, 53, 56. Don't do this for other lines, as we do want the art and sound of the Guardian Tank. (It does not matter what name you pick here, as long as it's the same as the name you're gonna use in the next step.) The game now knows that it has to look up the name, type and description for a unit called 'mytank'. But we still have to tell the game what those are. You might find that the files you copied are read only, so reset this if you have trouble saving them.
Create a file called 'mod.str' in the data subfolder of your mod. Add the following to the file:
Name:mytank
"My Tank"
END
Desc:mytank
"It will kill you if I tell it to"
END
Type:mytank
"DON'T CROSS THE STREAMS"
END
Where I used mytank you should fill in the id you chose in the mytank.xml file. (Yes, you could use a different id for the desc and type, as long as you would use the same names in both files, but this makes thing only more complicated.)
We are now going to add the vehicle to the Armor Facility. Open LogicCommand.xml and add the following somewhere in the file:
<LogicCommand
Type="UNIT_BUILD"
id="Command_Constructmytank">
<Object>mytank</Object>
</LogicCommand>
This is just adding the action, it does not have a way to get triggered yet. Command_Constructmytank is the name of the action that should be taken, so remember what you fill in here. The name in the Object tags should be the name as what you set in mod.str and mytank.xml. Save the file.
We are now going to tell the game when the action Command_Constructmytank should be executed. The file that tells this to the game is LogicCommandSet.xml. So why don't you open that up. Find the element
<LogicCommandSet id="AlliedWarFactoryCommandSet"> (hint: line 186). As you can see, these are all the buttons in the Armor Facility. Add <Cmd>Command_Constructmytank</Cmd> at the place where you want the button to be (I placed it after the original Guardian Tank). Then, add the following code to the file under (and outside of) the AlliedWarFactoryCommandSet command set. It should look like this:
Now, go ahead and save it.
One more thing left to do. We still have to tell the game to actually load these modified files. Add the following cod to the mod.xml file (under the standard includes):
<Include type="all" source="DATA:mymod/Data/LogicCommand.xml"/>
<Include type="all" source="DATA:mymod/Data/LogicCommandSet.xml"/>
<Include type="all" source="DATA:mymod/Data/mytank.xml"/>
Well, we're done. This is it. In the next post I am going to learn you to build and use the mod you just made. (Congrats, you just really made your first mod.)

Geen opmerkingen:
Een reactie posten