View Full Version : World Builder map saves?


MosquitoE
Feb 07, 2006, 09:10 AM
Is there a way to save a map from a game in progress and use it again?
Or is there a way to restart a game on the same map?

I am playing a SP game and I really like how the terrain is laid out, but I cant figure out how to reuse it.

Thanks in advance.

atreas
Feb 07, 2006, 10:38 AM
There is a way, even without additional programs, but it is far from automatic: you save the WB file, edit it a bit to leave only the map (in fact, these saves are XML files too), and then "copy-paste" the map to another (WB-saved) file. You must just be careful to clear tile improvements (if any) and place units correctly on land squares (again, if any).

Of course, it would be nice if WB had a feature to load maps from another file and "repost" units in the new map. But it isn't easy, or even feasible, unless we are talking only about the starting position.

MosquitoE
Feb 07, 2006, 11:13 AM
Thats what I found also, but it didn't seem very practical.
I am already fairly well into the game so editing out all the tile improvements, units, cities, replacing forests that may have been cut down... :sad:

I was hoping there was a better way.

DaveMcW
Feb 07, 2006, 12:24 PM
If it's your most recent game, you should have a 4000BC autosave.

atreas
Feb 07, 2006, 03:40 PM
To do it "the easy way" you must program a bit. If you happen to know any "Regular Expressions" language, like PERL, it's really easy. If you don't you just need to use something like Microsoft Word. I have created for you a sample code that does most (if not all) of the job (you must add it as a macro to Microsoft Word, open the WB save in Word, and run it). It isn't elegant, but I just created it in a short time just to show you the idea:

Sub CleanUpEverythingExceptTiles()
'
' This macro is very simple - it just uses Regular Expressions
' to clean up a WorldBuilder save file

'As Reg Expressions can't use paragraph characters, first replace them with line feed
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = "^l"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll

'Clear Up Units
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^tBeginUnit*EndUnit^l"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

'Clear roads and other routes
With Selection.Find
.Text = "^tRouteType*^l"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAll

'Clear visibility
With Selection.Find
.Text = "^tTeamReveal*^l"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll


'Clear Improvements
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^tImprovementType*^l"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

'Clear Cities
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^tBeginCity*EndCity^l"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

'Restore Paragraphs
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

MosquitoE
Feb 08, 2006, 11:07 AM
Thanks Atreas, I'll give that a try.:)

atreas
Feb 08, 2006, 11:15 AM
Of course dont expect to see the trees replant:) . You must also add the first units (settler, scouts, archers) on your own, as visibility has beed nulled.