Company of heroes/How models and coding works together
From RelicWiki
Have you ever wondered how to get those units ingame, that are using exsisting models but with a diffrent skin, ingame?
Well heres how it all works.
First lets show you how the file structure works.
The sbps is basically what the whole squad's loadouts, requirments, building time etc are. The Type of troops are in the loadout ext. The type of unit in the loadout uses the ebps file for the unit.
The ebps file is the Squad member's model for a squad not the whole squad. The ebps holds the Squad member's 'entity blueprint' which is the squad member's model it will use. The entity blueprint will Point towards the RGM and ABP of the squad member's model.
The rgm Points towards the textures the model has if any. The abp points towards the Actual model, Which is in a folder along with alot of over files.
So the abp is pointing you into the folder, which contains the RGM. This RGM is not the same as the Folderless RGM. You will see the diffrence if you open the folderless rgm and the Folder RGM. The folderless one has 'orig_24 - defualt' in the middle window pane in corsix mod manager. The folder RGM has 'head' 'eye' 'body' in the middle window pane. The folder RGM also points towards the textures which is confusing for some.
Thats the file structure YOU WILL NEED to get your model working. Now here is an example
I assume you know how to use corsix mod manager and that you have gotten your models and textures into the right folders. If not follow either of theese tuts kindly given to me by 'lethal dosage' and i also assume you have made a new ebps and sbps file for your unit.
http://forums.relicnews.com/showpost.php?p=3371393&postcount=3 :infantry
http://forums.relicnews.com/showthread.php?t=132801 :vehicals
Time to know how to do it all.
Step 1:
Open up the sbps of your new unit and expand the 'Squad_loadout' and then expand the unit list, then unit_01 then type. the click on the typ that has no expand button. On the right there is what the 'type' conatians. Change the value to point towards the ebps of your new unit. Now save the sbps and open up the ebps.
Step 2:
Once the ebps is open, expand on the entity_blueprint then click the animator. The value should has some of it cut of but it works. Change this to the place were the folderless RGM you made. Save the file.
Step 3: Open up the ABP file and you come up with somthing like this for example
model = { "..\\..\\Common\\CompleteMotionTree.abp", "..\\..\\Common\\CommonMeshes.abp",
-- Commonwealth Soldier Mesh "..\\..\\Commonwealth\\Soldiers\\Commando1\\Commando",
-- Allied Weapons "..\\..\\Allies\\Soldiers\\Weapons\\m1_rifle", "..\\..\\Allies\\Soldiers\\Weapons\\Flamethrower",
-- Commonwealth Weapons "..\\..\\Commonwealth\\Soldiers\\Weapons\\Sten_Sub_MG", "..\\..\\Commonwealth\\Soldiers\\Weapons\\Lee_Enfield_Mk1", }
Note: were you see 'commando 1' this is the folder your folder RGM is and 'commando' is the folder RGM's name. Now your abp file will proberly say somthing diffrent. All you need to change is the 'soldiers mesh' in bold above. This is telling us were the Folder RGM is. Change this to show were the folder RGM you made, is. Save the file.
Now if youve followed all that give yourself a pat on the back. Now ill tell you how to build them in your hq for a test run.
Step 4:
Open up your races HQ ebps, expand 'spawner' expand squad table and click on a type that isnt filled. Change the value to point towards the SBPS of your new unit. Now theres a good chance your units 'ui posistion will conflict with somthing else so open the sbps of your new unit agian.
Step 5:
Go to squad ui and expand it. The at the bottem of the expanded part find 'ui_group_posistion' change this to the number of the value you changed in the spwner squad table. e.g. If you put it in type 4 then change the 'ui_group_posistion' to 4.
If this works then, congradualtions and havce fun doing more. If not, then go through it agian and see were you went wrong.