CCTP Map Tutorial

FiresForever

Prince
Joined
Sep 30, 2010
Messages
584
**THIS TUTORIAL IS NOT YET COMPLETE**

Extracting .civ5map Data


The most complicated part of adding your own maps is to get the Mappoints, this is the data that we take from the worldbuilder map files.

Programs you will need for Mappoint:

Setup Notepad Macros
To make it easy i have included a number of macros for notepad++, you can find information on setting these up by looking at the"ReadMe - How to add Macros to Notepad++.txt" located at:
My Games\Sid Meier's Civilization 5\MODS\Community-Call-To-Power-Mod\CCTP Maps\CCTP\Notepad++ Macros

Getting the data out of the worldbuilder files

Find the Map you want to add

Spoiler :


Load up HxD and then open the Civ5map file

Spoiler :


We now need to find out where the information relating to the "mappoint" data begins, scroll down the file until we find something similar to what is in the screen shot. While it might not begin with a "06" it should be quite obvious to identify, 01, 02 etc.
Spoiler :



We need to copy this section so place your cursor at the start of this section, in my case 06, and begin highlighting downwards. Depending on the size of the map this might take a while :) for you to reach the end of this section. The end of this section should also be quite obvious, see screenshot.

Spoiler :


When you have highlighted all of these section edit > copy it, open up Notepad++, create a new txt file and then paste, then save. We can now turn on wordwrap if it is not already on, you can find it on the toolbar, it is the 19 icon from the left.
We should now have something similar to the screenshot:
Spoiler :



Place cursor at start, go macro, and press "CCTP Map Con Macro", this should create something similar to the following:
Spoiler :



Do not move the cursor, we now want to run this macro mulltiple times, go to "Macro" > ""Run a Macro Multiple Times", setup the popup as in the screenshot. I use 1000 as i can then be sure that the program hasn't crashed, you might need to use a lower or higher amount depending on your computer. It takes a while so don't worry if it stops responding, and you will have to run this multiple times until the entire file has been converted. Note: The macro will run beyond the end of your file so make sure to delete the excess code created at the end of the file.

Spoiler :


Go back up to the top of the file and place your cursor at the start, we now want to run a second macro multiple times so that we can make it a little more organized. The macro is "CCTP map hex step 2". When complete we should have something like the following, this is now ready to be used, so again save it :).
Spoiler :



Now grab a drink and celebrate as you have finished the hardest part of adding your own map to CCTP :thumbsup:
 
MapInfo.lua File Creation

This file holds all of the important information relating to our maps including the map, civ starting locations, scenario details, etc

Add Mappoint and set world size


I am using the "Yet Not Another Earth Map Earth Huge" map so i am going to use the unique prefix:

"YNAEMEH"

Go To
"Documents\My Games\Sid Meier's Civilization 5\MODS\Community-Call-To-Power-Mod\CCTP Maps\MapFiles"

Right click the "TemplateMapInfo.lua" and press copy, then paste it back into this folder so that we create a copy of this file, which will be called something like "TemplateMapInfo - Copy.lua".

Rename this file so that we have "prefix+MapInfo.lua", so in my case YNAEMEHMapInfo.lua

Open this file in notepad++, first we need to add our prefix to all of the arrays eg
"WorldSize = {, MapPoint = {, etc"

so that they become
"YNAEMEHWorldSize = {, YNAEMEHMapPoint = {, etc"

see screenshot:

Spoiler :


Now lets go back to those MapPoints we were working on earlier, copy and paste them into the section "prefix+MapPoint = { }", between the {} brackets. See screenshot:
Spoiler :



Now lets complete the "YNAEMEHWorldSize = { 0,0 }" section at the top. This is the size of the map that you are using, you can get this information by loading the original .civ5map file in worldbuilder if you do not already know it. In my case the map has a width of 120 and height of 80, so i will change this to "YNAEMEHWorldSize = { 120,80 }", screenshot:

Spoiler :


You can now fill in all the other sections, civinfo, etc. It should be relatively straight forward using the other included mapinfo.lua files as reference.
 
MasterMapInfo.lua

Once you have added all the information to your mapinfo.lua file you will now need to update the mastermapinfo.lua file. This file basically collates all the information into one location so that we don't have to edit multiple lua files :)

First you will need to add your Mapinfo.lua file into the header of this file, in my case i have to add:
Code:
include("YNAEMEHMapInfo");

You will now see a list of code that looks like the following:

Code:
{1,LEMScenario1,LEMMapPoint,LEMWorldSize,LEMCivInfo,LEMStateInfo,LEMNaturalWonders,LEMScenario1Details,LEMMapOptions},

We need to add a new one of these to the end of the file, but before:
Code:
{"end",2,3,4,5,6,7,8,9},

If you followed the above instructions it should be very straight foward, basically we want to replace the "LEM" section with our own prefix so that it matches our own mapinfo.lua file. So in my case i will add an entry as follows:
Code:
{4,YNAEMEHScenario1,YNAEMEHMapPoint,YNAEMEHWorldSize,YNAEMEHCivInfo,YNAEMEHStateInfo,YNAEMEHNaturalWonders,YNAEMEHScenario1Details, YNAEMEHMapOptions},
 
