Post by Army_Of_One on Oct 25, 2005 16:52:01 GMT -5
Thanks Big Huge Game For make to tutorial.
Step 1. Creating the Map
In an image editor, ie. Photoshop or Paint, create your map. One clever way to do this in photoshop is to find a map image that you’d like to use. Make that a transparent layer and then trace it into a new layer. There are a couple important rules about this process.
Each territory must have its own unique color.
The ocean must be white.
Each territory must have a 1 pixel x 1 pixel black dot to indicate where its capital should be.
Following these rules is the most difficult part of creating a new map. A single pixel that is even slightly the wrong color will make it unusable. For this reason, I recommend using the simplest of image editors like Paint. If you use a more robust editor like Photoshop, make sure to disable all anti-aliasing. Anti-aliasing will create different shades of your intended color and break the map.
The map should be wider than it is tall. For best results, create an image that is the same size as the map included with Rise of Nations. ([gamedirectory]/conquest/ctw_world_map_01.png)
It must use the .png format. It does not need an alpha channel. Use any filename that you’d like.
This image will be used for generating scenarios and for the mouseover highlighting in Conquer the World.
Step 2. Creating the rendering version
Make a copy of the map that you just created. This new image will be used to draw the map on the screen. It can be modified however you’d like to make an attractive version of the map. Name this file RENDER_[the first image name].png. These images must be the same size.
Step 3. Importing the map into CtW
Place the colored data map into the conquest directory. Place the rendering map into the conquest/render maps directory. Now start Rise of Nations and navigate to the CtW setup screen. You’ll notice that the top white box that normally says World Map is now a dropdown menu. Use that menu to select the filename of your new map. If it is not there, then your data map has been placed in the wrong directory.
Now begin a new campaign. While CtW loads up your new map, it will create an xml file that contains all of its settings. Quit out of Rise of Nations and open it up. It will be in the conquest directory and be named with the same name as your data map.
Within the file, each territory has an entry in the COUNTRY table. If there are more COUNTRY entries intended, then you have extra colors in your map image. Each country entry contains information about where in the image it is located with the left, right, top, and bottom attributes. Use these to locate the stray colors and remove them from the image. Then delete the xml file and repeat this step. An additional trick for checking your map beforehand in PhotoShop is to export your image as a .gif. After you do this, PhotoShop will tell you exactly how many colors are in your image. You should have 1 color per country plus black and white. (Thanks to MicroSlave for the tip)
There will also be a file called [yourfilename]_strings.xml. This file is for localization and does not need to be altered.
Step 4. Placing nations and identifying links
After all this work, it is finally time for the interesting portion of creating a CtW map. You will want to change the names of each country. Make the “id” field the same as the name. The countries are ordered by their positions in the image; left to right then top to bottom. Then you will want to change the owner fields to place the correct nations on the correct territories.
The LINK data contains information about where you can attack from each country. Links are automatically created for every country that physically touches another. You may add links for countries with water between them. The “to” field should contain the “id” of the country that can be attacked. Any sea link should have the “sea” flag set to 1.
Step 5. Placing Bonus Cards, Rare Resources, Tribute, special graphics
At this point, use ctw_world_map_01.xml in your conquest directory as a reference. Each territory can specify which bonuses that it contains. Each country can also have a continent identifier. You create the continents by listing them as done in ctw_world_map_01.xml. You can also specify unique art to display when continents are captured. The loading screen background can also be specified in the map xml file.
Debugging hints:
If you change the data .png file, you’re likely to change the order in which the countries are found when loading the file. If they’re found in a different order than they’re listed in the xml file, you might have problems. If you change the image, you should backup the xml file and then delete it and re-export it. Then copy back in your information in the correct order. If you change the rendering image or the data image, be sure to delete the conquest/temp directory to remove any cached versions. Otherwise, your changes might not appear or countries might appear in the wrong locations and break the generated scenarios.
NEW FOR THRONES AND PATRIOTS
Step 6. Creating scenarios for your campaign
The first step is to create a scenario in the scenario editor. If you wish, you can also create a script for it. You can even create a setup script that will run before the game is loaded for Conquer the World scenarios. Alternatively, you can just have a script and let Conquer the World generate your map when the scenario is run. Once this is done, using ctw_alexander_map_01.xml in your conquest directory as reference, create a scenario section (conqueststyles), and place your scenario in one of the four categories. Offensive scenarios pop up during attacks against other nations, defensive during defenses, barbarian when attacking barbarian territories, and custom come up by script.
To create a battle script, use alexander_battles.bhs in the conquest/alexander/ folder as your guide. Use the parameters of the script to find out important information like where you are attacking to or from, or who the opponent is. Next, use the battle variable to set what battle is going to be fought (the id of the scenario you created in your xml file), and battle_info to create advisor text to display when attacking into that scenario. For example, if you wanted the Battle of Bull Run to come up when attacking into Northern Virginia, the script would look something like this:
if (to == “Northern Virginia”) {
battle = “The Battle of Bull Run”;
battle_info = “This battle will become a tourist attraction in the near future.”;
}
To A**ociate your script with your xml file, using ctw_alexander_map_01.xml as a guide, create a battle_script_file attribute in the root, and give it the value of the name and location of your script (for example, .\conquest\CivilWar\civilwar_battles.bhs).
Step 7. Creating custom tribes
If you need a nation that is not in Thrones and Patriots to appear in your campaign, you can rename a nation that is in the game, and change its art set if necessary. Using ctw_alexander_map_01.xml as reference, create a tribes section in your xml file. You will notice in the Alexander xml file that each tribe named in the key element has a file element. This file is what is used to find out the nation, leader and city names, and art set. To use your own file, just change the path and file name in the file element. As a guide, use any of the xml files in your game tribes folder for the different nations.
Step 8. Limiting the nations that can be played
In order to limit the nations that are playable in your campaign, simply create a valid_nation section, as in ctw_alexander_map_01.xml, and list the tribes you wish the player to play.
Step 9. Creating scripts to be run on the outer map
Looking in ctw_alexander_map_01.xml, you will notice that there are more script files than just the battles script. Here is a description of what each of them do:
post_turn_script_file – runs at the end of the player’s turn. Useful for events.
diplo_response_script_file – the script the computer uses to decide whether or not to accept a diplomatic deal, as well as make a counter-offer.
diplo_offer_script_file – the script the computer uses to initiate diplomatic offers.
initialization_script_file – runs at the very beginning of the campaign.
Some additional script entries can be seen by looking at
ctw_cold_war_map_01.xml in your conquest directory.
links_script_file – use this script to remove all links from the map and set up your own links.
strategy_script_file – use this script to tell the computer to attack a specific territory.
post_ai_script_file – runs after the computer players have taken their turn.
Be sure to look at the specified files to see what you can do in these scripts.
Step 10. Setting up your intro and end game images
Looking at ctw_alexander_map_01.xml, you can find the following entries for placing in images you have generated.
intro_image – The image that is displayed while the campaign is loading.
end_game_images – The images that are displayed upon the end of the campaign.
If you want to set different intro and end game images for the different tribes, look at the tribes section of ctw_new_world_map_01.xml.
Step 11. Setting continents
In order to have continents that give the player a bonus for controlling, you will need to create a continents section in your xml file. Look at ctw_alexander_map_01.xml for reference. You can also set the tribe file for the barbarians of this region here. To have lines show up on the mini-map, use the attribute titled minimap_continents, using one of your own .tga files as the new map.
Step 12. Bonus Card deck
Use the bonuscarddeck section, as in ctw_alexander_map_01.xml, to specify the Bonus Cards available for the player to buy.
Step 13. Setting victory conditions, instructions, more info
To set victory conditions, use the victory conditions attribute in ctw_napoleon_map_01.xml as a guide.
To set instructions (the pop up at the beginning of the campaign) and more info text, use ctw_alexander_map_01_info_text.xml as reference.
Step 14. Crafting a campaign like Napoleon
Using the ctw_napoleon_map_01.xml file in your conquest directory as reference, here’s the things that the Napoleon campaign did differently:
allows_vA**als – will allow vA**als if set to 1.
no_patriot – will turn off patriots for the campaign if its set to 1.
Finally, the colony section will determine whether or not your campaign has colonies. Copy the section from the Napoleon xml file and edit it to have them in your campaign.
Step 15. Crafting a campaign like the Cold War
The Cold War campaign has a few features different from the other campaigns. If you wish to take advantage of them, here’s the attributes you will need (as seen in ctw_cold_war_map_01.xml):
strategic_nukes – allows nukes on the outer map if it’s a 1.
allow_vA**als – if it’s a 1, will allow vA**als.
client_state – if there are vA**als, making this a 1 will make them be called client states instead.
free_move – making this a 1 allows your armies to move anywhere in your territory.
territory_income – if this is 1, it gives you income for your territory strength levels.
no_oath_cards – making this a 1 will disable oath of fealty cards.
Finally, if you wish to have more modern army pieces, copy the conquestgraphicpieces section to you xml file.
Useful functions to use in your campaign script files
get_territory_owner(String country) – to find the owner of a territory
get_turn() – to find what the current turn is (word of warning, turn 1 on the outer map is turn 0 in script).
ctw_is_war(String str_tribe1, String str_tribe2) – finds out if 2 nations are at war (there are also functions for peace and ally).
ctw_is_vA**al(String str_tribe) – finds out if a nation is a vA**al.
ctw_get_master(String str_tribe) – finds out the master of a vA**al nation.
ctw_is_defeated(String str_tribe) – finds out if a nation has been defeated on the outer map.
get_num_tribute(String str_tribe) – finds the amount of tribute a tribe has.
give _bonus_card(String str_tribe, String str_card_name) – gives a player a bonus card
give_ctw_tribute(String str_tribe, int num_val) – gives a player tribute
set_no_attack(String str_tribe, String str_terr1) – tells a nation not to attack a certain territory
ctw_set_sub_goals(String str_goal1, String str_goal2) – sets priorities for the player
Step 1. Creating the Map
In an image editor, ie. Photoshop or Paint, create your map. One clever way to do this in photoshop is to find a map image that you’d like to use. Make that a transparent layer and then trace it into a new layer. There are a couple important rules about this process.
Each territory must have its own unique color.
The ocean must be white.
Each territory must have a 1 pixel x 1 pixel black dot to indicate where its capital should be.
Following these rules is the most difficult part of creating a new map. A single pixel that is even slightly the wrong color will make it unusable. For this reason, I recommend using the simplest of image editors like Paint. If you use a more robust editor like Photoshop, make sure to disable all anti-aliasing. Anti-aliasing will create different shades of your intended color and break the map.
The map should be wider than it is tall. For best results, create an image that is the same size as the map included with Rise of Nations. ([gamedirectory]/conquest/ctw_world_map_01.png)
It must use the .png format. It does not need an alpha channel. Use any filename that you’d like.
This image will be used for generating scenarios and for the mouseover highlighting in Conquer the World.
Step 2. Creating the rendering version
Make a copy of the map that you just created. This new image will be used to draw the map on the screen. It can be modified however you’d like to make an attractive version of the map. Name this file RENDER_[the first image name].png. These images must be the same size.
Step 3. Importing the map into CtW
Place the colored data map into the conquest directory. Place the rendering map into the conquest/render maps directory. Now start Rise of Nations and navigate to the CtW setup screen. You’ll notice that the top white box that normally says World Map is now a dropdown menu. Use that menu to select the filename of your new map. If it is not there, then your data map has been placed in the wrong directory.
Now begin a new campaign. While CtW loads up your new map, it will create an xml file that contains all of its settings. Quit out of Rise of Nations and open it up. It will be in the conquest directory and be named with the same name as your data map.
Within the file, each territory has an entry in the COUNTRY table. If there are more COUNTRY entries intended, then you have extra colors in your map image. Each country entry contains information about where in the image it is located with the left, right, top, and bottom attributes. Use these to locate the stray colors and remove them from the image. Then delete the xml file and repeat this step. An additional trick for checking your map beforehand in PhotoShop is to export your image as a .gif. After you do this, PhotoShop will tell you exactly how many colors are in your image. You should have 1 color per country plus black and white. (Thanks to MicroSlave for the tip)
There will also be a file called [yourfilename]_strings.xml. This file is for localization and does not need to be altered.
Step 4. Placing nations and identifying links
After all this work, it is finally time for the interesting portion of creating a CtW map. You will want to change the names of each country. Make the “id” field the same as the name. The countries are ordered by their positions in the image; left to right then top to bottom. Then you will want to change the owner fields to place the correct nations on the correct territories.
The LINK data contains information about where you can attack from each country. Links are automatically created for every country that physically touches another. You may add links for countries with water between them. The “to” field should contain the “id” of the country that can be attacked. Any sea link should have the “sea” flag set to 1.
Step 5. Placing Bonus Cards, Rare Resources, Tribute, special graphics
At this point, use ctw_world_map_01.xml in your conquest directory as a reference. Each territory can specify which bonuses that it contains. Each country can also have a continent identifier. You create the continents by listing them as done in ctw_world_map_01.xml. You can also specify unique art to display when continents are captured. The loading screen background can also be specified in the map xml file.
Debugging hints:
If you change the data .png file, you’re likely to change the order in which the countries are found when loading the file. If they’re found in a different order than they’re listed in the xml file, you might have problems. If you change the image, you should backup the xml file and then delete it and re-export it. Then copy back in your information in the correct order. If you change the rendering image or the data image, be sure to delete the conquest/temp directory to remove any cached versions. Otherwise, your changes might not appear or countries might appear in the wrong locations and break the generated scenarios.
NEW FOR THRONES AND PATRIOTS
Step 6. Creating scenarios for your campaign
The first step is to create a scenario in the scenario editor. If you wish, you can also create a script for it. You can even create a setup script that will run before the game is loaded for Conquer the World scenarios. Alternatively, you can just have a script and let Conquer the World generate your map when the scenario is run. Once this is done, using ctw_alexander_map_01.xml in your conquest directory as reference, create a scenario section (conqueststyles), and place your scenario in one of the four categories. Offensive scenarios pop up during attacks against other nations, defensive during defenses, barbarian when attacking barbarian territories, and custom come up by script.
To create a battle script, use alexander_battles.bhs in the conquest/alexander/ folder as your guide. Use the parameters of the script to find out important information like where you are attacking to or from, or who the opponent is. Next, use the battle variable to set what battle is going to be fought (the id of the scenario you created in your xml file), and battle_info to create advisor text to display when attacking into that scenario. For example, if you wanted the Battle of Bull Run to come up when attacking into Northern Virginia, the script would look something like this:
if (to == “Northern Virginia”) {
battle = “The Battle of Bull Run”;
battle_info = “This battle will become a tourist attraction in the near future.”;
}
To A**ociate your script with your xml file, using ctw_alexander_map_01.xml as a guide, create a battle_script_file attribute in the root, and give it the value of the name and location of your script (for example, .\conquest\CivilWar\civilwar_battles.bhs).
Step 7. Creating custom tribes
If you need a nation that is not in Thrones and Patriots to appear in your campaign, you can rename a nation that is in the game, and change its art set if necessary. Using ctw_alexander_map_01.xml as reference, create a tribes section in your xml file. You will notice in the Alexander xml file that each tribe named in the key element has a file element. This file is what is used to find out the nation, leader and city names, and art set. To use your own file, just change the path and file name in the file element. As a guide, use any of the xml files in your game tribes folder for the different nations.
Step 8. Limiting the nations that can be played
In order to limit the nations that are playable in your campaign, simply create a valid_nation section, as in ctw_alexander_map_01.xml, and list the tribes you wish the player to play.
Step 9. Creating scripts to be run on the outer map
Looking in ctw_alexander_map_01.xml, you will notice that there are more script files than just the battles script. Here is a description of what each of them do:
post_turn_script_file – runs at the end of the player’s turn. Useful for events.
diplo_response_script_file – the script the computer uses to decide whether or not to accept a diplomatic deal, as well as make a counter-offer.
diplo_offer_script_file – the script the computer uses to initiate diplomatic offers.
initialization_script_file – runs at the very beginning of the campaign.
Some additional script entries can be seen by looking at
ctw_cold_war_map_01.xml in your conquest directory.
links_script_file – use this script to remove all links from the map and set up your own links.
strategy_script_file – use this script to tell the computer to attack a specific territory.
post_ai_script_file – runs after the computer players have taken their turn.
Be sure to look at the specified files to see what you can do in these scripts.
Step 10. Setting up your intro and end game images
Looking at ctw_alexander_map_01.xml, you can find the following entries for placing in images you have generated.
intro_image – The image that is displayed while the campaign is loading.
end_game_images – The images that are displayed upon the end of the campaign.
If you want to set different intro and end game images for the different tribes, look at the tribes section of ctw_new_world_map_01.xml.
Step 11. Setting continents
In order to have continents that give the player a bonus for controlling, you will need to create a continents section in your xml file. Look at ctw_alexander_map_01.xml for reference. You can also set the tribe file for the barbarians of this region here. To have lines show up on the mini-map, use the attribute titled minimap_continents, using one of your own .tga files as the new map.
Step 12. Bonus Card deck
Use the bonuscarddeck section, as in ctw_alexander_map_01.xml, to specify the Bonus Cards available for the player to buy.
Step 13. Setting victory conditions, instructions, more info
To set victory conditions, use the victory conditions attribute in ctw_napoleon_map_01.xml as a guide.
To set instructions (the pop up at the beginning of the campaign) and more info text, use ctw_alexander_map_01_info_text.xml as reference.
Step 14. Crafting a campaign like Napoleon
Using the ctw_napoleon_map_01.xml file in your conquest directory as reference, here’s the things that the Napoleon campaign did differently:
allows_vA**als – will allow vA**als if set to 1.
no_patriot – will turn off patriots for the campaign if its set to 1.
Finally, the colony section will determine whether or not your campaign has colonies. Copy the section from the Napoleon xml file and edit it to have them in your campaign.
Step 15. Crafting a campaign like the Cold War
The Cold War campaign has a few features different from the other campaigns. If you wish to take advantage of them, here’s the attributes you will need (as seen in ctw_cold_war_map_01.xml):
strategic_nukes – allows nukes on the outer map if it’s a 1.
allow_vA**als – if it’s a 1, will allow vA**als.
client_state – if there are vA**als, making this a 1 will make them be called client states instead.
free_move – making this a 1 allows your armies to move anywhere in your territory.
territory_income – if this is 1, it gives you income for your territory strength levels.
no_oath_cards – making this a 1 will disable oath of fealty cards.
Finally, if you wish to have more modern army pieces, copy the conquestgraphicpieces section to you xml file.
Useful functions to use in your campaign script files
get_territory_owner(String country) – to find the owner of a territory
get_turn() – to find what the current turn is (word of warning, turn 1 on the outer map is turn 0 in script).
ctw_is_war(String str_tribe1, String str_tribe2) – finds out if 2 nations are at war (there are also functions for peace and ally).
ctw_is_vA**al(String str_tribe) – finds out if a nation is a vA**al.
ctw_get_master(String str_tribe) – finds out the master of a vA**al nation.
ctw_is_defeated(String str_tribe) – finds out if a nation has been defeated on the outer map.
get_num_tribute(String str_tribe) – finds the amount of tribute a tribe has.
give _bonus_card(String str_tribe, String str_card_name) – gives a player a bonus card
give_ctw_tribute(String str_tribe, int num_val) – gives a player tribute
set_no_attack(String str_tribe, String str_terr1) – tells a nation not to attack a certain territory
ctw_set_sub_goals(String str_goal1, String str_goal2) – sets priorities for the player