Lua Code - Map Generation

S3rgeus

Emperor
Joined
Apr 10, 2011
Messages
1,270
Location
London, United Kingdom
Hello, hello! I'm new, so I'll start with a big hi to the Civilization Fanatics forum! All of the posts on here have been immensely helpful in working on my first mod, so thank you everyone. I've never done any game modding before per se, but I have a background in programming, so it hasn't been too difficult to get into. Hardest part is figuring out what all the already built in objects actually do. Anyway! On to the actual matter I've finally registered to post about!

I'm looking at changing a component of the way maps are generated when my mod is active. (If you're wondering, you'll hopefully see an early alpha of my mod up sometime soon-ish, maybe like a week from now.) Specifically I want to add a new feature. (Feature being the technical thing, like ice or marsh or fallout on a hex plot) I can basically follow what FeatureGenerator.lua does, but I'm unclear on how I can add in small things to modify/add to the actual code? Would it be best to create a new file of the same name in my mod with all the original code copied in plus my additions so it will replace the vanilla file in the VFS? I have a feeling there should be a more elegant and modular way of doing it that I'm missing.

Any help would be much appreciated! :)
 
if you want to change all maps generation, I'm afraid you'll have to replace one of the vanilla file using VFS.

see the notes in AssignStartingPlots.lua to know why firaxis has chosen this inelegant system :o
 
Woah, that was immense. I just read through that whole file and I can see why the other files are set out like they are. Those dev comments were really helpful for understanding the code, and I think I know what to do to get the feature placed properly and adjust the starting locations for civs appropriately, but that's a lot of work lol, so maybe in a later version of the mod. Thanks for the heads up!
 
Back
Top Bottom