Simple Python Things

Love it! Except the fact that Alexander pops up and then u choose to change te civ/leader can u change this so that u pick the civ right at independence? That way it won't take up 2 civ slots

I think the colony thing can be done before the normal colony appears, by deactivating the normal liberation function and writing a custom one. Should not be too hard.

Just to say: Works :hammer:.
The popup which asks which cities should be liberated is sadly in the .exe, but I can hook in the code before and create such a screen myself. That does already work :).

-> does anyone by any chance know with what exactly new colonies start? I know, all techs from the master, and some sort of defense unit (AFAIK 2 per city, best conscriptable unit), but else...? Money, preset civics, preset state religion? I think the latter 2 the new civ is doing itself, but other stuff? What happens with culture buildings in the cities? Are they destroyed or do they stay? Does the vassal share any diplo attitudes with the master (I mean -2 you traded with our worst enemy), or is this independent?
 
Okay, the most things are done.
The mod currently loads a XML file which has this
Spoiler :
PHP:
<SkriptInfo>
		<Event>
			<Attacker>CIVILIZATION_GERMANY</Attacker>
			<Defender>CIVILIZATION_FRANCE</Defender>			
			<Type>WAR</Type>
			<Map>-1</Map>
			<Date>-3920</Date>
			<Turn>-1</Turn>
			<Message>TXT_KEY_GERMANY_DECLARED_WAR</Message>
		</Event>
		<Event>
			<Attacker>CIVILIZATION_ENGLAND</Attacker>
			<Defender>CIVILIZATION_FRANCE</Defender>			
			<Type>PEACE</Type>
			<Map>-1</Map>
			<Date>0</Date>
			<Turn>2</Turn>
			<Message>TXT_KEY_PEACE_WITH_FRANCE</Message>
		</Event>		
</SkriptInfo>

as content.
You can force war or peace between 2 civs at either a specific date (ignored if 0) or at a specific turn (ignored if -1), at specific maps (events with -1 will be applied to the normal game). Both participating civs will get a popup with the mentioned message and will be locked in the current status (means they'll stay in a war if its triggered by such an event).

Are any other things needed? Defense pacts (can't be locked), forming of a team, or other things?
Currently the code will also trigger in the case it's redundant (e.g. war declaration while already at war) and give you a popup. Not sure how to deal with that. The popup doesn't have to trigger in this case, so that just the status is locked, but I'm not sure if it's always the desired thing.

Sorry havent responded in a while, computer got a virus but back up and running now
2 quick questions

Where do I put this code? Im assuming in the scenario xml but where in it?

Also I want to do a custom speed for some scenarios so the techs go along with the speed and war declaring of the specific scenario, but i dont want it a playable speed, is there a way to make some speeds not pickable or have a default unchangable speed?
 
Sorry havent responded in a while, computer got a virus but back up and running now
2 quick questions

Where do I put this code? Im assuming in the scenario xml but where in it?

:hmm: not sure if you mean the XML or the Python part, but the former one stays in the file where it is ;) (it's a custom file which the game will load after starting), and for the Python, that's just the normal merging process in CvEventManager.py.

Also I want to do a custom speed for some scenarios so the techs go along with the speed and war declaring of the specific scenario, but i dont want it a playable speed, is there a way to make some speeds not pickable or have a default unchangable speed?

These selection screens (I mean if you go custom game and all the boxes there, etc) are all in the .exe, so no way to manipulate there anything with Python :/.
 
Just tested for you:

Colony:
Default Civics
No Religion
No Gold
All Culture in Cities
2 Units per City
All Buildings, including Religious ones, National Wonders, Culture ones.
UBs converted to normal ones and vice versa
Peace: 0 relationship with all players, except +10 with player for liberation, and +2 for defensive pact
War: +1 Military Struggle with all allies, -3 with War Enemy
 
Ive attempted the sevopedia entree for the special buildings, (page 36) and it didnt work to well, i did one tech that allowed two wonders (i just used it as a test) and around half of the buildings went into the cateogry, as well as my palaces sectoin (national wonders) does not appear, like the category apears but no palaces come up. Also if you click on a building it brings you back to the building/wonder/palace section instead of the special building being itself
 
Just tested for you:

Colony:
Default Civics
No Religion
No Gold
All Culture in Cities
2 Units per City
All Buildings, including Religious ones, National Wonders, Culture ones.
UBs converted to normal ones and vice versa
Peace: 0 relationship with all players, except +10 with player for liberation, and +2 for defensive pact
War: +1 Military Struggle with all allies, -3 with War Enemy

:hatsoff: thank you :).
If I had known that you'd test it, I'd have done it myself. Did not want to cause any work for others, just thought someone might know it. -> Again thanks :D.

But only these few things...ah, nice, that will be cheap :D.

Ive attempted the sevopedia entree for the special buildings, (page 36) and it didnt work to well, i did one tech that allowed two wonders (i just used it as a test) and around half of the buildings went into the cateogry, as well as my palaces sectoin (national wonders) does not appear, like the category apears but no palaces come up. Also if you click on a building it brings you back to the building/wonder/palace section instead of the special building being itself

Could you please attach the merged version?
 
:hatsoff: thank you :).
If I had known that you'd test it, I'd have done it myself. Did not want to cause any work for others, just thought someone might know it. -> Again thanks :D.

