| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Prince
Join Date: Oct 2010
Location: Ontario, Canada
Posts: 316
|
Static Analysis (Compile Time Error Checking)
Hello,
I'm getting very tired of spending 2-3 minutes loading a late game save I'm testing with just to find trivial syntax and variable name errors in my code. It doesn't help that Civ5 crashes on every second reload from within the game with this save. Is there anything simple to setup and use with ModBuddy that would do static analysis? I looked through http://lua-users.org/wiki/DetectingUndefinedVariables for a bit, but the stuff they refer to appear to be*nix O/S based. What do you hard-core modders do? Are you just using the Tuner and reloading code on the fly? I find the Tuner... intimidating. |
|
|
|
|
|
#2 |
|
King
Join Date: Jul 2002
Posts: 703
|
tuner and tests on duel size maps for fast reloads. there's a way to reload your lua (type include("yourscript") ), but its not really reload, its just reinclude, so it duplicates your stuff. eventually you need to reload the game.
there is logging that can be enabled (config.ini i think) that might show why there's a crash right away overall though, the tuner is the way to go imo. why do you find it intimidating? there's tabs that you use to point and click for stuff, there's tabs that have cryptic debug memory stuff that you ignore, and then there is the console. in the console you can test all the code you want to try out before putting it in a mod, meaning you plop in one liners there and find errors and only have to worry about logical or syntax errors in your main files later |
|
|
|
|
|
#3 |
|
Prince
Join Date: Oct 2010
Location: Ontario, Canada
Posts: 316
|
I have the debugging on. It does help a lot for certain kinds of errors. Good idea about using duel-sized maps. I tried figuring out what the heck to do with the tuner a couple of weeks back. I played around a bit, and felt like I didn't understand 90% of what I was looking at. I tried finding some sort of manual for it, and the documentation seemed to be almost non-existent. So I gave up on it. I guess I should have another look.
|
|
|
|
|
|
#4 | |
|
King
Join Date: Jul 2002
Posts: 703
|
Quote:
outside of the console the unit/improvement/resource plopper along with the city editor is very handy for setting up a test environment really fast, or just for plain old cheating too
|
|
|
|
|
|
|
#5 |
|
King of Ungulates
Join Date: Aug 2006
Posts: 2,161
|
I guess luac 5.1 should work for practically all of the Civ5 lua files. I doubt Firaxis has added or changed stuff on the C++ side to the extent of adding opcodes and such that would break the compiler
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|