|
Battles of Gondor, the War in the South Converts BfME2 RotWK to the war in the south, bettween the armys of Gondor and Mordor. 4.0 released. |
![]() |
Quick Lists Top RatedArticles Texturing the Gola… How to Make an EA… Adding your own Cr… Adding Morthond Bo… Retain textures wh… Horde Mount/Dismou… In-depth AI Coding Creating a Dwarven… Adding new videos… Rohirrim Archer Tu… Mods The Rhovanion Alli… RJ - RotWK The Elven Alliance Special Extended E… The Wars of Arda Kings of the West… Helm's Deep Last H… The 4th Age Battles of Gondor,… Wars of the East Downloads Southern Fiefdoms… Fall of the Iron C… Free Models/Skins… Nertea's Dwarf Ski… Converted BFME Maps CAH - Dwarven Sage DDS Converter GIMP: GNU Image Ma… FX Particle System… INI packages for -… |
||||||||||||||||||||||||||||||
![]() |
Register and log in to move these advertisements down Stat VariationArticle for
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. Credits
CommentsDisplay order: Newest first zimoo - Tuesday May 29, 2007 - 9: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. 2playgames (Administrator) - Tuesday May 29, 2007 - 7:43 Very original. I do wonder, how to do this in BFME 1, where there aren't hundreds of CaH weapon states? Sûlherokhh (Team Chamber Member) - Tuesday May 29, 2007 - 6: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 find them all, one site to guide them, © All Rights Reserved Eric Edwards. |
|||||||||||||||||||||||||||||||