Welcome Guest ( Log In / Register ) |
Quick Lists Top RatedTutorials Living World Map G… Ultimate beginner'… Arrow scaling bug… Raising Heroes max… Creating an asset.… Proper Fire Arrow… Simple Structure B… Making a simple Ma… Quick and easy sno… Making patrols nea… Mods The Dwarf Holds The Peloponnesian… RJ - RotWK The Elven Alliance… Helm's Deep Last H… The Elven Alliance Special Extended E… Kings of the West… RC Mod The Wars of Arda Downloads BFME1 1.06 Widescr… Enhanced W3D Impor… Fudge's Map Pack LotR/BfME HD Logos Osgiliath Shellmap Crystals Of Ancien… 2v1 Wold The forests of Dru… Converted BFME2 an… ROTWK animations f… |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
Register and log in to move these advertisements down Adding a new unit
The Basics - Adding A New Unit Written by: Hostile The purpose of this tutorial is to go step by step on explaining each major part of the object code. This doesn't cover every single aspect or the tutorial would run for pages. But does cover enough of the basics to give you an idea of how it works. There are basic parts of a unit that I will list here. Object Code - coding the unit Model/Skin/Animations - this tutorial assumes you have these ready Upgrades Special Powers/Spells Command Buttons Before embarking on this challenge of adding a New Unit, I suggest you read the beginner tutorials so that you know how to extract the INI's and use your edited INI's. All the tools you need to add your new faction can also be found in the Downloads section. So, let's get started. I'm going to start with the object code as it is the most detailed and important. Also the easiest to make a mistake on. I've broken down the object code into sections that will address differant parts of the new unit. I'm going to be working with Mordor Goblin Fighters because I believe they are simple but allow enough variations for a good example. Open up the object ini file for Mordor Goblin Fighter located at \data\ini\object\evilfaction. I've included a seperate text file for you to view so you can just click here for a copy of just this file instead. OBJECT CODE Art Code Models Animations Condition States The code begins with the art for this unit.
But most have a portrait here such a gondor soldier.
It starts by naming the image ini to use, in this case it is not a button, no art necessary. But most units name a portrait image to be seen in the display when you click on it. The next line DRAW = W3DHordeModelDraw ModuleTag_01 is a basic command telling the game that this is a unit that will eventually form a horde. You'll use this often for new units. I've included a section of the next code because it sets up how the art is done over differant resolutions. I would just copy paste all three LodOptions. It's standard... The next code gives the options for random textures for our goblins, so they don't all look alike. MUGblnSwrd2.tga 0 MUGblnSwrd.tga, means that sometimes instead of the standard skin, substitute it for the first one. Lastly here we set our default model and skin. So the game knows what the model and the skeleton is we are working from. Next starts the real art code. It states a condition state and what animation should be used when this condition state is true. Example: FALLING
The first animation (condition) state describes when the goblin becomes a passenger. Namely this means when an eagle grabs one. Hence you can understand why it is called "wiggling". This animation state exists until the unfortunate goblin is dropped. Than it assumes the FREEFALL state. The THROWN_PROJECTILE state exists when the goblin is hit by something like a rock from an Ent. He flies back from the force. These are an example of how condition states work and react when units are interacted with. Now I'm not going to explain every condition state and how it relates. But by looking close at the code you'll notice you can code random dying animations and such based on how goblins land on the ground and such. Figuring this out is best left to the modder. That is part of the advanture. This finishes up the art section of the object code. I'll now get into the Design Parameters for the unit code. Layed out as such... OBJECT CODE Design Parameters Basics Weaponset Armorset Mmore Basics Commandset Let's start with the basics of DESIGN PARAMETERS
Next we move onto WEAPONSET. WEAPONSET is the weapon that the unit will use. This is a direct reference to the WEAPON.INI file located in data/ini/weapon.ini. A unit can have up to three weapons: PRIMARY, SECONDARY, TERTIARY.
Conditions sets when this weaponset is to be used. This can be None, Updraded, and so on. You may have multiple weaponsets based on the units statis. This can include upgrades, veterency, health, and so on. Many options to choose from. Look at the existing units for other options. Example: the Gondor soldier
Weapon = PRIMARY This can also include SECONDARY and TERTIARY weapons. You can define them all here. As many as you can think of. PRIMARY with an upgrade or veterency, SECONDARY with the same parameters. You can even state a condition state like REALLYDAMAGED. If you feel that your unit will change it's weaponset if it's really damaged. This is the condition to use. There are set condition states though. You cannot just make them up. If a goblin can use swords and bows than it would look like this:
That finishes WEAPONSET, let's move on to ARMORSET.
Conditions should now already be explained, Armor is listed in the armor.ini file. You can have an armor, an upgraded armor, veterency armor, and such. Not much to explain here. The armor ini can be located at /data/ini/armor.ini And some more of the basics. Such as:
This will list the actions that this unit can perform. This is directly referenced in the CommandSet.ini file located in /data/ini/commandset.ini
This is where you assign the voices to be used for your unit. You can record your own. But you must code them in the audio.ini file. Than you can reference your new ones here. OBJECT CODE Engineering Parameters Health Locomotor
Locomotors tell the computer how fast or how agile a unit is. It is defined in locomotor.ini located in /data/ini/locomotor.ini You may add other locomotors based on condition states such as upgraded, veterency, so on. The next part of the unit code is behaviors. Most flexible of the code and the most powerful. Sarumon cannot cast fireballs without a behavior being in his code to allow him to do this.
Nor can units recieve upgrades without some code here to support it.
Heroes need to be respawned, but they won't know that without having the code to support it.
Some units can auto heal based on this behavior:
Behaviors do so much more than I can begin to explain here. They are the backbone of all the special abilites of units. So I'll end that part here. The last part I'll finish with is geometry.
The model, believe it or not, has limited uses other than showing the player what is happening. The geometry of the unit tells the computer the size of the area that this unit actually makes up. This is what the game factors really use when determining how close one unit is to another. That finishes up the object code. Once this is complete to your liking than you have to add a commandbutton to build it and the command buttons to upgrade the unit and any other command buttons such as activating a spell and such. These command buttons are than added to the units commandset and the command button used to build the unit is than added to the structure that you would like to have build this unit. You must really look at the existing units to get a good grasp of just how all this fits together. See Command Button Tutorial. I hope this answers a few questions regarding the object code for your new unit. Any further questions about this tutorial can be answered by coming to our forums. Credits
CommentsDisplay order: Newest first memocarvajal - Thursday December 6, 2012 - 18:21 you can make a video of each step to create a unit if possible friend Emperor of the East - Friday November 20, 2009 - 23:30 I am trying to make new units out of existing files for my Men of the East faction and my Rohan faction, and this is getting to be confusing due to the differences between these guidelines and the units I downloaded off of here. Akhôrahil - Friday August 24, 2007 - 18:00 It's a article that tells you how to add new units, not new skins. Ultama - Sunday August 19, 2007 - 9:56 This really dosnt tell me about adding new skins to troops =/ |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
"One site to rule them all, one site to find them, © All Rights Reserved Eric Edwards ©2013. |