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 Stat VariationTutorial for BFME, BFME 2, ROTWK
Ever since I entered the modding community, I have constantly seen mods go for graphical variation. Making units in a horde look different, giving them different weapons etc. One day I decided to go one step further, and attempt to implement a system whereby units in a horde would all differ from each other in statistics (as well as appearance). At the time I had no working computer, so the idea remained in my head for a while as I thought of ways to implement it. My first try at implementing involved using the random peasant code. I created almost 400 different orc warrior objects, giving them all different armour/weapon sets. It worked of course, but was way too time consuming for something that I wanted to implement for every single unit. The second method I came up with is the one I'm still using today. While not perfect, I am very proud of it. It uses LUA (which most people use to variate between equipment), but it's really very simple to understand. It's not difficult at all, it's just that I've used the old LUA methods to create a new system. In this example I will use the Doriath Warrior object, as seen (hidden) in my own mod, WOTS. First things first, we need to set up the LUA. In your unit INI (not horde!) search for AIUpdate, and in that behaviour block you will see the following:
Basically change the 'DoriathWarriorFunctions' to something suitable for your unit. (NOTE: It is important that you don't give this same set of functions to the horde object otherwise all your work will be for naught). Next open up scriptevents.xml (in datax.big I believe, where x is a random number depending on the game). You need to add your new function to the list. It should look something like this:
As you can probably see, this is saying that when the unit is created it runs the script 'OnDoriathWarriorCreated'. Now I'll show you this script:
If you're not familiar with LUA I'm sure your reaction to that is something along the lines of 'O_o'. Basically what it does is get random numbers for 3 variables (health, armour and weapon). Feel free to add as many (or as few) variables as you like here. It then has a simple IF function, saying that (depending on the random number) a unit should be given an upgrade (or not, which means they'd take the default value). This system is set up to give 6 possible values for health, armour and the unit's weapon. CreditsCommentsDisplay order: Newest first zimoo - Tuesday May 29, 2007 - 7:07 Well what you could do is do the uniquer variations (accuracy, radius damage, poison etc) through use of various weaponstates (I don't know if WEAPONSET_HERO_MODE would work with units, but it'd be worth a try) then do all the 'standard' damage variations through attributemodifiers. Bart (Administrator) - Tuesday May 29, 2007 - 5:43 Very original. I do wonder, how to do this in BFME 1, where there aren't hundreds of CaH weapon states? Sulherokhh (Team Chamber Member) - Tuesday May 29, 2007 - 4:35 Great idea! Sweet and neat! That lends itself to those units that have already lua-coded weapon/armor differentiation. I guess this will be useful many times! :) |
|||||||||||||||||||||||||||
"One site to rule them all, one site to find them, © All Rights Reserved Eric Edwards ©2013. |