I've been taking a look at the link about the Lua resources provided by cazfi. I haven't the chance to put it into practice yet, but reading the list let me give a very rough idea of how to implement the "revolting cities" feature.
If I'm not mistaken, there are no specific Lua commands to transfer ownership of a city from one player to the other, so this wouldn't be possible in a direct manner. One way to achieve this transfer of ownership, ina very indirect manner, would be to do so:
1- Find a city which has been in disorder for some time (I think the find and city modules would be useful here).
2- Try to read all that is possible about this city (name, tile, size, buildings and any unit which is homed to this city) and store it for later use.
3- Destroy the city.
4-Create a new city (after creating a new player, of course) using all the data gathered by the last step, also add a government center to this city. The edit feature would be useful here).
5- Take all units homed in the older city, make this new city these unit's new home city, and transport them to this new city.
Of course, this method is a little more convoluted than a simple "transfer ownership" would be, and I have the feeling it wouldn't be very efficient memory-wise, maybe. But in terms of gameplay, it should give roughly the same results in terms of gameplay, wouldn't it?
Newbie Modding Questions
Re: Newbie Modding Questions
One thing you should do, now that you have a clearly defined need for an addition to the lua API ( method to transfer city from a player to another ), is to open a ticket about it -> https://osdn.net/ticket/newticket.php?group_id=12505
With the current freeciv versions you may need to use the method you described, but we should make it better for the future versions.
With the current freeciv versions you may need to use the method you described, but we should make it better for the future versions.
Re: Newbie Modding Questions
It all depends on the level of the cntributorcazfi wrote: ↑Mon Jun 26, 2023 8:14 pmThere's plenty of things to implement in freeciv itself, if one is ready to contribute
https://osdn.net/projects/freeciv/ticket/


--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...