Help Wanted Ads

You should not be assigning a random event's Python function to a game event of any sort. Random events run their own checks independent of game events. The two things have nothing to do with each other, directly.

The Python functions that are called by the DLL for event triggers, and events, go in CvRandomEventInterface.py. That is where the random event stuff in the DLL looks for the function names that are given in the XML, so that is where they need to be.

As an aside...
You can manually activate a "random" event trigger (in which case it is not really random) in a game event handler. The Partisans event that happens when a city is razed is done this way. See the BtS CvEventManager.py file's onCityRazed function. That fires off the trigger, which then applies all of its criteria (like the TechPrereq) and, if it passes, does what it does.

But you should not need to do that, since the example in the tutorial doesn't and what you are doing is pretty much exactly the same sort of thing it is doing.
 
You should not be assigning a random event's Python function to a game event of any sort. Random events run their own checks independent of game events. The two things have nothing to do with each other, directly.

The Python functions that are called by the DLL for event triggers, and events, go in CvRandomEventInterface.py. That is where the random event stuff in the DLL looks for the function names that are given in the XML, so that is where they need to be.

As an aside...
You can manually activate a "random" event trigger (in which case it is not really random) in a game event handler. The Partisans event that happens when a city is razed is done this way. See the BtS CvEventManager.py file's onCityRazed function. That fires off the trigger, which then applies all of its criteria (like the TechPrereq) and, if it passes, does what it does.

But you should not need to do that, since the example in the tutorial doesn't and what you are doing is pretty much exactly the same sort of thing it is doing.

I'll try the RandomEventInterface file and see if that does the trick. It seems to me that the XML should be able to set up a loop of triggers and events, but that doesn't seem to work. The files I attached to my 2/27 post is my pure-XML attempt. Did I miss something there?
 
One thing I am confused though is this.
You are using python to trigger an event to add the relationship bonus.
Then you are getting alot of errors to get the event to repeat.

The thing is if you are going to use python to trigger an event to achieve it, you might as well just use python to give the bonus directly?

Every X turns:
Roll a Random Number 0 or 1
If 0 (means 50%) then choose a random player
Add the relationship bonus

Isn't it simpler than triggering an event just to do the same job and then trying to make the event repeatable?
 
One thing I am confused though is this.
You are using python to trigger an event to add the relationship bonus.
Then you are getting alot of errors to get the event to repeat.

The thing is if you are going to use python to trigger an event to achieve it, you might as well just use python to give the bonus directly?

Every X turns:
Roll a Random Number 0 or 1
If 0 (means 50%) then choose a random player
Add the relationship bonus

Isn't it simpler than triggering an event just to do the same job and then trying to make the event repeatable?

Doesn't work across modifier recalcs again. Events get replayed (for their tag-generated effects), but the python doesn't get re-invoked because the DLL has no way to separate one-time stuff from persistent stuff, so if it called the Python as if the event were new each time, it would repeat the one-time stuff (including messaging etc.)

Thus if the processing is mediated by tag-defined event outcomes as Vokarya is seeking to do, it works fine across recalcs. However, if it relies on direct modifier setting by Python it does not.
 
I see, but since he already done a field of gold wonder using python effects, I was assuming it works for you guys.
But since you said the effects this way is going to be wiped, I don't see how field of gold can work without getting wiped either
 
I see, but since he already done a field of gold wonder using python effects, I was assuming it works for you guys.
But since you said the effects this way is going to be wiped, I don't see how field of gold can work without getting wiped either

It may not work, but no one has mentioned it yet. This is one of the reasons we have a freeze period. So all the modders can check each others work out rather than just their own.
 
I'm brainstorming ideas for new wonders, and I had a thought while looking over the list of Python functions in CvEventManager. Is there a function that can affect a unit's combat strength under specific circumstances? An example would be a unit defending alone, or a unit attacking another unit controlled by the controller of your state religion's Holy City. I see there is a function for after combat, but not beginning combat.
 
I'm brainstorming ideas for new wonders, and I had a thought while looking over the list of Python functions in CvEventManager. Is there a function that can affect a unit's combat strength under specific circumstances? An example would be a unit defending alone, or a unit attacking another unit controlled by the controller of your state religion's Holy City. I see there is a function for after combat, but not beginning combat.

I WISH "we" could ue the regular CvEventManager.py, would be ten times easier, but for some reason, it wont work with this BUG installed, i wish some "PYTHON" experts could figure out this problem, if so, i could add more than 20 new things to C2C and it would be 30 times better if so.
 
I WISH "we" could ue the regular CvEventManager.py, would be ten times easier, but for some reason, it wont work with this BUG installed, i wish some "PYTHON" experts could figure out this problem, if so, i could add more than 20 new things to C2C and it would be 30 times better if so.
There is no problem to figure out. The reason that the BUG event manager exists is that it allows modular Python additions in the first place.
It is easy enough to convert stuff to use it.
 
