Need Help Making an Event

Jarlaxe Baenre

Emperor
Joined
Feb 17, 2010
Messages
1,959
Location
Calgary, Alberta, Canada
I am making an event that, if you select option B, gives your cities on another continent to a defeated civ (civilization_revolutionaries) and you then control that civ, losing your cities on other continents.

Option C does the same thing, except that you do not take control of the civ.

How do you do this in python? I have no python knowledge at all.
 
So, how would I go about doing that? I know I need to spawn a colony with python, then force war with a follow-up event or more python, and then transfer control like how RFC does... but how?
 
As long as there is some understanding....so you'll not run away completly scared when i throw some words here into the room, like for loop, if then else, variable, function?

If yes: Fine :).
If no: Er...you might want to first think about a smaller task. What you want to do is not really small.


So, the first thing to begin:
- Create an event, the XMLs
- Add a PythonCanDo function in the eventTriggerInfos
- Add a new function in Python\CvRandomEventInterface.py. Just copy another CanDo function, rename it, delete nearly everything what is not needed. If you're not sure, paste in here what you're going to do.
- Add a PythonCallback in the EventInfos
- Again new function CvRandomEventInterface.py, etc., same as above



You should bookmark this page, you'll need all the python commands.
You should also enable the python exceptions in the .ini, if you haven't done this already.

If this is done, we'll go further.
 
I'm already done the XML of the event, but as I said in my first post, I have no python experience. I wasn't sure how to format the callback/cando so I just left them blank.

But I have no clue how to give the cities on the targeted to the civ that I want to control them.
The next part just involves me adding some game options (8 civs revolution event enabled, 9 civs revolution event enabled, etc.) to give control of the cities to player 8, 9, etc.
 

Attachments

Oh, i see you work with a Mac...so the changed stuff which you've added from RFC will probably not work. Are there really .dlls included in the Mac version?

I'm already done the XML of the event, but as I said in my first post, I have no python experience. I wasn't sure how to format the callback/cando so I just left them blank.

That you don't have any experience doesn't matter.
Search a working callback, like:
PHP:
<PythonCanDo>canApplyBlessedSea2</PythonCanDo>

add something like this to your XML, like
PHP:
<PythonCanDo>canDoThisRevolution</PythonCanDo>

search an entry in the .py, copy it, rename it.
Just do it.

But I have no clue how to give the cities on the targeted to the civ that I want to control them.

Don't hurry.
I guess it will take some time before we can think about it.

The next part just involves me adding some game options (8 civs revolution event enabled, 9 civs revolution event enabled, etc.) to give control of the cities to player 8, 9, etc.

:confused: er...what?
I guess this can be done without specifying an event for every civ.




btw, is it necessary that a specific civ gets the new cities, or could it also be a random one?
 
It needs to be the specific civ. That's why I need the gameoptions - I can manually add in the civ because only I will be using this mod. The civ I made for it has a powerful UU and UB to make up for the late start.
 
That's why I need the gameoptions - I can manually add in the civ because only I will be using this mod.

Game options...do you mean like "no barbarians" or "choose religion"? Then i have to disappoint you, new game options can only be done via SDK.

The civ I made for it has a powerful UU and UB to make up for the late start.

...zombie invasion maybe :D?


Edit: I'll now go offline, good night. We'll talk more tomorrow.
 
B can't be done with the standard dll, civ changing for the human player is not supported via python.
I'm not saying that you're wrong, but I just happened to find this in the API:
CyGame.setActivePlayer()
Also, I was chocked to find this :eek::
CyGame.addPlayer(eNewPlayer, eLeader, eCiv)
Does this mean what I think it means? - that you can insert a new Civ in mid-game?
 
I'm not saying that you're wrong, but I just happened to find this in the API:

Also, I was chocked to find this :eek::

Does this mean what I think it means? - that you can insert a new Civ in mid-game?

Yes, this is meant.
I guess these are some commands from Pitboss.
And theoretically you're right, but not in practice.
You can change the human player.
The only problem is, that the civ which has formerly been controlled by the human will not finish its turn, and civ is stuck at that moment.I have no idea how to force the new player AI (if there is one) to finish its turn.
With AIAutoplay (not the build in one, the advanced from BetterAI), you could just make the AI do one complete turn, then it would work, i guess, but no way imho with the normal dll.
 
Back
Top Bottom