[ModComp] JUnitReligion Mod

K Caesium, I looked into that error and I know how to fix it, I think. I will try to fix this and release a new version some time this coming week. If you know how cut and past into python I can pm you the lines that you need to add and tell ya where to paste them. :)
 
New Version Released

Alright, v0.45 has been uploaded, check the first post for the link. This version should be alot more stable as I rewrote it all to be more in keeping with the structure used by TheLopez in his ModComps.

There are three new config.ini options to control is Land, Sea, or Air units get a chance to have a religion when built. By default Land units can have religion, but Sea and Air units can not.

I ran it through about an hour of intensive testing, but its likly that a few small exceptions made it through, but none of the mod mechanics or game play should be effected. Please, anyone that plays without python exceptions hidden, please report any errors you get. :)
 
OK, just a few comments:

In line 80, you set the wrong ini-Name
In lines 84-86 it must be getboolean instead of getint

And, now, I've got two errormessages:
Traceback (most recent call last):

File "CvEventInterface", line 23, in onEvent

File "CvCustomEventManager", line 188, in handleEvent

File "CvCustomEventManager", line 199, in _handleDefaultEvent

File "CvJUnitReligionEventManager", line 48, in onBeginPlayerTurn

File "CvJUnitReligionGameUtils", line 518, in onBeginPlayerTurn

TypeError: iterable argument required
ERR: Python function onEvent failed, module CvEventInterface
Traceback (most recent call last):

File "CvEventInterface", line 23, in onEvent

File "CvCustomEventManager", line 188, in handleEvent

File "CvCustomEventManager", line 199, in _handleDefaultEvent

File "CvJUnitReligionEventManager", line 48, in onBeginPlayerTurn

File "CvJUnitReligionGameUtils", line 478, in onBeginPlayerTurn

AttributeError: 'NoneType' object has no attribute 'getNumUnits'
ERR: Python function onEvent failed, module CvEventInterface
 
Thanx Caesium, I got the typo errors fix and am looking into the exceptions. I thought I had both those fixed, will go over them again and get them fixed tonight, give me a couple hours and will have a new version up. :)
 
Bug Fixed Version Released

K, I think I solved those problems mentioned by Ceasium a few posts above. Opening post updated with the link to v0.46. :)
 
Next bug detected:
I gave buddhism to the city, where I was building the settler.
As I built the settler the message was, settler has judaism.
As I let him found the city, this city had judaism, while I didn't have judaism in any city.

Another question: Would you add an ini-switch for the informations?
In my opinion it would be better, if you don't know, what religion the settler's got.

Edit:

New error:
Traceback (most recent call last):

File "CvEventInterface", line 23, in onEvent

File "CvCustomEventManager", line 185, in handleEvent

File "CvCustomEventManager", line 196, in _handleDefaultEvent

File "CvJUnitReligionEventManager", line 48, in onBeginPlayerTurn

File "CvJUnitReligionGameUtils", line 491, in onBeginPlayerTurn

AttributeError: 'NoneType' object has no attribute 'isNone'
ERR: Python function onEvent failed, module CvEventInterface
 
just curious, but if you have this mod, are we missing the point of having missionaries and those other types of religious units? doesn't this defeat the purpose of those other units? just wondering. not meaning to diss your work, i'm sure it's good stuff.
 
Caesium said:
Next bug detected:
I gave buddhism to the city, where I was building the settler.
As I built the settler the message was, settler has judaism.
As I let him found the city, this city had judaism, while I didn't have judaism in any city.

Fixed, I just had a 0 instead of the zero position of a list.

Caesium said:
Another question: Would you add an ini-switch for the informations?
In my opinion it would be better, if you don't know, what religion the settler's got.

It was an accedent that the message was still on. I agree it is best to not know the settler's religion until the city is built, so I turned it off. I'll add ini options to turn some of the messages back on to the future feature list.

Caesium said:
Traceback (most recent call last):

File "CvEventInterface", line 23, in onEvent

File "CvCustomEventManager", line 185, in handleEvent

File "CvCustomEventManager", line 196, in _handleDefaultEvent

File "CvJUnitReligionEventManager", line 48, in onBeginPlayerTurn

File "CvJUnitReligionGameUtils", line 491, in onBeginPlayerTurn

AttributeError: 'NoneType' object has no attribute 'isNone'
ERR: Python function onEvent failed, module CvEventInterface