But only these few things...ah, nice, that will be cheap :D.



Could you please attach the merged version?

well i did it on my giant mod, so no.... haha ill test it on a blank mod with just that and i will post that
 
If I pack that folder into a testmod\assets folder, it loads without any problems and I get this image:
Spoiler :

attachment.php



-> :dunno:.

Are Python exceptions activated?
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    123.1 KB · Views: 196
If I pack that folder into a testmod\assets folder, it loads without any problems and I get this image:
Spoiler :

attachment.php



-> :dunno:.

Are Python exceptions activated?

hmm, all i did was copy the pages into python/screens and changed the techs,

lemme try again
 
Edit, nevermind, I remerged it to give it another go and worked like a charm many thanks:goodjob:
Spoiler :
:hmm: that can't really be. Because barracks don't have any tech prereqs and don't appear in my screenshot above.
-> Sure that everything is working?

Now looking at it, it only shows ones that require no techs, i have it under the tech steel (and made sure it was spelled correctly with the tech xml) but it doesnt show any buildings that require steel, just ones without any tech

Even check out the screenshots, you can tell (since my mod is modern) all the buildings are older (palaces, religoius buildings, libraries etc)

And of course since im never out of ideas, do you think this can be replicated? Im gonna try it:D
 
subbed! yes subbed I like to see new ideas and stuff coming through!
 
Edit, nevermind, I remerged it to give it another go and worked like a charm many thanks:goodjob:

Good to hear :).

Now looking at it, it only shows ones that require no techs, i have it under the tech steel (and made sure it was spelled correctly with the tech xml) but it doesnt show any buildings that require steel, just ones without any tech

Even check out the screenshots, you can tell (since my mod is modern) all the buildings are older (palaces, religoius buildings, libraries etc)
And of course since im never out of ideas, do you think this can be replicated? Im gonna try it:D

:hmm: I don't think I get you :dunno:.
Could you please try to rephrase that?

subbed! yes subbed I like to see new ideas and stuff coming through!

Then you should probably better subscribe to platyping's thread ;). He does way more stuff than I do at the moment (and also more creative; nearly none of "my ideas" here is my own).


--------------
@ that colony thing: Works now mostly. The popup looks the same like the default one, and creating colonies and liberating cities works.
Does not seem that naming is possible, can't see a command to do that :sad:.
Only other thing which doesn't work is the +10 attitude with the player who liberated the colony, that seems to be completely handled in the .exe, in contrast to all the other attitudes which the civs have, these can be manipulated via python. Went now with +10 for past events, should not make any real difference.

Haven't dealt yet with the civ + leader restriction. Probably best to exclude every leader/civ, which the player already knows, else it might reveal to much about the rest of the game.
 
:hatsoff: thank you :).
If I had known that you'd test it, I'd have done it myself. Did not want to cause any work for others, just thought someone might know it. -> Again thanks :D.

No problem :D Need to do some testings for codes for new wonder so just part of my test :D
Then you should probably better subscribe to platyping's thread ;). He does way more stuff than I do at the moment (and also more creative; nearly none of "my ideas" here is my own).

Out of ideas already, the rest of my WIP are basically simple ones waiting for a name, or logic errors waiting to be solved. Keeping one last idea for a Singapore Wonder though :D
 
Back
Top Bottom