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 Weapons & WeaponsetsTutorial for BFME
Adding A New Unit - Weapons Written by: Hostile The purpose of this tutorial is to give you an understanding on how weapons work. This should help you to make your own weapons. This doesn't explain every possible item but gives an overview of what is possible. We will get started with understanding how the weapon.ini works. Besides a weapon having numerous settings to control attack range and clip size and such, they specifically use NUGGETS. A NUGGET is a section of code that defines how the weapon will behave when it comes to damage. We'll start by looking at Legolas Bow. The weapon itself is defined. The object that will be the arrow is defined, and the warhead itself is defined. The bow itself does no damage, nor does the arrow. It's the arrowhead that does the damage. The rest is just the delivery mechanism.
The code starts with defining the attack range. LEGOLAS_BOW_RANGE is directly referenced from the gamedata.ini. You may just place a number here if you do not feel like listing it in the gamedata file for your new weapon. Weaponspeed is pretty cut and dried. How fast is this arrow going to fly to it's target? Min/Max WeaponSpeed scales the speed ingame so when firing at a target very close, it will slow down so you can see the fx better. The opposite being true for farther targets. This also takes into account that objects appear faster when closer to the ground than high in the air. Used for "lobbed" weapons. FireFX is referenced from the fxlist.ini. This allows you to add sounds FX, or particle FX to a weapon when it fires. Looking at the code from the fxlist.ini, is basically just includes a sound.
ScaleWeaponSpeed goes hand in hand with the Min/Max WeaponSpeed. This is required to tell the game to use such parameters. HitPercentage is fun because you can assign it to miss with some percentage. Not every archer hits thier mark everytime. You can also tell the game how much can he miss by with the ScatterRadius. You might not hit your exact target but if there are enough targets, you might hit something.
These settings control how long it takes to retarget, fire again, and how long it actually takes while firing.
Clipsize can be interesting because you could have a repeat fire bow. Shoots threes arrows at once. ClipReloadTime tells us how long does it take for Legolas to knock an arrow. These are defined in gamedata.ini.
The next two lines of code allow this weapon to be fired at flying vehicles (Mmmm...) and flying monsters. The last section defines what the object is that flies from the bow and what arrowhead will it be carrying. ProjectileTemplateName is the object that is the arrow itself. The Arrow object is a projectile that carries the arrowhead. It is actually an object located in \data\ini\object\goodfaction\goodfactionsubobjects.ini. Use control "F" and search using GoodFactionArrow. You'll see all kind of variations of the arrow based on faction or upgrades and such. WarheadTemplateName is the arrowhead itself. This is what causes the damage. Legolas does not have flaming arrows as an upgrade. But if you wanted him to, than you can look to the normal bowmen for the code.
The first ProjectileNugget forbids it to be available if there was an upgrade to flaming arrows. The second Nugget it what activates the new warhead type based on the upgrade. You could very well add poison arrows, if you like, that does more damage to infantry but less to structures. Play with it and see. Let's talk more about the warhead.
This project can collide with just about all the units on the field. Why you would want to shoot your allies is a good question. HitStoredTarget from my point of view is used for hordes. This mean no matter what the miss ratio, at least the first target is hit. The DamageNugget defines what kind of damage this arrowhead is capable of delivering. The damage itself is defined in gamedata.ini. The damage type seems redunant. I'm not sure on that one but DamageFXType gives us a chance to define whether the target is hit by a normal arrow, a flaming arrow, or poison arrow. You can define what the FX looks like in fxlist.ini. DeathType tells the computer what animation it should use when the unit dies from the arrow. There are specific deathtypes used in the game. Alittle research will show you there are quite abit. You may have a arrow that crushes your enemy if you choose. You can also have a damage radius for the arrow. Does this arrow have a granade tied to it? If it does than you can blast more than just the unit you hit. This can even be made more fun by adding a DelayTime, the arrow can hit, than a second later it blows up. This allows the unit hit to be able to look down and see the grenade tied to the arrow before it blows up. If you look to the fire arrows you'll see additional damage nuggets to reflect the new damage types. Such as this:
Now, not only did you get shot with an arrow, now you're going to get fire damage as well. So you are getting multiple damage here. DamageScalar = 50000% NONE +MINE means that this will cause a mine to blow up with a flame arrow. Bet you didn't know that huh? Let's get into close combat weapons now. We'll look to the Gondor foot soldier.
Close range weapons should be a breeze to understand after the bows. LeechRangeWeapon is something I can't figure out. AttackRange is how far from the enemy you can be when you can start attacking. The DamageNugget is the same as above but notice the damage type, SLASH. There are also PIERCE and such. I'm not sure what advantage one has over the other but here they are. But here is a list of damage types. It's not a complete list but should get you started. "FORCE", Formless force, like shockwave "CRUSH", Blunt and heavy hit "SLASH", sharp and slicey hit "PIERCE", pointy and pokey hit "SIEGE", Siege weapons get their own thing "FLAME", Burning "HEALING", Special use healing "UNRESISTABLE", Special use system damage "WATER", Falling in water "PENALTY", Special use system damage "FALLING", Falling far and hitting ground "TOPPLING", Trees That finishes up weapons. But for every offense there is a good defense... I hope this answers a few questions regarding the weapon code for your new unit. Any further questions about this tutorial can be answered by coming to our forums. Credits
CommentsDisplay order: Newest first Ridder Blauw - Wednesday June 18, 2008 - 23:03 I did not get your tutorial, but I think I was not reading it correctly, so my brother did it for me. Sulherokhh (Team Chamber Member) - Monday April 30, 2007 - 19:04 Damage type is only important to determine, which armor filter is used. But i have no idea about the LeechRangeWeapon either. Otherwise a very good summery! |
|||||||||||||||||||||||||||||||||||||||||
"One site to rule them all, one site to find them, © All Rights Reserved Eric Edwards ©2013. |