PDA

View Full Version : Tutorial: How to Give Units the Ability to Spot for the Juggernaut


rebel5555
09-23-2007, 04:57 AM
In this tutorial I will describe the necessary steps to give various units the ability to spot for the Juggernaut and if you want the Battleship as well. I have tested this and it does work, you just have to tweak it on how you like it.

Step 1: (Files you will Need)
Make sure you have installed the SDK correctly by following the documentation that came with it.
I Recommend using a XML editor as it makes things a lot easier I use Notepad++ it's free and easy to use. Get it here http://notepad-plus.sourceforge.net/uk/site.htm
Download the OS Big Editor so you can open a certain .big file. Get it here http://www.ppmsite.com/index.php?go=osbigeditorinfoStep 2:

Open the OS Big Editor and open the Misc.big file located at C:\Program Files\Electronic Arts\Command & Conquer 3\Core\1.0
Extract the following files to a directory of your choice (data\scripts\scriptevents.xml), (data\scripts\scriptevents.xsd), (data\scripts\scriptevents.xsx), (data\scripts\scripts.ini), (data\scripts\scripts.lua),
Now create a new file called "Scripts" in C:\Program Files\Electronic Arts\Command & Conquer 3\MOD SDK\Mods\YOURMOD\Data and copy the files you extracted from Misc.big into the "Scripts" folder.Step 3:
I will be using the Commando as an example so make sure you have the necessary files.
Open the following files; GDICommando.xml, ScriptEvents.xml, Scripts.lua, SpecialPowerTemplates.xml, GDIAPC.xml, & GDIV35Ox_Summoned.xml.
In the file "GDICommando.xml" Find <AI>
<AIUpdate
id="ModuleTag_AI"
AutoAcquireEnemiesWhenIdle="YES">
<UnitAITargetChooserData
SympathyRange="100.0"
IdleScanDelay="0.01s" />
</AIUpdate>
</AI> Now add the following line in the green text <AI>
<AIUpdate
id="ModuleTag_AI"
AutoAcquireEnemiesWhenIdle="YES"
AILuaEventsList="GDICommandoFunctions">
<UnitAITargetChooserData
SympathyRange="100.0"
IdleScanDelay="0.01s" />
</AIUpdate>
</AI> The code in the green text calls up a set of scripted functions that I will show you in the next step.Step 4:

In the file "Scripts.lua" findfunction OnGDISniperSquadCreated(self)
ObjectSetObjectStatus( self, "CAN_SPOT_FOR_BOMBARD" )
end This function gives the Sniper the ability to Spot for the Juggernaut. Now add the following Codefunction OnGDICommandoCreated(self)
ObjectSetObjectStatus( self, "CAN_SPOT_FOR_BOMBARD" )
end Now we have declared that the Commando can spot for the Juggernaut, but we have to reference this entry in another file, which I will give you the info for in the next step.Step 5:
In the file "ScriptEvents.xml" find <EventList Name="GDISniperSquadFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGDISniperSquadCreated" DebugSingleStep="false"/>
</EventList> This is what activates the scripts in "Scripts.lua". Now add the following code under it <EventList Name="GDICommandoFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGDICommandoCreated" DebugSingleStep="false"/>
</EventList> Alrighty then, on to the next step.Step 6:
In the file "SpecialPowerTemplates.xml" find <SpecialPowerTemplate
id="SpecialPower_SpotTargetBombard"
Flags="LIMIT_DISTANCE NEEDS_OBJECT_FILTER FIND_REACHABLE_TARGETS WATER_OK TARGET_NEEDS_OBJECT_STATUS NO_FORBIDDEN_MODEL_STATES"
RequiredTargetObjectStatus="CAN_SPOT_FOR_BOMBARD"
DisallowedTargetModelStates="TRANSPORT_MOVING MOVING"
ReloadTime="10s"
RadiusCursorRadius="50"
TargetType="LOCATION"
NameOfVoiceNameToUseAsInitiateIntendToDoVoice="InitiateSpotTargetBombard"
EvaEventToPlayWhenSelectingTarget="SelectSpecialPowerTarget"
MinCastRange="300"
MaxCastRange="50000"
ReachableTargetsCircleDisplayRadius="500">
<ObjectFilter
Relationship="ALLIES"
Rule="ALL" />
<GameDependency>
<ObjectFilter
Relationship="ALLIES"
Rule="NONE">
<IncludeThing>GDISniperSquad</IncludeThing>
</ObjectFilter>
</GameDependency>
</SpecialPowerTemplate> Now add the following in the green text <SpecialPowerTemplate
id="SpecialPower_SpotTargetBombard"
Flags="LIMIT_DISTANCE NEEDS_OBJECT_FILTER FIND_REACHABLE_TARGETS WATER_OK TARGET_NEEDS_OBJECT_STATUS NO_FORBIDDEN_MODEL_STATES"
RequiredTargetObjectStatus="CAN_SPOT_FOR_BOMBARD"
DisallowedTargetModelStates="TRANSPORT_MOVING MOVING"
ReloadTime="10s"
RadiusCursorRadius="50"
TargetType="LOCATION"
NameOfVoiceNameToUseAsInitiateIntendToDoVoice="InitiateSpotTargetBombard"
EvaEventToPlayWhenSelectingTarget="SelectSpecialPowerTarget"
MinCastRange="300"
MaxCastRange="50000"
ReachableTargetsCircleDisplayRadius="500">
<ObjectFilter
Relationship="ALLIES"
Rule="ALL" />
<GameDependency>
<ObjectFilter
Relationship="ALLIES"
Rule="NONE">
<IncludeThing>GDISniperSquad</IncludeThing>
<IncludeThing>GDICommando</IncludeThing>
</ObjectFilter>
</GameDependency>
</SpecialPowerTemplate>You can do the same thing for the Battleship, the code for it is right beneath the code I just mentioned.Step 7:
In the files "GDIAPC.xml" & "GDIV35Ox_Summoned.xml" find <MemberTemplateStatusInfo
ThingTemplate="GDISniperSquad"
ObjectStatus="CAN_SPOT_FOR_BOMBARD" />Now add the following in the Green text beneath it <MemberTemplateStatusInfo
ThingTemplate="GDICommando"
ObjectStatus="CAN_SPOT_FOR_BOMBARD" /> This section of code lets the unit spot while inside of a vehicle. You might what to add this bit of code for any structure that you can garrison, but that would take time and I'm not going through those steps.Step 8:(The End)

