Post tutorial RSS Ra3 mod sdk tutorial section 2 More tanks

Part 2 on a tutorial on how to use the RA3 mod SDK

Posted by on - Basic Other


Ra3 mod sdk tutorial section Two More tanks


So welcome to part two of my tutorial on Ra3's mod SDK so i hope by now you know how to do all the basic things stated in section 1 of the tutorial and have been messing around and getting better at it.
*Heres the link to section 1 if you missed it Moddb.com *

So in this section were going to be showing you how to add a new unit into the game and how to edit the build que at the war factory.

Before we get started
*Remember this tutorail may not be as watered down (easy to understand) as the last as im hoping you know the basics from section 1
*You should have your mod file and data file created before we start *if you dont know what they are i strongly suggest you go back to section 1*

Section 2 more tanks

For this tutorial we are going to be using the sickle again "SovietAntiInfantryVehicle" so go and copy and paste it into your data folder (remember to uncheck read only) so now rename the SovietAntiInfantryVehicle file to what ever you want im going to Name my file "moretanks" so now open your renamed file in notpad++ scoll down and look for this.
*it shouldnt be that far from the top*

*Warning remember my < and > are missing becasue they bug up the text*



!-- AKA 'The Sickle' --
GameObject
id="SovietAntiInfantryVehicle"
inheritFrom="BaseVehicle"
SelectPortrait="Portrait_SovietAntiInfantryVehicle_big"
ButtonImage="Button_SovietAntiInfantryVehicle_small"
Side="Soviet"
SubGroupPriority="305"
EditorSorting="UNIT"
HealthBoxHeightOffset="20"
BuildTime="10"
CommandSet="SovietAntiInfantryVehicleCommandSet"
KindOf="SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS SCORE VEHICLE CAN_BE_FAVORITE_UNIT"
ThreatLevel="10"
WeaponCategory="GUN"
VoicePriority="176"
EditorName="SovietAntiInfantryVehicle"
Description="Desc:SovietAntiInfantryVehicle"
TypeDescription="Type:SovietAntiInfantryVehicle"
UnitIntro="Soviet_Sickle_UnitIntro"


DisplayName
xai:joinAction="Replace" xmlns:xai="uri:ea.com:eala:asset:instance">Name:SovietAntiInfantryVehicle /DisplayName

ObjectResourceInfo
BuildCost Account="=$ACCOUNT_ORE" Amount="900"/
/ObjectResourceInfo


ArmorSet
Armor="SovietAntiInfantryVehicleArmor"
DamageFX="VehicleDamageFX" /

The lines highlighed in Green change them to the name of your file. In my case it would be "moretanks"

Also if you notice the writing highlighted in pink This controls which speacial power the unit gets through a command set.
In this case it would be the sickle jumping power. You dont have to change this as the SovietAntiInfantryVehicleCommandSet will work with your unit and you will get the sickle normal jump power but i do suggest you change it to the name of your file so you can learn how to make your own commandset.
*if you do this part remember not to delete the word Commandset*
Save your file and close it now.

Now we need to get two new files from the sageXml. So go into Sagexml then into the "Gobaldata" and copy the two files "logiccommand" and "logiccommandset" paste them into your data file and remember to uncheck the read only box.

Now open the logiccommand and scoll down to the buttom. *it doesnt realy matter were you put the code* But to make it easly to find we will add it to the bottom You may paste the code below as i got the < and > to stay but remember to change the name from "moretanks" to your files name

<LogicCommand
        Type="UNIT_BUILD"
        id="Command_moretanks">
        <span class="mceItemObject" >moretanks</span>
    </LogicCommand>

Now save and close it now open up the logiccommandset file scoll down it to you find the logic set for the war factory it is around half way down the file should look like this.

<LogicCommandSet  
 id="SovietWarFactoryCommandSet">
 <Cmd>Command_ConstructSovietMiner</Cmd>
 <Cmd>Command_ConstructSovietSurveyor</Cmd>
 <Cmd>Command_ConstructSovietScoutVehicle</Cmd>
 <Cmd>Command_ConstructSovietAntiInfantryVehicle</Cmd>
 <Cmd>Command_ConstructSovietAntiAirShip_Ground</Cmd>
 <Cmd>Command_ConstructSovietAntiVehicleVehicleTech</Cmd>
 <Cmd>Command_ConstructSovietAntiStructureVehicle</Cmd>
 <Cmd>Command_ConstructSovietAntiVehicleVehicleTech</Cmd>  
 <Cmd>Command_ConstructSovietMCV</Cmd>        
 <Cmd>Command_RepairVehicle</Cmd>

<!--		       
<Cmd>Command_UpgradeSovietWarFactorySalvageYard</Cmd 
--> 

</LogicCommandSet>


so in that list add your own unit to it it should look soemthing like this.