Fires,

I'm trying to do that but I am help up at stage where you say "Place cursor at start, go macro, and press "CCTP Map Con Macro."

I have clicked on "Macro" and don't see anything like that. Perhaps I'm just not understanding.
 
Did you install the macros as it says in the ReadMe - How to add Macros to Notepad++.txt file?
 
I believe so. It looks like what I've pasted below. I can't find where to run this Macro though.

Spoiler :
<NotepadPlus>
<InternalCommands />
<Macros>
<Macro name="CCTP Map Con Macro" Ctrl="no" Alt="no" Shift="no" Key="0">
<Action type="1" message="2170" wParam="0" lParam="0" sParam='&quot;' />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2326" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2326" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="1" message="2170" wParam="0" lParam="0" sParam='&quot;' />
<Action type="1" message="2170" wParam="0" lParam="0" sParam="," />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
</Macro>
<Macro name="CCTP map hex Step 2" Ctrl="no" Alt="no" Shift="no" Key="0">
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
<Action type="1" message="2170" wParam="0" lParam="0" sParam="
" />
<Action type="1" message="2170" wParam="0" lParam="0" sParam="
" />
</Macro>
</Macros>
<UserDefinedCommands>
<Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox &quot;$(FULL_CURRENT_PATH)&quot;</Command>
<Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore &quot;$(FULL_CURRENT_PATH)&quot;</Command>
<Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome &quot;$(FULL_CURRENT_PATH)&quot;</Command>
<Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="70">safari &quot;$(FULL_CURRENT_PATH)&quot;</Command>
<Command name="Get php help" Ctrl="no" Alt="yes" Shift="no" Key="112">http://www.php.net/%20$(CURRENT_WORD)</Command>
<Command name="Google Search" Ctrl="no" Alt="yes" Shift="no" Key="113">http://www.google.com/search?q=$(CURRENT_WORD)</Command>
<Command name="Wikipedia Search" Ctrl="no" Alt="yes" Shift="no" Key="114">http://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD)</Command>
<Command name="Open file" Ctrl="no" Alt="yes" Shift="no" Key="116">$(NPP_DIRECTORY)\notepad++.exe $(CURRENT_WORD)</Command>
<Command name="Open in another instance" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_DIRECTORY)\notepad++.exe $(CURRENT_WORD) -nosession -multiInst</Command>
<Command name="Open containing folder" Ctrl="no" Alt="no" Shift="no" Key="0">explorer $(CURRENT_DIRECTORY)</Command>
<Command name="Open current dir cmd" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /K cd /d $(CURRENT_DIRECTORY)</Command>
<Command name="Send via Outlook" Ctrl="yes" Alt="yes" Shift="yes" Key="79">outlook /a &quot;$(FULL_CURRENT_PATH)&quot;</Command>
</UserDefinedCommands>
<PluginCommands />
<ScintillaKeys />
</NotepadPlus>
 
I cannot see whats wrong with that, i have attached my shortcuts.xml file so just unrar it and copy it over your own. Also i have added a screenshot for where the macros should appear, you will need to restart notepad++ once you have replaced the shortcuts.xml file
 

Attachments

  • shortcuts.rar
    869 bytes · Views: 70
  • macro.jpg
    macro.jpg
    127.8 KB · Views: 121
Thanks for sharing that file Fires. I got past that part with your help, but somewhere along the lines I'm still doing something wrong. I followed everything (I think), but the file isn't appearing when I go to "Start Game" after loading the MOD.

I'm not familiar with Macros. How do I know when it has converted all of the code? How do I know what is extra and should be deleted?
 
If you can post your files I can look them over.

You run the macro multiple times, when it reaches the end it doesn't stop so. When it goes past the end of the actual code in this case you will get allot of "","", type of thing.

Hopefully with the dll being released a lot of this will no longer be needed :)
 
Ok, I give up. This MOD is bar-none the best out there, but it's impossible to play for those of us who want to use pre-made scenarios. I've attempted to build a WWIII scenario, but find it impossible to do.

In short, the biggest (dare I say only) fault with this MOD is that it isn't accessible to map-builders who aren't coders.

Is anything underway to make it more accessible?
 
Untill Firaxis fix thier code the only way to add a map is how FireForever has detailed here.

Multi posting the same message in different threads realy is ANOYING. :gripe:
 
There is nothing in the patch notes about it, and its unlikely they will fix it since they only seem to do that when the main game approaches the limit like with promotions.

There is a chance that the array or the function itself will be exposed with the dll, so we can fix it ourselves, so it's really a case of hoping and waiting at this point. It will be one of the first things I look at.
 
First few seconds of looking at the source code and i already found where the array problem is with the world builder maps so should be able to fix it :).
 
I am taking another stab at converting my modern world map, but there are problems with the tutorial.

Line 4's spoiler ("We need to copy this section so place your cursor...") no longer expands and I can't see it. Same goes for the last spoiler ("Now lets complete the "YNAEMEHWorldSize").

Could you please update them?
 
Top Bottom