I'm a lurker of some time who finally registered on these boards to ask you guys for advice.
So, I have finally taken the plunge and started modding civ again, after a 10 year hiatus. I'm working within the RFC framework as the mod is pretty much doing everything I ever wanted from a game of Civ. But of course it has to be modded to suit my own preferences and the historical scenarios I like to focus on.
The thing is that I really don't know any Python or XML (or any other programming language) but I brave on nonetheless, testing things and learning new stuff as I go along. I pretty much succeeded with the XML stuff I wanted to implement.
So, as for my first question. Since I don't know any Python I try to follow the in-code comments and plain logic as to what the code actually does. Some things are pretty straight forward but some other stuff I can't, for the life of me, figure out. Since I'd like to add more unit spawns I really need to understand this bit of code (Barbs.py, line 366):
if (iTurn % iPeriod == iRest):
So I understand that iTurn is the current game turn, and iPeriod and iRest are numerical variables. I suspect that this function is creating an interval between spawns, but i really can't seem to fathom what the "%" character does in order to achieve this. (There is a relationship between the game turn and the iPeriod value, and the units are created if they match the iRest variable.)
Thanks for any help with this - more questions are likely to follow since I've finally registered.
disclaimer: English is my third language so I apologize for any typos and the like.
So, I have finally taken the plunge and started modding civ again, after a 10 year hiatus. I'm working within the RFC framework as the mod is pretty much doing everything I ever wanted from a game of Civ. But of course it has to be modded to suit my own preferences and the historical scenarios I like to focus on.
The thing is that I really don't know any Python or XML (or any other programming language) but I brave on nonetheless, testing things and learning new stuff as I go along. I pretty much succeeded with the XML stuff I wanted to implement.
So, as for my first question. Since I don't know any Python I try to follow the in-code comments and plain logic as to what the code actually does. Some things are pretty straight forward but some other stuff I can't, for the life of me, figure out. Since I'd like to add more unit spawns I really need to understand this bit of code (Barbs.py, line 366):
Spoiler :
if (iTurn % iPeriod == iRest):
So I understand that iTurn is the current game turn, and iPeriod and iRest are numerical variables. I suspect that this function is creating an interval between spawns, but i really can't seem to fathom what the "%" character does in order to achieve this. (There is a relationship between the game turn and the iPeriod value, and the units are created if they match the iRest variable.)
Thanks for any help with this - more questions are likely to follow since I've finally registered.

disclaimer: English is my third language so I apologize for any typos and the like.