<LogicCommandSet  
 id="SovietWarFactoryCommandSet">
 <Cmd>Command_ConstructSovietMiner</Cmd>
 <Cmd>Command_ConstructSovietSurveyor</Cmd>
 <Cmd>Command_ConstructSovietScoutVehicle</Cmd>
 <Cmd>Command_ConstructSovietAntiInfantryVehicle</Cmd>
 <Cmd>Command_ConstructSovietAntiAirShip_Ground</Cmd>
 <Cmd>Command_ConstructSovietAntiVehicleVehicleTech</Cmd>
 <Cmd>Command_ConstructSovietAntiStructureVehicle</Cmd>
 <Cmd>Command_ConstructSovietAntiVehicleVehicleTech</Cmd>  
 <Cmd>Command_ConstructSovietMCV</Cmd>        
 <Cmd>Command_moretanks</Cmd>
<br />  <Cmd>Command_RepairVehicle</Cmd>

<!--		       
<Cmd>Command_UpgradeSovietWarFactorySalvageYard</Cmd 
--> 

</LogicCommandSet>

Now Listen carefully *or more like read carefully* The order they are in the list is the order they show up in the war factory remember the war factroy only has 9 slots so going over it will casue you unit not to show up in the build que.
By adding our unit the sovit war factory now has 10 units unless you know how to add the extra slots which i may explain later in a section your going to have to make room the easyest way it to delete .

<Cmd>Command_ConstructSovietMiner</Cmd>

As this is the ore collecter build slot which is useless at the war factroy as you can build ore collecters at the ore mine anyway
so now the last part.

You only need to do this if you changed the commandset part you know the writing in pink
so scoll down to the bottom *again just making it easy find and inbetween !-- End Campaing Specific Command Sets -- and /AssetDeclaration paste this

<LogicCommandSet
		id="moretankscommandset">
		<Cmd>Command_ActivateLeapSpecialPower</Cmd>
		<Cmd>Command_AttackMove</Cmd>
		<Cmd>Command_MoveToPositionAndCollect</Cmd>
	</LogicCommandSet>

Remember to change the name in it.
This will give your unit the soviet sickle jumping power after this save and close the commandset.
Now create your Mod.xml listing all the file you need it should look something 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">
   <Tags></Tags>
   <Includes>
   <!--
   mod.xml is the central include for mod setup data.		
   -->
		
  <!-- 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" />
		
  <Include type="all" source="moretanks".xml" />
		 
  <Include type="all" source="logicCommandset.xml" />
  <Include type="all" source="logicCommand.xml" />
 </Includes>

</AssetDeclaration>

Your mod is playable but there is one thing we have to do and that is give your unit a name that will show up in game go into the smaplemod and copy the file called Mod.str and paste it in your data file dont worry you dont need to add it to the MOD.Xml file.

open it up in notepad++ and it should look like this.
*note i have aready changed it so that it will work for my unit*

Name:moretanks
"pwner tank" <--is the name that will show up in game

Desc:moretanks
"down right overpowered"
Type:moretanks
"testing"

So well done build your mod and play it

If you mod fails to build or crashess the game remember to keep trying.

Still haven't got around to writing section 3

Comments
Skyteks
Skyteks

I have a problem, i tried it many times ,but it says me that there is a XML validation error in LogicCommand(and *Set) and it does not find the moretanks line:
BUILD LOG:
[00:00:02.5961485] Loading 'file://d:\games\ea games\alarmstufe rot 3\ra3 mod sdk\mods\boom\data\logiccommand.xml'.
[00:00:02.6291504] Critical: XML validation error encountered in 'd:\games\ea games\alarmstufe rot 3\ra3 mod sdk\mods\boom\data\logiccommand.xml':
XML validation error encountered in D: games/alarmstufe rot 3/ra3 mod sdk/mods/boom/data/logiccommand.xml (line 0, position 0):
Das Element 'LogicCommand' in Namespace 'uri:ea.com:eala:asset' hat ein ungltiges untergeordnetes Element 'span' in Namespace 'uri:ea.com:eala:asset'. Erwartet wurde die Liste m”glicher Elemente: 'SpecialPower, Upgrade, Object, AISpecialPowerInfo' in Namespace 'uri:ea.com:eala:asset'.
Build failed on step 2

Reply Good karma Bad karma+1 vote
Skyteks
Skyteks

DATA/Mod.xml:
<?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>
<!--
mod.xml is the central include for mod setup data.
-->

<!-- 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" />

<Include type="all" source="moretanks" />

<Include type="all" source="logicCommandset.xml" />
<Include type="all" source="logicCommand.xml" />
</Includes>

</AssetDeclaration>

Reply Good karma Bad karma+1 vote
Skyteks
Skyteks

BUILD LOG:
[00:00:02.3421340] Error: Input file 'moretanks' not found (referenced from D:\games\ea games\alarmstufe rot 3\ra3 mod sdk\mods\boom\data\mod.xml). Treating it as empty.

Reply Good karma Bad karma+1 vote
Skyteks
Skyteks

Please Help me i dont know what i should do, i hope anyone can help me.
I corrected the mistake with the 3th " and i think the .xml is wrong to: "moretanks".xml"
If not just tell me whats the mistake.

Reply Good karma Bad karma+1 vote
ChazzaH
ChazzaH

Whenever I try to compile a mod, it puts the mod into Documents/mods/ and if the mods folder is deleted, it will create a new one. how do I get it to compile into Documents/Red Alert 3/Mods instead?

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.