shandelman
Chieftain
- Joined
- Nov 2, 2014
- Messages
- 13
I'm messing with loadout options and I want to add one which spawns resources when you land (this may or may not be balanced / a good idea, but I want to make it work.)
So I have a good example of a lua script which checks for unimproved plots and spawns resources on them ( http://steamcommunity.com/sharedfiles/filedetails/?id=334311837&searchtext= ), but I don't know how to set a function to run on your capital at the start of the game.
I assume this requires a Lua script as well as some event attached to startup in the way that (presumably) things like the existing starting buildings are attached? Will Mod Builder set all this up automatically with just the usual InGameUIAddin pointing to the .lua file or do I need to set up an additional entry point?
But, primary thing, I can't figure out which Lua files contain the code which executes the stuff in the existing xml for loadout ( C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization Beyond Earth\assets\Gameplay\XML\Civilizations )? As an alternative, I'm thinking I could *maybe* sub in a modified GenerateLuxuryPlotListsAtCitySite - except that I can't find that either (it's called in AssignStartingPlots.lua but it doesn't seem to be coded in there or in MapmakerUtilities.lua... I did a search for all the files in gameplay/lua and found nothing... )
For the second option, I *also* don't know what all steps I would need to override a function declaration, or if that is even possible would I need to fork the entire lua file to change the function used in the local scope?
Thanks.
So I have a good example of a lua script which checks for unimproved plots and spawns resources on them ( http://steamcommunity.com/sharedfiles/filedetails/?id=334311837&searchtext= ), but I don't know how to set a function to run on your capital at the start of the game.
I assume this requires a Lua script as well as some event attached to startup in the way that (presumably) things like the existing starting buildings are attached? Will Mod Builder set all this up automatically with just the usual InGameUIAddin pointing to the .lua file or do I need to set up an additional entry point?
But, primary thing, I can't figure out which Lua files contain the code which executes the stuff in the existing xml for loadout ( C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization Beyond Earth\assets\Gameplay\XML\Civilizations )? As an alternative, I'm thinking I could *maybe* sub in a modified GenerateLuxuryPlotListsAtCitySite - except that I can't find that either (it's called in AssignStartingPlots.lua but it doesn't seem to be coded in there or in MapmakerUtilities.lua... I did a search for all the files in gameplay/lua and found nothing... )
For the second option, I *also* don't know what all steps I would need to override a function declaration, or if that is even possible would I need to fork the entire lua file to change the function used in the local scope?
Thanks.