Stargate: Replicator Wars

Adding New Crate Surprises

Tutorial for Command & Conquer 3 CNC3

Avatar of Rebelmoon

Rebelmoon

Category: Code
Level: Beginner
Created: Monday September 17, 2007 - 13:19
Updated: Monday September 17, 2007 - 14:32
Views: 2695
Summary: A basic example of adding new crates.

Rating

Staff says

4.0

Members say

-

Average

4.0/5.0

1 vote

This is a simple basic tutorial to adding new crate surpises.

Required tools: Text Editor & SDK
Locations: data (in your mod folder), CnC3Xml
XML Files Needed: GenericCrateSpawner.xml & UnitCrate.xml

I prefer Notepad++ for my XML editing because it has syntax highlighting, tabbed interface, a built-in hex editor & other useful features. Plus it's free which is always a great feature.

In this we'll be adding a Predator crate so you'll only need to add 2 new xml files to your mod. The 1st is the GenericCrateSpawner.xml found in the Neutral/Units folder. The next is the UnitCrate.xml found in your Neutral/Crates folder. Make copies of both in your Mod/Data folder.

1st we'll make the Predators crate info. Open the UntiCrate.xml and look for the following code ID under Game Object.

              
Code
<GameObject
id="UnitCrate"


Change the ID to:

              
Code
<GameObject
id="UnitGDIPredatorCrate"


Next go to the following code under Behaviors:

              
Code
<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="4"
UnitType="GDIPitbull"></UnitCrateCollide>


Change it to:

              
Code
<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="1"
UnitType="GDIPredator"></UnitCrateCollide>


If you don't want to know what type of crate it is ingame before grabbing it then change this line of code:

              
Code
<DisplayName>NAME:UnitCrate</DisplayName>


To this:

              
Code
<DisplayName>NAME:Crate</DisplayName>


Finally, save it and then rename it as UnitGDIPredatorCrate.xml

Ok, that part is done. Next comes the GenericCrateSpawner.xml which tells the game what crates to spawn. This bit is simple and quick.

Open and find this code under Behaviors:

              
Code
<Behaviors>
<SpawnCrateUpdate
id="ModuleTag_SpawnCrateUpdate">
<CrateList>MoneyCrateMP</CrateList>
<CrateList>VeterancyCrateMP</CrateList>
<CrateList>HealCrateMP</CrateList>


Just add your new crate name like this:

              
Code
<Behaviors>
<SpawnCrateUpdate
id="ModuleTag_SpawnCrateUpdate">
<CrateList>MoneyCrateMP</CrateList>
<CrateList>VeterancyCrateMP</CrateList>
<CrateList>HealCrateMP</CrateList>
<CrateList>UnitGDIPredatorCrate</CrateList>



Save and you're done with that one.

Lastly, open your mod.xml and add both the GenericCrateSpawner.xml & UnitGDIPredatorCrate.xml files to it and save.

That's it. Just build and play. You will need to make a unit file for each unit you want added. And it's not just limited to units. Any number of things can be added, like exploding crates, etc, so play around with it and have fun.

Cheers,

Rebelmoon

Comments

Display order: Newest first

Boomerang Python - Saturday September 29, 2007 - 7:04

This brings up some crazy ideas in my mind..

Rebelmoon - Monday September 17, 2007 - 14:33

Thanks Dark Lord, I've updated it.

Cheers,

Rebelmoon

Dark Lord of the Sith (Administrator) - Monday September 17, 2007 - 13:38

You can add code tags like the ones on the boards [ code ][ /code ] (without the spaces). I've added them for you now.
It would probably also be a good idea to provide some short info about required tools and such, like I added in my Upgrades Tutorial.

Back to Top

Network

Button for Revora.net Button for CnC3Files.com Button for the CnC Guild Button for YR Argentina Button for The3rdAge.net Button for CnC3Files.com

Affiliates

Button for Project Perfect ModButton for Command & Conquer: FilefrontButton for CnC WorldButton for CnC MapsButton for CnC Generals WorldButton for OpenWarButton for Victory Engine CNC Top 101

Our Button

CNC3.net Button