Modder's Documentation

Can someone remind me how to enable the console?? It just fell out of m head.

Also can some please please tell me what needs to be done left/right longitude variable to worldbuilder saves? and along that same thought if an animal has no latitude defined in the spawn info than do they just spawn anywhere?
 
Can someone remind me how to enable the console?? It just fell out of m head.

Also can some please please tell me what needs to be done left/right longitude variable to worldbuilder saves? and along that same thought if an animal has no latitude defined in the spawn info than do they just spawn anywhere?
The max left/right longitude is currently a #define in the DLL so it would need to be changed to a variable and the calculations adapted where needed. Then it would need to be exposed to Python and finally added to the Python code that reads the WB saves.
 
The max left/right longitude is currently a #define in the DLL so it would need to be changed to a variable and the calculations adapted where needed. Then it would need to be exposed to Python and finally added to the Python code that reads the WB saves.

Thanks for answering man. That will take me a while to figure out haha.
 
This is a work in progress I will be adding to it as I do the work. It may be all over the place as far as content is concerned as I get things straight. ;)

In normal and BUG versions of Civ IV you need to do some python work in the main interface code to add missions to a unit. This is not the case in C2C where we can define missions and outcomes from the missions sometimes with very little python at all. This document describes how to achieve this in as much detail as I can give.

Missions are the actions that a unit can perform. An example is the spy mission "Bribe City". That particular example is coded in the dll.

Outcomes are a list of things that can happen when the mission is done. The outcomes may require Python to validate that particular outcome or to do the actual action.

There are a couple of missions I a considering using as examples
  • Great General action Rally which creates 24 Warriors. Note: number depends on World Size, Type depends on Conscript available (original by Platyping)
  • Thief or Rogue stealing money from another nation

What do you need before you start
Art work for the mission.

What the mission does when successful, partly successful and fails. The probabilities and costs for these.

Where it can happen. What preconditions are there and what modifies the chances of success.​

There are three parts to defining a mission, two are done in XML (mission and outcomes) and there may be a need for some Python as well. AI for the missions may be needed but is out of scope for this document. AI may also be done in Python.

Missions are defined in XML but are not WoC compatible so they must be defined in the core area. Not only that any you add must be at the end of the file because some are defined to the dll by the order they appear.

Outcomes on the other hand can be modular so can be defined in the XML of optional modules. This is the way to control when the mission is in game or not.

Python code is defined in the Event code so is also not modular. (Check this SO has suggested that it may be possible to have it modular.)

Setting up
Create the module folder in this case Assets/Modules/Platyping/Advanced_GP. I am putting this inside the Platyping folder because it is his ideas we are using. If we do a lot more than he did or change it all significantly we may move the mod up to the Modules file but keep a dedication somewhere indicating where the original idea came from. We all do this for free so credit is the only reward we can give.

While building and testing I keep the art in the module folder but have it in the same structures as it will be when transferred into the core area for inclusion in the FPK files. So now create the folders under this Art/Interface/Buttons/Missions and put Rally.dds in this folder.​

Define the mission
Copy the file C2C_CIV4UnitSchema.XML into the Advanced_GP folder and rename it to Advanced_GP_CIV4UnitSchema.XML.

I then usually copy the file I want to work on next from some other module so I can use it as a template. Copy the file CIV4MissionInfos.XML into the Advanced_GP folder and rename it Advanced_GP_CIV4MissionInfos.XML. Edit this file and rename the schema file at the top and delete all missions except the last which we are going to use as a template.

The Advanced_GP_CIV4MissionInfos.XML should look like
Spoiler :
Code:
<?xml version="1.0"?>
	<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Jon Shafer (Firaxis Games) -->
	<!-- Sid Meier's Civilization 4 -->
	<!-- Copyright Firaxis Games 2005 -->
	<!-- -->
	<!-- Mission Infos -->
<Civ4MissionInfos xmlns="x-schema:Advanced_GP_CIV4UnitSchema.xml">
	<MissionInfos>
		<MissionInfo>
			<Type>MISSION_RECORD_TALE_ORAL</Type>
			<Description>TXT_KEY_MISSION_RECORD_TALE</Description>
			<Help>TXT_KEY_MISSION_RECORD_TALE_HELP</Help>
			<Waypoint>NONE</Waypoint>
			<EntityEventType>ENTITY_EVENT_GREAT_EVENT</EntityEventType>
			<iTime>0</iTime>
			<bTarget>0</bTarget>
			<bBuild>0</bBuild>
			<bSound>0</bSound>
			<bVisible>1</bVisible>
			<Button>Art/Interface/Buttons/Missions/RecordOral.dds</Button>
		</MissionInfo>
	</MissionInfos>
</Civ4MissionInfos>

Change the names in the missions file to the one we are using GG_RALLY and put the correct button name in. I expect we will also have a HERO_RALLY mission at some stage which will use the same button but have different outcomes.

