| Welcome Guest ( Log In / Register ) |
![]() |
Quick Lists Top RatedArticles Living World Map G… Testing of scripte… Texturing the Gola… Extended Guide to… Binding Human Mode… How to Make an EA… In-depth AI Coding Camera System Scratch Modeling a… Adding Morthond Bo… Mods The Dwarf Holds RJ - RotWK The Elven Alliance… The Elven Alliance The Wars of Arda Helm's Deep Last H… Special Extended E… Kings of the West… The 4th Age RC Mod Downloads Southern Fiefdoms… Legends New RotWK Living M… Haldir's Map Pack Fall of the Iron C… Free Models/Skins… Nertea's Dwarf Ski… Middle Earth Vault… DDS Converter Converted BFME Maps |
||||||||||||||||||||||
![]() |
Register and log in to move these advertisements down Advanced LUA: Helper FunctionsArticle for
Table of Contents: Page 1: Introduction Page 2: A Hide Subobject Function Page 3: A Randomize Subobject Function Page 4: Storing things for easy access Introduction First I'll note: this stuff will likely apply to BFME2 as well, however it's untested in that environment (lua did change some, so it might not work). This tutorial is for the BFME user who already understands the basic use of lua, and wants to learn a bit more about ways of streamlining workflow. Actually writing these helper functions does require some proper scripting experience, so beware! In some ways this is more of a resource than a tutorial - anyone can use these script functions if they like. They deal with ways to automate tedious repetitive code writing or copy-pasting in this domain - in particular the primary use of lua code in BFME - randomizing weapons/accessories on a model. First, a little about the functions defined in scripts.lua. If you don't know where/what this file is, you should probably take a look at some other tutorials on lua in BFME first.
These are important in 3 ways: the first because it's good to know, the third because it's important to know when you've made a syntax error, and the second because it's the focus of this tutorial. I'm going to talk about how you can use other functions in the file in a 'primary' function - say, a hypothetical thing like
On to the article! CommentsDisplay order: Newest first Nertea (Staff) - Tuesday December 22, 2009 - 10:25 lua tables aren't really pure arrays because of their interesting key/record system. I'm not really a programmer, but my experience with actual programming languages has shown that lua tables don't behave the same way, so I guess it's ok for them to call them something else. Kinda like python's lists really. Bart (Administrator) - Friday December 18, 2009 - 5:47 Nice tutorial. I wonder why LUA calls arrays tables though. Nertea (Staff) - Saturday November 21, 2009 - 13:42 Glad it's a bit helpful. I do want to know if anybody uses this, and with what degree of success, partially for interest's sake and partially to see if it's worth writing up stuff about other lua script tricks that I've developed/am developing. Rob38 (Division Leader) - Thursday November 19, 2009 - 18:29 Interesting. I also use lots of random stuff for my models so this can be very helpful. Sulherokhh (Team Chamber Member) - Wednesday November 18, 2009 - 6:39 Yippee! I love tuts like that, easily accessible and immediately useful. |
![]() |
|||||||||||||||||||||
"One site to rule them all, one site to find them, © All Rights Reserved Eric Edwards ©2009. |
|||||||||||||||||||||||