I want to develop a mod of the standard BtS game on an Earth map. I've identified three mods that I'd like to do using Python only, and a few different ways I might get there. My goal is to mod it as little as possible so as not to interfere with multiplayer.
I
First, I'd like to make a mod that ensures correct city placement for certain key cities. I do NOT want to make a complex dynamic naming and renaming system like in Rhye's.
is it possible to define a Python action for an occurrence at the time the occurrence happens rather than simply at the beginning of the turn? If so, I'd like to define an event similar to OnCityFound where any time a city is founded its coordinates are compared to a master list of all coordinates on the map and the city name associated with that tile is selected, no matter who is doing the founding.
If it is not possible to define a Python event except at the beginning of a turn, I'd like to create one that searches every 25 turns for level 1 cities present on certain key tiles. If a city is found on that tile, I want the game to rename it. This way, a key city will only carry a wrong name for a few turns. For instance, I can have it check plot 30,47 every 25 turns, and if there is a level 1 city on that tile, rename it New York regardless of the owner. This way, even if a city is razed and later refounded it will still have the right name. If I have to, I can come up with a short list of perhaps 30 tiles worldwide to be defined like this.
Do either of those approaches seem like they might be possible?
II
If I can define Python events other than for the beginning of the turn, I'd also like to create something that forces certain civs to select certain religions when "choose religion" is turned on. But I need to figure out first if a Python event can be defined for other than the beginning of a turn.
I suppose that since I'd be modding it anyway, I can just mod the leaders to have a particular favorite religion (so that Ramesses selects Islam rather than Hinduism, for instance)
III
I also want to see if I can spawn a unit for a dead civ. I can use this to mimic dynamic starts in a way. For instance, I can start the Romans in 4000BC with only a work boat. That boat will either survive or not. I'd like to use something like Barbs.py to then spawn a Roman settler in 770BC. If I do that with worldbuilder, the Roman civ comes "back to life" even though it was destroyed before. How can I get Python to generate a unit for a civ that currently has no representation on the map? Civs that "start" that way will, of course, not be playable by humans from the beginning. I would also need to first perform a search for any cities on their start tile and either raze that city or (better yet) change the city owner to the intended civ (only spawning a settler if the tile is empty).
Before I embark upon trying to code these things amidst my heavy work schedule, I just want to know if there are things that are based on false principles and will not work at all.
I
First, I'd like to make a mod that ensures correct city placement for certain key cities. I do NOT want to make a complex dynamic naming and renaming system like in Rhye's.
is it possible to define a Python action for an occurrence at the time the occurrence happens rather than simply at the beginning of the turn? If so, I'd like to define an event similar to OnCityFound where any time a city is founded its coordinates are compared to a master list of all coordinates on the map and the city name associated with that tile is selected, no matter who is doing the founding.
If it is not possible to define a Python event except at the beginning of a turn, I'd like to create one that searches every 25 turns for level 1 cities present on certain key tiles. If a city is found on that tile, I want the game to rename it. This way, a key city will only carry a wrong name for a few turns. For instance, I can have it check plot 30,47 every 25 turns, and if there is a level 1 city on that tile, rename it New York regardless of the owner. This way, even if a city is razed and later refounded it will still have the right name. If I have to, I can come up with a short list of perhaps 30 tiles worldwide to be defined like this.
Do either of those approaches seem like they might be possible?
II
If I can define Python events other than for the beginning of the turn, I'd also like to create something that forces certain civs to select certain religions when "choose religion" is turned on. But I need to figure out first if a Python event can be defined for other than the beginning of a turn.
I suppose that since I'd be modding it anyway, I can just mod the leaders to have a particular favorite religion (so that Ramesses selects Islam rather than Hinduism, for instance)
III
I also want to see if I can spawn a unit for a dead civ. I can use this to mimic dynamic starts in a way. For instance, I can start the Romans in 4000BC with only a work boat. That boat will either survive or not. I'd like to use something like Barbs.py to then spawn a Roman settler in 770BC. If I do that with worldbuilder, the Roman civ comes "back to life" even though it was destroyed before. How can I get Python to generate a unit for a civ that currently has no representation on the map? Civs that "start" that way will, of course, not be playable by humans from the beginning. I would also need to first perform a search for any cities on their start tile and either raze that city or (better yet) change the city owner to the intended civ (only spawning a settler if the tile is empty).
Before I embark upon trying to code these things amidst my heavy work schedule, I just want to know if there are things that are based on false principles and will not work at all.