It should now look like
Spoiler :
Code:
<?xml version="1.0"?>
	<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Jon Shafer (Firaxis Games) -->
	<!-- Sid Meier's Civilization 4 -->
	<!-- Copyright Firaxis Games 2005 -->
	<!-- -->
	<!-- Mission Infos -->
<Civ4MissionInfos xmlns="x-schema:Advanced_GP_CIV4UnitSchema.xml">
	<MissionInfos>
		<MissionInfo>
			<Type>MISSION_GG_RALLY</Type>
			<Description>TXT_KEY_MISSION_GG_RALLY</Description>
			<Help>TXT_KEY_MISSION_GG_RALLY_HELP</Help>
			<Waypoint>NONE</Waypoint>
			<EntityEventType>ENTITY_EVENT_GREAT_EVENT</EntityEventType>
			<iTime>0</iTime>
			<bTarget>0</bTarget>
			<bBuild>0</bBuild>
			<bSound>0</bSound>
			<bVisible>1</bVisible>
			<Button>Art/Interface/Buttons/Missions/Rally.dds</Button>
		</MissionInfo>
	</MissionInfos>
</Civ4MissionInfos>

Define the text for the mission
Again I prefer to copy an existing text file and work with it as a template. Given that I don't know other languages and C2C now handles the text files so that many more languages work all I need do is define the text in English.

The name of the XML file holding the text will be Adbvanced_GP_CIV4GameText.XML. NB: It is very important that the text files end with the suffix _CIV4GameText, if they don't they will be ignored.
Spoiler :
Code:
<?xml version="1.0" encoding="UTF8"?>
<Civ4GameText xmlns="http://www.firaxis.com">
	<TEXT>
   		<Tag>TXT_KEY_MISSION_GG_RALLY</Tag>
   		<English>Rally Troops</English>
	</TEXT>
	<TEXT>
   		<Tag>TXT_KEY_MISSION_GG_RALLY_HELP</Tag>
   		<English>[COLOR_HIGHLIGHT_TEXT]Rally[COLOR_REVERT][NEWLINE]Creates some combat units.[NEWLINE]It consumes the Great Person.</English>
	</TEXT>
</Civ4GameText>

Defining what you want to happen and who does it when.

We now move onto outcomes.

- how on earth do I give the correct number of units and their type? Do I do that in the outcome?

So far there is nothing to see in game. We now need to add these missions to units using Outcomes.
 
Thank you for this. I will have some more questions for you on this subject soon I'm sure.

Can you provide a link to this post in the first post here so that it can be easily found once buried among the pages?
 
Missions are defined in XML but are not WoC compatible so they must be defined in the core area. Not only that any you add must be at the end of the file because some are defined to the dll by the order they appear.
Missions defined for outcome missions are WoC compatible and may be in modules (the same is not true for missions that are used by the DLL as the DLL relies on the order of the missions and there is no guarantee for that beyond that missions defined in modules will end up after those defined in the core).
 
Thank you for this. I will have some more questions for you on this subject soon I'm sure.

Can you provide a link to this post in the first post here so that it can be easily found once buried among the pages?

I will when it is better defined. I am going to need to take a short break due to RL and I have been given a book I could not put down, it has 3 more in the series.

Missions defined for outcome missions are WoC compatible and may be in modules (the same is not true for missions that are used by the DLL as the DLL relies on the order of the missions and there is no guarantee for that beyond that missions defined in modules will end up after those defined in the core).

Which is why I said they weren't WoC compatible since they can break stuff if you do it that way.
 
Which is why I said they weren't WoC compatible since they can break stuff if you do it that way.
Except when you are making outcome missions which is what you were talking about I thought. Those can easily be put in modules and it will work.
To give an example the new missions you added like MISSION_FREE_CAPTIVE or MISSION_JOIN_CITY_AS_SETTLED_SLAVE could be put into a Captives_CIV4MissionInfos.xml in your Captives folder and if it does cause problems (which I don't think), then that is a bug I should investigate.
 
@AIAndy I have extended the document a little actually starting to define a mission. I am going with your suggestion of having the missions defined in the module. I am using the Platyping mission Rally for Great Generals as the example. This has immediately raised two questions

1) am I using the correct encoding for the game text files?

2) the help text for the Rally mission is game situational.
Should it be situational on the outcomes rather than the mission?

how on earth do I code it:)? The number is based on the size of the map and the units on what the conscripts are at the time the button is shown.​
 
@AIAndy I have extended the document a little actually starting to define a mission.
Not sure what document you are referring to.
I am going with your suggestion of having the missions defined in the module. I am using the Platyping mission Rally for Great Generals as the example. This has immediately raised two questions

