|
|
(3 intermediate revisions by one other user not shown) |
Line 1: |
Line 1: |
|
|
==Converting maps from 0.8.23 or previous to 0.9.0 format== |
|
First, get an unchanged version of Alpha 23 Globulation 2 source code. Make the following changes: |
|
|
|
As of 0.9.0, Globulation 2 uses a new map format. this means any maps made in and used in any version prior to 0.9.0 no longer works. To convert these to the new format, first get an unchanged version of Alpha 23 Globulation 2 source code and make the following changes: |
|
|
|
|
|
In Map.h, at line 100, add the following line: |
|
* In Map.h, at line 100, add the following line: |
|
⚫ |
<pre>/// Save transitional map data. This is temporary map information that is saved by |
|
⚫ |
/// the alpha 23 patch for transfering between map formats |
|
⚫ |
void saveTransitional(); </pre> |
|
|
|
|
|
⚫ |
* In Map.cpp, at line 1246, add the following lines: |
⚫ |
/// Save transitional map data. This is temporary map information that is saved by |
|
|
⚫ |
<pre>void Map::saveTransitional() |
⚫ |
/// the alpha 23 patch for transfering between map formats |
|
⚫ |
|
|
|
|
|
⚫ |
In Map.cpp, at line 1246, add the following lines: |
|
|
|
|
⚫ |
void Map::saveTransitional() |
|
|
{ |
|
{ |
|
std::string fileName = glob2NameToFilename("maps", "output", ""); |
|
std::string fileName = glob2NameToFilename("maps", "output", ""); |
Line 31: |
Line 30: |
|
} |
|
} |
|
delete stream; |
|
delete stream; |
|
|
}</pre> |
|
} |
|
|
|
|
⚫ |
In MapEdit.cpp, at line 1782, change |
|
|
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
performAction(globalContainer->settings.editor_keyboard_shortcuts["hkey"]); |
|
|
break; |
|
|
|
|
⚫ |
|
|
|
|
|
|
|
⚫ |
* In MapEdit.cpp, at line 1782, change |
⚫ |
|
|
|
⚫ |
|
⚫ |
|
|
|
⚫ |
|
⚫ |
game.map.saveTransitional(); |
|
|
⚫ |
performAction(globalContainer->settings.editor_keyboard_shortcuts["hkey"]); |
⚫ |
|
|
|
break;
|
|
break;</pre> |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
game.map.saveTransitional(); |
|
⚫ |
|
|
|
break;</pre> |
|
|
|
|
|
|
|
|
|
⚫ |
Now, load up the map you wish to convert in the Alpha 23 version in the Map Editor. Hit "I " (you won't see anything happen, but something did). Now, create a new map of exactly the same size in the new Globulation 2. In the Map Editor, Hit "I ", and the terrain features will be loaded. Simply place buildings and units and you are ready to go. |
|
|
|
|
|
|
[[Category:en]] |
⚫ |
Now, load up the map you wish to convert in the Alpha 23 version in the Map Editor. Hit I (you won't see anything happen, but something did). Now, create a new map of exactly the same size in the new Globulation 2. In the Map Editor, Hit I, and the terrain features will be loaded. Simply place buildings and units and you are ready to go. |
|
|
|
[[Category:Developer Resources]] |
Converting maps from 0.8.23 or previous to 0.9.0 format
As of 0.9.0, Globulation 2 uses a new map format. this means any maps made in and used in any version prior to 0.9.0 no longer works. To convert these to the new format, first get an unchanged version of Alpha 23 Globulation 2 source code and make the following changes:
- In Map.h, at line 100, add the following line:
/// Save transitional map data. This is temporary map information that is saved by
/// the alpha 23 patch for transfering between map formats
void saveTransitional();
- In Map.cpp, at line 1246, add the following lines:
void Map::saveTransitional()
{
std::string fileName = glob2NameToFilename("maps", "output", "");
OutputStream *stream = new BinaryOutputStream(Toolkit::getFileManager()->openOutputStreamBackend(fileName));
// We write what's inside the map:
stream->write(undermap, size, "undermap");
for (size_t i=0; i<size ;i++)
{
stream->writeUint16(cases[i].terrain, "terrain");
stream->write(&(cases[i].ressource), 4, "ressource");
stream->writeUint16(cases[i].scriptAreas, "scriptAreas");
stream->writeUint8(cases[i].canRessourcesGrow, "canRessourcesGrow");
}
//Save area names
for(int n=0; n<9; ++n)
{
stream->writeEnterSection(n);
stream->writeText(getAreaName(n), "areaname");
stream->writeLeaveSection();
}
delete stream;
}
- In MapEdit.cpp, at line 1782, change
case SDLK_i :
if(pressed)
performAction(globalContainer->settings.editor_keyboard_shortcuts["hkey"]);
break;
- to
case SDLK_i :
if(pressed)
game.map.saveTransitional();
renderMiniMap();
break;
Now, load up the map you wish to convert in the Alpha 23 version in the Map Editor. Hit "I" (you won't see anything happen, but something did). Now, create a new map of exactly the same size in the new Globulation 2. In the Map Editor, Hit "I", and the terrain features will be loaded. Simply place buildings and units and you are ready to go.