1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

BMP to WBS Converter

Discussion in 'Civ4 - Utility Programs' started by Rhye, Oct 31, 2005.

  1. OzzyKP

    OzzyKP Emperor

    Joined:
    Dec 16, 2000
    Messages:
    1,692
    Location:
    Washington, DC USA
  2. Feet

    Feet Warlord

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    Maybe your map is just too big?

    I've created another map and I get the same problem now... just defeated straight away. Either that or your civs starting locations are under the ocean or if there's only mountains then you'd get the same thing? There's no way to specify exactly where your civ will start so that's a possibility I guess.

    I reckon it could be a size thing. The map I made is 120 x 180 and I think it's just too big to deal with.
     
  3. Osymandias

    Osymandias Grand King of Apes

    Joined:
    Apr 16, 2004
    Messages:
    450
    Location:
    In the heart of the Bavarian Forest
    there are several ways do set startinglocs! :rolleyes:

    1. on page 36 in the pdf is explained how you can code the startingplots in your *.py python-file

    2. you can load your map (*.civ4worldbuildersave) in a texteditor (notepad,...), search the coordinates where a startloc should be and type 'Startingplot'

    3. you can load it in the worldbuilder and place there the startingunits (i guess, thats impossible in fact of the 'you have been defeated problem'...)

    i have already done two maps :D ---> http://www.civforum.de/showthread.php?t=27891
    and http://www.civforum.de/showthread.php?t=27892
     
  4. Flamegrape

    Flamegrape Warlord

    Joined:
    Dec 20, 2002
    Messages:
    245
    Location:
    United States
    I'm getting this error:


    Setting WBSPath to C:\Python24\test.Civ4WorldBuilderSave

    Traceback (most recent call last):
    File "C:\Python24\BMPtoWBSConverter186.py", line 273, in OnStart
    err = self.wxApp.ConvertBMP()
    File "C:\Python24\BMPtoWBSConverter186.py", line 375, in OnStart
    self.HeightMap = Image.open(self.HeightMap)
    File "C:\Python24\BMPtoWBSConverter186.py", line 1717, in open
    fp = __builtin__.open(fp, "rb")
    IOError: [Errno2] No such file or directory: ' '

    :nuke: :nuke: :nuke: :nuke: :nuke:

    I'm getting this exact same error with anything I try. Even the blank maps don't work and give the same error messages.

    Anyone have any ideas?
     
  5. Feet

    Feet Warlord

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    @ 0d1n3oo3Broad: Ok well I haven't got that far with my map yet (which also works), so no need to be snippy, I don't mind being corrected (I'm new to modding Civ) but there was no need for the patronising rolly eyes. Atleast I'm trying to help the guy.

    I didn't specify any starting locations for my map and all the civs still start on random locations on the map with no problems, like I said it was only a possibility.

    I thought the size of the map may be causing the problem more then the starting locations. I say that too.
     
  6. Osymandias

    Osymandias Grand King of Apes

    Joined:
    Apr 16, 2004
    Messages:
    450
    Location:
    In the heart of the Bavarian Forest
    @feet
    it was not ment to be snippy! i just wanted to help because i thought you didnt know how to set startinglocs! i had already the same 'you have been defeated'-problem and it hasn't occured since i set startingpositions so i thougt 'tell them this...'
    another point to set startingpositions manually is that your startingpos is EVERY time the same! i do not know if it minds you but it minds me!

    so i apologize if you felt insulted or so, it was in no way ment to be snippy! :beer: :D
    allthough, im also new to civ-*modding* (just done 2 maps..) and i just wanted to tell you my experiences so that you know what to do if you get the same strange things....
     
  7. Feet

    Feet Warlord

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    Ok no worries 0d1n3oo3Broad. :) I'm very interested in what you know, just didn't like the smiley you used. I'm probably reading to much into it anyway. Forget about it. :D

    Also I don't (or didn't) know how to set the starting locations! I certianly haven't set any on my map, and it works fine.

    How come in my map the starting locations set themselves on a correct tile automatically (instead of ocean or mountain tiles)? And in other peoples maps they are getting the you have been defeated message cause the starting locs are in mountains or under water... very odd.

    No idea why mine worked straight off and others do not.
     
  8. Feet

    Feet Warlord

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    Ok well I think that you actually need a height map and a terrain map to be able to open the wbs in worldbuilder.

    Using just a height map producing the following in the WBS file,

    BeginPlot
    x=1,y=122
    BonusType=
    TerrainType=TERRAIN_OCEAN
    PlotType=3
    EndPlot
    BeginPlot
    x=1,y=123
    BonusType=
    TerrainType=TERRAIN_OCEAN
    PlotType=3
    EndPlot
    BeginPlot
    x=2,y=0
    BonusType=
    TerrainType=NONE
    PlotType=2
    EndPlot
    BeginPlot
    x=2,y=1
    BonusType=
    TerrainType=NONE
    PlotType=2
    EndPlot
    BeginPlot
    x=2,y=2
    BonusType=
    TerrainType=TERRAIN_COAST
    PlotType=3

    I'm thinking you need to have a terrain map that's completely green for it to work in the Worldbuilder.

    That's the problem. In the .pdf manual it says,
    "Actually, only the first is required to generate a map. You can just select the heights map, andpress Cancel for the others."
    This is not true. You need a height map, and a terrain map that is completely green for it to work.

    EDIT: yes I've just tested this and that is the problem, my new map works but you need to have atleast a height BMP and a completely green terrain BMP fo it to work.
     
  9. Osymandias

    Osymandias Grand King of Apes

    Joined:
    Apr 16, 2004
    Messages:
    450
    Location:
    In the heart of the Bavarian Forest
    i have not tried it only with the height map. i have done 5 maps from the beginning. and it worked and still works fine to me ;) it sounds to be a lot of work but it's going smoother and easier than in the civ3-editor!

    to set startinglocs i have done it this way: i have loaded my height map in MS paint, mirrored(?) it verticaly (cause civ4 has the coordinatesystem from the lower-left corner, ms paint from the upper-left) and just pointed over a tile, read the coordinates and set a startingloc (i have also pointed the pixel in pink to see where i have alreay one; i havent saved it but i would say you should it save under *startingloc.bmp* or so; you dont know if you need it later again...i did and had to search the coordinates out of the file and havent saved it again..... :( )

    i hope my tips will help you! :goodjob: i have 'worked' the whole weekend on my maps until i knowed how it works how it should :)

    but i have discoverd another problem: i have tried to set ladmarks and (i think) if a landmark is on the same tile or even near of a tile with a startingloc the message appears again....it's strange.....
     
  10. Tboy

    Tboy Future world ruler

    Joined:
    Aug 5, 2004
    Messages:
    1,111
    Location:
    At my Computer, somewhere in the UK
    This is a great program, but is it possible to either:

    1.Change the program so it uses other picture files (e.g. JPG files).
    2.Change the pictures so they are BMP.
    Thanks again Rhye,
    Tboy
     
  11. Feet

    Feet Warlord

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    If you have a jpg picture you want to change to BMP, do this.

    Open it in MS Paint, click File and then Save As.

    Choose BMP from filetype drop down menu and hey presto you got the same pic in BMP format. Or you can just just the extension up to you.
     
  12. Rabbit_Alex

    Rabbit_Alex Prince

    Joined:
    Oct 29, 2005
    Messages:
    597
    Location:
    Gaylord, Michigan, USA
    I can't get it to work. I installed Python and PyPIL and extracted the zip file to my python directory C:/Python24. I double-clicked on the emptyscenario.py file and I got a console window open up for a second and then it closed. How do I get it to open up the little application window like the walkthrough suggested? I beleive I followed it the right way.

    Thanks for any help.
     
  13. Fenryial

    Fenryial Chieftain

    Joined:
    Nov 2, 2005
    Messages:
    49
    Location:
    San Diego
    Right click on the file and choose "edit with IDLE"
     
  14. Aeon221

    Aeon221 Lord of the Cheese Helmet

    Joined:
    Apr 22, 2003
    Messages:
    1,900
    Location:
    Hiding from the Afro-Eurasians
    False. Correct answer is to go read the posts on the front of the page. Someone already had this problem.

    Correct Answer (complete) is that you need to download and install this program: wxPython

    Now, hopefully you have both learned something very valuable about Google ;p
     
  15. Craterus22

    Craterus22 King

    Joined:
    Oct 7, 2001
    Messages:
    689
  16. Himik

    Himik Chieftain

    Joined:
    Oct 20, 2005
    Messages:
    5
    Location:
    Russia, SPB
    Respect Rhye
     
  17. CivArmy s. 1994

    CivArmy s. 1994 Deity

    Joined:
    Feb 7, 2004
    Messages:
    3,641
    Location:
    Campinas, Brazil
    Help! :)
    I have Python 2.4, Imaging-1.1.5 and wxPython2.6-win32-ansi-2.6.1.0-py24.exe installed and when I double click "EmptyScenario.py" appears a black window for 1 second and then this window close. If I edit this file with IDLE and there type F5 sometime appears a message of error and sometimes a screen where I can type any command.

    what I supose to do??? :blush:
     
  18. tbear2520

    tbear2520 Warlord

    Joined:
    Oct 28, 2005
    Messages:
    103
    To run it just double click on the emptyscenario.py. I had the same problem's as the others. I installed the three following things.

    PIL-1.1.5.win32-py2.4.exe Size = 521KB
    python-2.4.2.msi Size = 9445KB
    wxPython2.6-win32-ansi-2.6.1.0-py24.exe Size = 5325KB

    Cut and paste them into google and if neccesary do a find in page on the website that it finds.

    I did of course reboot, which I don't think is even neccesary but what can it hurt. Then extract the BMPC186_withTutorial.zip into the directory C:\Python24 and double-click the emptyscenario.py file.

    That should at least run the program. The PDF is pretty theral on this info. Good luck ;)
     
  19. Osymandias

    Osymandias Grand King of Apes

    Joined:
    Apr 16, 2004
    Messages:
    450
    Location:
    In the heart of the Bavarian Forest
    you haven't to unzip the BMPC186_withTutorial.zip to the python folder. it works also in another folder. eg. i've made a new folder called 'bitmapkonverter' in my documents (or where you want). i think its better to work with. there are only the utilities of the conv in it and not all the other things that are in the python folder. i have also made for every map a seperate folder with its bmps in it.
    just a tip how i did it ;)
     
  20. Door

    Door Chieftain

    Joined:
    Dec 16, 2003
    Messages:
    49
    Just to say I've modified the original converter so that it can now add routes (roads/rails), improvements and starting locations from bmp images. Rhye has been kind enough to add it to the first post in the thread, here.
     

Share This Page