RFC w Ireland v1 ...new civ, new flag, new everything...well, almost everything

which is difficult? Irish or Python? Baldyr was trying to give me a crash course all through RFC with Celts development, but I simply didn't have time to absorb or build on alot of what he imparted to me. I feel kinda bad, although I've saved all the messages and at some point when I'm done with this thesis I'll revisit it and try to fill in my python-knowledge gaps, and some C++ to boot.
Well, I'm looking forward to both sharing with you all the Python stuff I've learned since (and its a lot), and also for a opportunity to learn C++ from you. (I wouldn't even dare to compile the dll on my own...) Because I'm only fluent in Python - and once you learn some of both languages, you would be able to tell me what the difference between the two would be. :king:

It could also be noted what while you're somewhat of a renaissance man of modding, I'm more of a one-trick-pony. (I'm pretty confined to Python only, I'm afraid. Is there anything you haven't meddled with yet? :eek:)
 
Well, I haven't tried to make new functions...in either C++ or python...everything I've done has been to redefine existing functions by playing with their variable values (teams, coords, quanties, units, etc). The only new mechanical functions were written by you as part of custom.py and used by me for "reality checks."

I don't find C++ markedly harder than python for my purposes, only slightly so as python is closer to plain english whereas C++, while still comprehensible MOST of the time, is one step removed from that.

Now if anybody can edit a binary file manually I'd really be impressed =P
 
alright, finally got the art fixed, v2.3 is up, I think that's going to be the final one except for translations
 
This modmod looks very nice, just as the Celt one was. Where is v2.3? I'll probably find it...

EDIT:
Oh yes, it was on front page, my bad.
 
Playing just now it appears that the English Domination UHV is still broken. I didn't notice when it happened, but playing now it reported as succeeded when it wasn't. If anyone who knows can take a look at the code in victory.py, maybe they can spot what I've done wrong.

I just happened to see that it read YES when England was neither vassalized nor conquered. I had some cities in Britain, but my culture at the time I noticed the error was only ten tiles.

elif (iPlayer == iKhmer):
if (pKhmer.isAlive()):

if (iGameTurn >= getTurnForYear(860) and iGameTurn <= getTurnForYear(1500)):
bEngland = False
if (self.getGoal(iKhmer, 0) == -1):
bEngland = self.checkOwnedCiv(iKhmer, iEngland)
if (bEngland):
self.setGoal(iKhmer, 0, 1)
if (iGameTurn == getTurnForYear(1500)+1):
if (self.getGoal(iKhmer, 0) == -1):
self.setGoal(iKhmer, 0, 0)
 
You use this function to determine whether or not the UHV is met:
self.checkOwnedCiv(iKhmer, iEngland)
Looking at the function definition itself, I can report that what it does is the following:

It counts the number of cities within the English Normal Area for both the Irish and the English respectively. The function returns True (and thus enables the UHV to be set to Achieved) if one of two conditions are met:

1. The Irish control 2 or more cities in England and they control more cities in the area than England does.

2. The English are dead and the Irish control any number of cities in the area.

Is this what you were aiming for?
 
Hm, no, I was going for "English civilization killed or vassalized by Ireland"...I patterned mine after another UHV that I thought would achieve that result.
 
I am having a problem with this mod and it's the same one from the Celt mod, I can't vassalize. In the Civilopedia there is no 'Game Concepts' there is a 'RFC Concepts' and everything else but it doesn't have Vassals in the game period. Help please?
 
Hm, no, I was going for "English civilization killed or vassalized by Ireland"...I patterned mine after another UHV that I thought would achieve that result.
In that case - are you gonna keep the current one - and do you still need to have it debugged?

As it stands now you should probably rename it "Dominate Britain by AD 1500", or something. I don't necessarily thing that its a bad UHV, but it might be too easy to achieve?
 
Yes, I feel it is. I was thinking perhaps "no foreign culture on the british isles," but I would prefer it if you could win by vassalizing england as well.

robdude, I'm not sure where you're encountering this problem. I'm playing the version available for download right now and i just vassalized the inca.

What civics do you have right now, and do you have Monarchy completed already?
 
Baldyr, what are the values for the domination...is there a way to raise it so that it's harder? I don't see where you see "two cities and more than X"...
 
Baldyr, what are the values for the domination...is there a way to raise it so that it's harder? I don't see where you see "two cities and more than X"...
No, the function only takes the two Civs as arguments, so you'd have to change the date in order to make the UHV harder.

This is the breakdown:
Code:
1. def checkOwnedCiv(self, iActiveCiv, iOwnedCiv):
2.        dummy1, plotList1 = utils.squareSearch( tNormalAreasTL[iOwnedCiv], tNormalAreasBR[iOwnedCiv], utils.ownedCityPlots, iActiveCiv )
3.        dummy2, plotList2 = utils.squareSearch( tNormalAreasTL[iOwnedCiv], tNormalAreasBR[iOwnedCiv], utils.ownedCityPlots, iOwnedCiv )
4.        if ((len(plotList1) >= 2 and len(plotList1) > len(plotList2)) or (len(plotList1) >= 1 and not gc.getPlayer(iOwnedCiv).isAlive())):
5.                return True
6.        else:
7.                return False
1. function definition, the parameters are "iActiveCiv" and "iOwnedCiv"
2. stores the number of cities for iActiveCiv in "plotList1"
3. the same for iOwnedCiv and "plotList2"
4. the condition(s)
5. enable if the conditions are met
6. else...
7. ...disable

The command "len" is short for "length", so in this case it is used to determine how many city instances are present on each list. The function could also be written like this:
Code:
def checkOwnedCiv(self, iActiveCiv, iOwnedCiv):
        dummy1, plotList1 = utils.squareSearch( tNormalAreasTL[iOwnedCiv], tNormalAreasBR[iOwnedCiv], utils.ownedCityPlots, iActiveCiv )
        dummy2, plotList2 = utils.squareSearch( tNormalAreasTL[iOwnedCiv], tNormalAreasBR[iOwnedCiv], utils.ownedCityPlots, iOwnedCiv )
        activeCities = len(plotList1)
        ownedCities = len(plotList2)
        return (activeCities >= 2 and activeCities > ownedCities) or \
               (activeCities >= 1 and not gc.getPlayer(iOwnedCiv).isAlive())
 
hm, another valid "history's wishlist" UHV for the Irish would be "never lose a city to the English or Vikings before 1500"...or simply "never lose a city to the English or Vikings." In order to complicate matters, however, cities allowed to flip in the English spawn should count against the Irish UHV...
 
I think I was a little sleep deprived. No problems after I double checked. Thanks for the suggestions though.
 
hm, another valid "history's wishlist" UHV for the Irish would be "never lose a city to the English or Vikings before 1500"...or simply "never lose a city to the English or Vikings." In order to complicate matters, however, cities allowed to flip in the English spawn should count against the Irish UHV...
Well, you know that anything is possible. Its just a matter of defining what you need and then get some code to execute that very thing. If you can't code it yourself, you could always ask for help. Or you could learn the little bit of Python required to do it yourself. :p

The hot tip of the day would be to take a look at RFCUtils.py and see what handy functions Rhye has collected there. Chances are that he has already done what you need, so its simply a question of figuring out how to use it. So there would be no need to define functions of you own, or anything on that complexity level.

All (or most) functions take arguments - and they return something (even if its nothing or "None"). Figure out what the arguments are and what the output is. You don't even have to understand what the code in between the def(inition) line and return statement does.

You do however have to know Python syntax and some basic commands and statements, like those you've already used in your UHV code, and of course what the different operators look like and work. The most basic stuff.

Sorry for the rant... :rolleyes:
 
dummy1, plotList1 = utils.squareSearch( tNormalAreasTL[iOwnedCiv], tNormalAreasBR[iOwnedCiv], utils.ownedCityPlots, iActiveCiv )
I might add this:

The value passed as an argument to the function squareSearch, highlighted in the assignment statement above, is in fact a reference to another function, used by the squareSearch function. So you could probably imagine how squareSearch is a highly flexible function, as it can utilize other functions for doing its dirtywork. If you look around Rhye's code he makes repeated calls to squareSearch and feeds it different functions for different purposes.

So, the ownedCityPlots... eh subfunction :confused:, would be good for looking up the number of cities owned. Like it says in the function name. :rolleyes: There are other functions that could be used in the RFCUtils module (aka "utils"). The function "ownedPlots" might be useful to you, not?

But you can't change the checkOwnedCiv function in Victory.py because that would effect all UHVs using the same function! :eek: You could, however, copy-paste and rename another function. Then substitute the argument passed to squareSearch and change you UHV code to call on the new function instead. Or you could just click below and use the code attached. :rolleyes:
Spoiler :
Code:
def [COLOR="Red"]checkOwnedPlots[/COLOR](self, iActiveCiv, iOwnedCiv):
        dummy1, plotList1 = utils.squareSearch( tNormalAreasTL[iOwnedCiv], tNormalAreasBR[iOwnedCiv], utils.ownedPlots, iActiveCiv )
        dummy2, plotList2 = utils.squareSearch( tNormalAreasTL[iOwnedCiv], tNormalAreasBR[iOwnedCiv], utils.ownedPlots, iOwnedCiv )
        activeCities = len(plotList1)
        ownedCities = len(plotList2)
        return (activeCities >= 2 and activeCities > ownedCities) or \
               (activeCities >= 1 and not gc.getPlayer(iOwnedCiv).isAlive())
Otherwise there is also this in Victory.py:
Code:
        def checkOwnedArea(self, iActiveCiv, tTopLeft, tBottomRight, iThreshold):
                dummy1, plotList = utils.squareSearch( tTopLeft, tBottomRight, utils.ownedCityPlots, iActiveCiv )
                if (len(plotList) >= iThreshold):
                        return True
                else:
                        return False
Can you figure out what it does and how to use it? :D
 
Back
Top Bottom