Make a backup of "BuildMod.bat". After you have done that open "BuildMod.bat" and you'll see@echo off
@echo Mod Name: %1
@echo Building Mod Data...
tools\binaryAssetBuilder.exe "%cd%\Mods\%1\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /ls:true /gui:false /UsePrecompiled:true /vf:true
@echo Building Low LOD...
tools\binaryAssetBuilder.exe "%cd%\Mods\%1\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /ls:true /gui:false /UsePrecompiled:true /vf:true /bcn:LowLOD /bps:"%cd%\BuiltMods\mods\%1\data\mod.manifest"
@echo Copying str file if it exists...
IF EXIST "%cd%\Mods\%1\data\mod.str" copy "%cd%\Mods\%1\data\mod.str" "%cd%\BuiltMods\mods\%1\data"
@echo Copying Shaders...
IF NOT EXIST "%cd%\BuiltMods\mods\%1\Shaders" md "%cd%\BuiltMods\mods\%1\Shaders"
copy "%cd%\Shaders\*.fx" "%cd%\BuiltMods\mods\%1\Shaders"
del "%cd%\Builtmods\mods\%1\data\mod_l.version"
@echo Creating Mod Big File...
tools\MakeBig.exe -f "%cd%\BuiltMods\mods\%1" -x:*.asset -o:"%cd%\BuiltMods\mods\%1.big"
@echo Copying built mod...
IF NOT EXIST "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods" md "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods
IF NOT EXIST "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods\%1" md "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods\%1
copy "builtmods\mods\%1.big" "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods\%1" add the following in green text@echo off
@echo Mod Name: %1
@echo Building Mod Data...
tools\binaryAssetBuilder.exe "%cd%\Mods\%1\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /ls:true /gui:false /UsePrecompiled:true /vf:true
@echo Building Low LOD...
tools\binaryAssetBuilder.exe "%cd%\Mods\%1\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /ls:true /gui:false /UsePrecompiled:true /vf:true /bcn:LowLOD /bps:"%cd%\BuiltMods\mods\%1\data\mod.manifest"
@echo Copying str file if it exists...
IF EXIST "%cd%\Mods\%1\data\mod.str" copy "%cd%\Mods\%1\data\mod.str" "%cd%\BuiltMods\mods\%1\data"
@echo Copying Shaders...
IF NOT EXIST "%cd%\BuiltMods\mods\%1\Shaders" md "%cd%\BuiltMods\mods\%1\Shaders"
copy "%cd%\Shaders\*.fx" "%cd%\BuiltMods\mods\%1\Shaders"
del "%cd%\Builtmods\mods\%1\data\mod_l.version"
@echo Copying scripts files...
md "%cd%\BuiltMods\mods\%1\data\scripts"
copy "%cd%\Mods\%1\data\scripts\*.*" "%cd%\BuiltMods\mods\%1\data\scripts\"
@echo Creating Mod Big File...
tools\MakeBig.exe -f "%cd%\BuiltMods\mods\%1" -x:*.asset -o:"%cd%\BuiltMods\mods\%1.big"
@echo Copying built mod...
IF NOT EXIST "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods" md "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods
IF NOT EXIST "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods\%1" md "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods\%1
copy "builtmods\mods\%1.big" "F:\My Documents\Command & Conquer 3 Tiberium Wars\mods\%1" This section of code puts the files in the "Scripts" folder into your mod's .big file.Congratulations, you now have given the Commando the ability to Spot for the Juggernaut. It took me several frustrating weeks to figure this out because EA hid this piece of code very, very well. I hope this will help all my fellow modders out there. Feel free to post this tutorial on any other website, but just give me the credit for figuring this cunundrum out. Enjoy!