This is a simple basic tutorial to adding new crate surpises.
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.
<GameObject
id="UnitCrate"
Change the ID to:
<GameObject
id="UnitGDIPredatorCrate"
Next go to the following code under Behaviors:
<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="4"
UnitType="GDIPitbull"></UnitCrateCollide>
Change it to:
<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="1"
UnitType="GDIPredator"></UnitCrateCollide>
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:
<Behaviors>
<SpawnCrateUpdate
id="ModuleTag_SpawnCrateUpdate">
<CrateList>MoneyCrateMP</CrateList>
<CrateList>VeterancyCrateMP</CrateList>
<CrateList>HealCrateMP</CrateList>
Just add your new crate name like this:
<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...
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.
<GameObject
id="UnitCrate"
Change the ID to:
<GameObject
id="UnitGDIPredatorCrate"
Next go to the following code under Behaviors:
<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="4"
UnitType="GDIPitbull"></UnitCrateCollide>
Change it to:
<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="1"
UnitType="GDIPredator"></UnitCrateCollide>
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:
<Behaviors>
<SpawnCrateUpdate
id="ModuleTag_SpawnCrateUpdate">
<CrateList>MoneyCrateMP</CrateList>
<CrateList>VeterancyCrateMP</CrateList>
<CrateList>HealCrateMP</CrateList>
Just add your new crate name like this:
<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...