There is no problem to figure out. The reason that the BUG event manager exists is that it allows modular Python additions in the first place.
It is easy enough to convert stuff to use it.

For python knowledge people,sure, but i am not a python person, and i used to be able to just cut/paste all the CvEventManager stuff , but now i cant, ie: Tsunami/Disease Diplomacy Units etc, if so "we" could be have a great time with this stuff that Thomas had made.
 
For python knowledge people,sure, but i am not a python person, and i used to be able to just cut/paste all the CvEventManager stuff , but now i cant, ie: Tsunami/Disease Diplomacy Units etc, if so "we" could be have a great time with this stuff that Thomas had made.
The conversion is quite a mechanic process that has little to do with Python and more with BUG mod XML.
In most cases it just means copying the code into a new Python file and then telling BUG that there is an event handler in there.
 
The conversion is quite a mechanic process that has little to do with Python and more with BUG mod XML.
In most cases it just means copying the code into a new Python file and then telling BUG that there is an event handler in there.

I have already told StrategyOnly the three or four steps that he needs to do to convert any python into modular python but he reckons he is an "old dog who can't learn new tricks":mischief:. I have converted much that has been asked for but some things are either duplicates of what we already have or I "hates".
 
I have already told StrategyOnly the three or four steps that he needs to do to convert any python into modular python but he reckons he is an "old dog who can't learn new tricks":mischief:. I have converted much that has been asked for but some things are either duplicates of what we already have or I "hates".

ahahaha :splat: Yeah your right, i am an old dog :scared: :p At least this made me laugh, thx.;)
 
I have been lurking on your forum as well as playing C2C for over a year and a half now and was wondering if I could help with adding Civilopedia for all of the awesome new things that C2C adds. Thanks and I hope that you are interested.
 
I have been lurking on your forum as well as playing C2C for over a year and a half now and was wondering if I could help with adding Civilopedia for all of the awesome new things that C2C adds. Thanks and I hope that you are interested.

Well as you can see in the quote below from the Player How To Document post #6. If you see something that needs fixing then fix it and post the result.:) This is especially true of pedia entries and translations.

The way things mostly work in C2C is that you find a bit of it you want to improve and go for it. ;)

Management

The way we manage stuff is that for the first few changes you have a "mentor" that tests your stuff and puts it on our SVN. After that we suggest you get connected to the SVN to add your stuff yourself. The SVN is the beta where we all check each others stuff out, although a number of people now use it as if it is the final. Once a month or two StrategyOnly will put out a new version.

Most conversation about changes occurs on the forums although we may ask each other via PM sometimes.
 
I have been lurking on your forum as well as playing C2C for over a year and a half now and was wondering if I could help with adding Civilopedia for all of the awesome new things that C2C adds. Thanks and I hope that you are interested.

You should get ahold of dsma_bell, who is from Germany, he has been providing some translations into German already, and thx for offering, and Welcome to CFC, and trying C2C
 
I have a question about the Diplomatic Wonders. Where in the code is it determined who is a member of the Apostolic Palace/United Nations? I would like to introduce a Congress of Vienna wonder that would basically act as a religion-neutral Apostolic Palace without Diplomatic Victory. It would be able to declare war, force peace, declare a trade embargo, reassign a city, sign Open Borders, and sign a Defensive Pact. I see how to do the voting code, but I can't figure out where in the code membership is assigned. Ideally, the members of the Congress would be anyone not at war with the OWNER of the Congress. Could someone point me to where that code is?
 
I'm not sure entirely but I can say for sure that what its looking for is what cities have the Apostolic Palace's declared religion. Any nation that has even one city with that religion in it will be a member and the strength of their votes is dependent on the total population among a player's cities that are exposed to that religion.

Surely it would be a calculation inside the dll I would think. Perhaps the city files.
 
I'm not sure entirely but I can say for sure that what its looking for is what cities have the Apostolic Palace's declared religion. Any nation that has even one city with that religion in it will be a member and the strength of their votes is dependent on the total population among a player's cities that are exposed to that religion.

Surely it would be a calculation inside the dll I would think. Perhaps the city files.

I know how the membership gets expressed in the game, but I'm looking for where exactly in the code does it say "you must have the AP religion to be an AP member" or "you must exist and have cities to be a UN member". I discovered if you have "Require Complete Kills", AI civilizations without cities are not UN members.
 
I know how the membership gets expressed in the game, but I'm looking for where exactly in the code does it say "you must have the AP religion to be an AP member" or "you must exist and have cities to be a UN member". I discovered if you have "Require Complete Kills", AI civilizations without cities are not UN members.
Check CIV4VoteInfo.xml and CIV4VoteSourceInfos.xml.
 
Top Bottom