HOWTO: New Unit Creation

no worries.... i figured you was going to be busy with the units and buildings so I woulda had time to work on it. But man you work quick :mischief:

Woulda have probobly took me a few weeks to finish anyways, im actually glad you did it cuz its lookin pretty good already.

What I was going to do with it was have the tech tree load the tech from the original xml and a modded xml that way you can see what changes youve made.
 
Well I woulda been but to be honest the unit work is drying up a bit, it's more or less done really, and buildings, resources, improvements etc are completely impossible at the mo, and the leaderhead stuff is being a bit of a grind since we're at a kinda roadblock with normal maps... so not much can be done until the game is updated to read the artdefines in. Which is why we started thinking of totally new features.

EDIT: I wrote the following before I saw your edit. Seems we had similar ideas. ;)

The idea is to have it load in the entire Civ 5 tech tree, and allow you to delete / add / change techs at will, then it will compare yours to the original and then generate the XML based on the changes. Ultimately we hope to have a kind of one stop environment (lua and DLL SDK aside probably) for creating mega mods with new tech trees, new units and whatnot, where say a unit can be made to require a tech in the tree in a visual and easy to use way by clicking the '...' next to the tech and being able to scroll across the tree to select a tech, and for that unit to then show in the tech on the tree, and then click a button to export the entire thing to Mod Buddy.
 
My coding skills really arent that great....Ive only learned how to code a few months ago reading some books. The only reason I even attempted to make it was to get some more practice outside of games and learn some more code.

That aside, the animations are really kicking my butt....not that they dont work, they do, just not very kosher looking lol.
 
ok theres just one part that im stuck at......how are you suppossed to join the unit mesh with the weapon mesh without having the weapon curl up into a ball?? someone please help ive been here for like 4 hours trying to figure it out.
 
What about custom unit flags and strategic view icons? I can get custom flags (see City-State Diplomacy Mod) but, for some reason, using custom flags throws off the strategic view icons for all units (esp. unique units and civilians).

Any ideas?

Im pretty sure all you need is to make sure you have this at the end of your code for adding a new unit.

Spoiler :
...........
<UnitArtInfo>ART_DEF_UNIT_MARINE</UnitArtInfo>
<UnitFlagAtlas>UNIT_FLAG_MARINE_TOTAL</UnitFlagAtlas>
<UnitFlagIconOffset>0</UnitFlagIconOffset>
<IconAtlas>UNIT_MARINE_TOTAL</IconAtlas>
<PortraitIndex>0</PortraitIndex>
</Row>
</Units>


and then a pointer to the art file:

Spoiler :
<Row>
<Atlas>UNIT_FLAG_MARINE_TOTAL</Atlas>
<IconSize>32</IconSize>
<Filename>Marine32.dds</Filename>
<IconsPerRow>1</IconsPerRow>
<IconsPerColumn>1</IconsPerColumn>
</Row>
 
Im pretty sure all you need is to make sure you have this at the end of your code for adding a new unit.

Spoiler :
...........
<UnitArtInfo>ART_DEF_UNIT_MARINE</UnitArtInfo>
<UnitFlagAtlas>UNIT_FLAG_MARINE_TOTAL</UnitFlagAtlas>
<UnitFlagIconOffset>0</UnitFlagIconOffset>
<IconAtlas>UNIT_MARINE_TOTAL</IconAtlas>
<PortraitIndex>0</PortraitIndex>
</Row>
</Units>


and then a pointer to the art file:

Spoiler :
<Row>
<Atlas>UNIT_FLAG_MARINE_TOTAL</Atlas>
<IconSize>32</IconSize>
<Filename>Marine32.dds</Filename>
<IconsPerRow>1</IconsPerRow>
<IconsPerColumn>1</IconsPerColumn>
</Row>

Blaze,
That's the way I have it now for my custom unit flags (which work fine on the standard 3d map), but, when I switch to strategic view, the icons all mess up– settlers have a swordsman icon, workers are bowmen, etc. – its very odd.

Is there a way to tell the game to look to a specific SV_Units.xml file so that it doesn't 'auto-assign' a random icon to them? This is a major barrier to my mod's completion.
 
Just wanted to say thank you for this tutorial.

Just a thought I was hopping if you could put in all the fbx and diff texture files needed to complete this tutorial so I can have a practice run in this step with out having any knowledge with creating models and textures.
 
It's hard for me to complete the tutorial with out having a fbx model and texture to put in the first step of this. I have tried to create my own and with no luck have I succeeded. I am stuck in looking for tutorials to actually get me to a point where I can start this one.

Thanks anyways
 
Guys, I am having trouble with a new Unit that I created (Unit Class and Unit Type) loading in the game. I set it so that the ottomans would start with this Unit just so that I could see it in game, but it never starts there nor can I build it even though I temporarily set the Prereq tech to Agriculture. Is there something more that goes into creating a new unit CLASS that wasn't covered in this tutorial aside from just adding the <UnitClass> tags and adding a new one at the beginning of the new unit's XML?

The unit is just a recolored Knight, so I made it easy on myself, and it uses all of the Knights animations, just a new gr2, fxsxml and dds file made by myself in Paint.NET. Any pointers?
 
Nexus Buddy is great! So simple to use!

I have a problem, was hoping someone might know how to fix:
I created a run animation in Blender...everything looks fine. After I use Nexus Buddy and put it in the game, it looks like two of the vertices are pinned to the ground, distorting the graphic. I can't figure out why or how to fix it. Any ideas?
 
Blumonster - there can be errors when exporting gr2 files, the best way to work around it is to check your gr2 file in Granny Viewer after you export. If you get errors, export it again and keep doing so until it displays correctly.

It's a bit weird that this should be necessary, but it's a bug in Nexus' granny support and not something we can fix.
 
Back
Top Bottom