1) am I using the correct encoding for the game text files?
Not sure what to look at.
In general, I recommend using UTF8 (but the Latin-1 encoding will work properly again when I have replaced the XML parser).

2) the help text for the Rally mission is game situational.
Should it be situational on the outcomes rather than the mission?

how on earth do I code it:)? The number is based on the size of the map and the units on what the conscripts are at the time the button is shown.​
The mission help is only a text (not variable based on situation) but for outcome missions the outcome help is added afterwards.
Are your mission effects in Python?
 
Not sure what document you are referring to.

the one in this thread ie here

Not sure what to look at.
In general, I recommend using UTF8 (but the Latin-1 encoding will work properly again when I have replaced the XML parser).
Thanks.
The mission help is only a text (not variable based on situation)
That is what I thought, and makes me wonder at the use of that text (mission help) in some situations.

but for outcome missions the outcome help is added afterwards.
Are your mission effects in Python?
Some will be some wont. I think I can do the example one fully in the outcome code, or maybe not since I want to create a number of units not just one. The number and type being dependent on the game.
 
@AIAndy, I think I can do all of the Rally mission in outcomes if I can get at the World Size in some way. Is it available to use as either a test on which outcome to use or as a multiplier on the number of units to create?

I also need to figure out what the conscript unit is and when it changes.

I am currently thinking that I will need one actual outcome for each world size by each conscript type. Only one of which will be available at any time.
 
@AIAndy, I think I can do all of the Rally mission in outcomes if I can get at the World Size in some way. Is it available to use as either a test on which outcome to use or as a multiplier on the number of units to create?

I also need to figure out what the conscript unit is and when it changes.

I am currently thinking that I will need one actual outcome for each world size by each conscript type. Only one of which will be available at any time.
I guess the best way is to add a number of spawned units to the outcome XML as integer expression. That way you can use the Adapt tag to scale the number depending on world size.
Then you only need one outcome for each conscript type.
 
I also need to figure out what the conscript unit is and when it changes.
I think this is done in the EraInfos.xml but I'm not 100% on that.
 
I think this is done in the EraInfos.xml but I'm not 100% on that.

UnitInfos.xml
<iConscription>

When you have the ability to build the higher one, it chooses the better one.
As such, it is city dependent as not all cities are connected to a particular bonus.
 
New Building Costs:

This is a reference for starting points for building and unit costs in the XML. These numbers will ofc be adjusted by gamespeed and other modifiers.

Column Cost
30 80
31 90
32 100
33 105
34 110
35 120
36 130
37 130
38 140
39 150
40 160
41 180
42 190
43 200
44 220
45 230
46 250
47 260
48 280
49 300
50 320
51 350
52 370
53 400
54 420
55 450
56 490
57 520
58 560
59 600
60 640
61 680
62 730
63 780
64 840
65 890
66 960
67 1020
68 1100
69 1150
70 1250
71 1350
72 1450
73 1550
74 1650
75 1750
76 1900
77 2000
78 2150
79 2300
80 2450
81 2650
82 2800
83 3000
84 3250
85 3450
86 3700
87 3950
88 4250
89 4550
90 4850
91 5200
92 5550
93 5950
94 6350
95 6800
96 7300
97 7800
98 8350
99 8900
100 9550
101 9900
102 11000
103 12100
104 12100
105 13200
106 14300
107 15400
108 16500
109 17600
110 18700
111 19800
112 22000
113 23100
114 24200
115 26400
116 28600
117 29700
118 31900
119 34100
120 37400
121 39600
122 41800

This is for normal buildings and units.

NOTE: Do not use these numbers blindly for the Galactic Era or Multi-Maps. That will require more tweaking which I'll get to when we cross that bridge.

  • National Wonders cost 4 times what a normal building would cost for that tech
  • World Wonders cost 8 times what a normal building would cost for that tech
  • Projects cost 12 times what a normal building would cost for that tech

Bumping for Hydro.

Also, take note of my disclaimer at the bottom, I am not familiar with how MrAzure's new TH stuff has affected balance in that era but there may be changes needed.
 
Bumping for Hydro.

Also, take note of my disclaimer at the bottom, I am not familiar with how MrAzure's new TH stuff has affected balance in that era but there may be changes needed.

How old is this, because i need someone to re-do the gamespeeds again, i am currently playing with Marathon, and the times do NOT EVEN get close till after mod-way through Modern Era. (No Offense)
 
How old is this, because i need someone to re-do the gamespeeds again, i am currently playing with Marathon, and the times do NOT EVEN get close till after mod-way through Modern Era. (No Offense)

IIRC it worked fine until the Medieval era or so. I was reluctant to fix that because it would involve increasing the number of turns in the Classical, Medieval, and Renaissance eras by 50% each to get right through Industrial. If you want I can look at things and take another whack at it, but it WILL make the earlier eras longer which may not be a desirable outcome.
 
Top Bottom