This is basicly the same error we've gotten in each of the last version. It is a invalid pPlot being sent, but I get the plot from a list of the players cities and as each city has to be on a plot I don't understand how it could be NoneType. What is the happening when you get this exception, is it early in the game or late, about how many cities do you have, ect. Once I get some idea of how this is happening I might be able to recreate the exception and then fix it, cause as it stands I have never gotten this error myself. But until then I'll see what I can do about working around it. :)

Thanx again for the help, I'll have a new version with the mentioned fixes in a few hours, just have to finish some other things up.
 
djKianoosh said:
just curious, but if you have this mod, are we missing the point of having missionaries and those other types of religious units? doesn't this defeat the purpose of those other units? just wondering. not meaning to diss your work, i'm sure it's good stuff.


Not completely defeat the purpose of missionairys, but definetly makes them not as crucial. I made it cause religion spread always seem static and to controlable to me. I wanted to tie the spread of religion to the movement of people, more like it is in real life. Obviously this is not a modcomp for everyone, but I enjoy coding it and atleast Caesium and a few others think it adds to their enjoyment of the game. In the end, thats all that is needed. :)
 
Jeckel said:
Fixed, I just had a 0 instead of the zero position of a list.
I thought of something like that. :)
It was an accedent that the message was still on. I agree it is best to not know the settler's religion until the city is built, so I turned it off. I'll add ini options to turn some of the messages back on to the future feature list.
Sounds good.
This is basicly the same error we've gotten in each of the last version. It is a invalid pPlot being sent, but I get the plot from a list of the players cities and as each city has to be on a plot I don't understand how it could be NoneType. What is the happening when you get this exception, is it early in the game or late, about how many cities do you have, ect. Once I get some idea of how this is happening I might be able to recreate the exception and then fix it, cause as it stands I have never gotten this error myself. But until then I'll see what I can do about working around it. :)
I added your Mod to my Mod Compilation, it works pretty good, despite of this little error.
Thanx again for the help, I'll have a new version with the mentioned fixes in a few hours, just have to finish some other things up.
No problem. Time's on your side. I think, I'll get to bed now.
 
Bug Fixed Version Released

There I think that should have solved just about everything. I am working on v0.5 right now, it will have a some cool new features, if no more problems pop up with this beta version I will probly realse v0.5 by the end of next week. :)
 
Hi,

it's me again.

I've got a new error:

Traceback (most recent call last):

File "CvEventInterface", line 23, in onEvent

File "CvCustomEventManager", line 187, in handleEvent

File "CvCustomEventManager", line 198, in _handleDefaultEvent

File "CvJUnitReligionEventManager", line 46, in onBeginPlayerTurn

File "CvJUnitReligionGameUtils", line 618, in onBeginPlayerTurn

File "CvJUnitReligionGameUtils", line 546, in runSpreadUnitsReligion

AttributeError: 'NoneType' object has no attribute 'getNumUnits'
ERR: Python function onEvent failed, module CvEventInterface
 
Cool, thanx, I am working on this issue *fistshakes at NoneType*. Is this exception from just my mod or is this from your mod composite? If you can get this exception with just my mod and post up a the savegame file that would really help me out. :)

But this last exception aside, everything else seems to be good to you?
 
This exception only occurs with your mod. Any other implemented modcomp works very well.

As attachment a savegame with exception.
 
WooHoo, the NoneType problem is solved. Thanx to some advise from TheLopez I fixed the issue and have uploaded the final 0.4x version. Thanx also to Caesium for all the testing and error reporting.

If any one happens upon any new exceptions please report them, but I think it is pretty stable now. :)
 
1 quick question. I'm fairly new to modding Civ and I am curious about combining this with other mods. Since this appears to be a python only mod, it should not conflict with an XML only mod, should it? Do I just copy the python folder and the .ini files to the other mod to combine them?

Sorry for the stupid question.
 
@Jeckel:

I tested the new code and let the AI autoplay for altogether 350 turns, and there was no error message. So, I think, now the error is corrected.
 
@Caesium

Sweet, glad to hear it. Now that we've got a stable version I can get back to working on the new features for v0.5. :)


@n003lb

Yep that is about all you have to do. The only other thing, in the <your mod>/Assets/Python directory there is a file called CvModName.py, open that file in a text editor and you will find this line

Code:
modName = "JUnitReligion"

Change the JUnitReligion part to the name of your mod and that should be all ya need to do. :)
 
If there is a percentage of the population that has a religion, could you make it so missionaries increases the percentage of that one religion (or would there be no point?). Also, along the same lines, would it be possible to attempt to destroy a religion in your city (can't think of any practical application of this, except for maybe to introduce some kind of Inquisitor unit)?
 
Top Bottom