Resource icon

WarNPeace script 2016-10-05

This mod component is a simple python mod component which allows players to script war and peace declarations into their game, depending on maps, turns or dates.

The download contains:
  • CvEventManager.py. The file has 4 modifications. At 2 places you have to change the path to the XML with the actual script data.
    PHP:
    WarNPeace.loadEvents("Mods/WarNPeaceScript/Assets/XML/CustomXML/WarNPeace.xml")
    WarNPeaceScript is here the name of the mod. If you merge this into your mod, you'll have to change it.
  • WarNPeace.py. You don't have to change anything here, just drop it in the same folder like CvEventManager.py
  • CustomXML\WarNPeace.xml. The data file for the events. It currently contains 3 example events:
    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>WAR</Type>
    			<Map>WesternEurope38X48-by-iuvavus</Map>
    			<Date>0</Date>
    			<Turn>2</Turn>
    			<Message>TXT_KEY_WAR_WITH_FRANCE</Message>
    		</Event>
    		<Event>
    			<Attacker>CIVILIZATION_ENGLAND</Attacker>
    			<Defender>CIVILIZATION_FRANCE</Defender>			
    			<Type>PEACE</Type>
    			<Map>WesternEurope38X48-by-iuvavus</Map>
    			<Date>0</Date>
    			<Turn>5</Turn>
    			<Message>TXT_KEY_PEACE_WITH_FRANCE</Message>
    		</Event>		
    </SkriptInfo>
    • Attacker and Defender have to be civs. Event will be ignored if either civ is not present at the start of the game.
    • Type: Either WAR or PEACE. The status will be locked afterwards (means if you put WAR in there, the both civs will not be able to make peace again, if PEACE they'll not be able to declare war again. Other events will override this)
    • Map: Put -1 into Map to apply events for the regular game. Else put there the map name without file extension.
    • Date: For date, put 0 if it should be ignored (turn will be taken instead), else your date (-3920 refers to 3920 B.C., 1990 would refer to 1990 AD, etc).
    • For turn, just put the turn you want it to happen. Will be ignored if set to -1.
    • Message: The text string there will appear as popup for both defender and attacker. The popup will not appear if the event is redundant (means if you script a war, and both civs are already at war, you'll not get a popup)
  • 1 text XML for the mentioned message
  • One map by Iuvavus to demonstrate the map dependency.


This mod component was requested by dacubz145.

If you have any questions or comments please post in this thread.
  • clipboard01_uO5.jpg
    clipboard01_uO5.jpg
    155.7 KB · Views: 101
Author
The_J
Downloads
360
Views
555
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from The_J

Top Bottom