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

[Map script]Creation.py for FFH2

Discussion in 'FfH2 Modmods, Scenarios, and Maps' started by cephalo, Feb 2, 2008.

  1. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    The problem with variables vs dropdowns is that they are not compatible in MP, unless you have the exact same values you will get an OOS. So drop downs is what I would prefer.
     
  2. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    I never actually designed the map to wrap. Some people have noted that it actually does work, but it's only by accident.
     
  3. copx

    copx Chieftain

    Joined:
    Dec 20, 2008
    Messages:
    62
    Is there any difference between Creation.py and Erebus.py? These two map scripts seem to generate similar results.

    Also, is creation.py still in development?
     
  4. JDexter

    JDexter Chieftain

    Joined:
    Dec 18, 2003
    Messages:
    565
    Gender:
    Male
    Location:
    Germany
    When Kael included Creation in FfH it was renamed to Erebus, so the only difference might be the version of the map script that you are playing.

    Cephalo, weren't you coding something big/new a few months ago? What was it, if it's already done?
     
  5. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    The versions are actually different. I leave this one up because it is compatible with BtS while the Erebus map script is not.
     
  6. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    It was the FaireWeather map script for Colonization. See sig for a link. I also had another project in the works, but then I got busy with other things and I'm actually taking a break from modding.
     
  7. Bumbar

    Bumbar Chieftain

    Joined:
    Sep 29, 2008
    Messages:
    11
    Is there a way, to force the script to create only one continent, preferably crescent shaped or with internal sea?
     
  8. EnButtetSkude

    EnButtetSkude Chieftain

    Joined:
    Jan 19, 2009
    Messages:
    1
    Hi all

    First I want to say thanks to cephalo for this great script. I registered just to say that.

    Secon - I have been messing a bit around in the script and added a quick dirty fix to make some small islands:

    Add these variables just below SoftenPeakPercent

    Code:
    SmallIslandLANDPercent = .02
    SmallIslandHILLSPercent = .01
    Now after the bits of code following #Now for SoftenPeakPercent of peaks, make them hills

    add:
    Code:
    #Make small islands flat land or hills
    	#LAND
    	for y in range(1,mapSize.MapHeight - 1):
                for x in range(1,mapSize.MapWidth - 1):
                    i = GetIndex(x,y)
                    if self.plotMap[i] == self.OCEAN:
                        if SmallIslandLANDPercent >= PRand.random():
                            self.plotMap[i] = self.LAND
    	#Hills
    	for y in range(1,mapSize.MapHeight - 1):
                for x in range(1,mapSize.MapWidth - 1):
                    i = GetIndex(x,y)
                    if self.plotMap[i] == self.OCEAN:
                        if SmallIslandHILLSPercent >= PRand.random():
                            self.plotMap[i] = self.HILLS
    this is clearly not an optimal solution, but it sprinkle a few islands around in the water.
    The biggest problem is that each island tend to have jungle on it! which looks kind of silly next to a tundra shore. But that has something to do with Cephalos elaborate climate model.

    But it clearly makes ocean exploring way more fun and sometimes a non ocean passage between the continents.

    UPDATE:

    Ok - I somehow fixed the jungle issue. This change will remove forest/jungle from all one plot islands:

    here is the code you'll have to change:
    Code:
    #forest and jungle
    if plot.isWater() == False and terrainMap.terrainMap[i] != terrainMap.DESERT and\
    plotMap.plotMap[i] != plotMap.PEAK:
    add one more condition, to check if this is an island:
    Code:
    #forest and jungle
    if plot.isWater() == False and terrainMap.terrainMap[i] != terrainMap.DESERT and\
    plotMap.plotMap[i] != plotMap.PEAK and not IsPlotSurroundedByOcean(x,y):
    This is my first try of python coding :crazyeye: there is probably some more elegant solutions please feel free to comment.
     
  9. giddion

    giddion Crusader

    Joined:
    Aug 7, 2007
    Messages:
    258
    Location:
    Melbourne, Australia
    I notice in the script, there are "print" statements commented out.
    Is there a debugger that can be used?

    Also just a python question about declarations and functions.
    Do they have to be defined in a particular location?

    I personally like them all at the top.
    The menu related items, can they be moved to the start of the script, or are they order dependent?
     
  10. Victorvanwavere

    Victorvanwavere Chieftain

    Joined:
    Apr 6, 2002
    Messages:
    105
    Location:
    O.C. California
    Will there be any problems running this Map Script with FFH2 .041?
     
  11. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Shouldn't be, seeing as this is the Erebus mapscript that is included in FfH. :lol:
     
  12. Sephi

    Sephi Chieftain

    Joined:
    Jan 25, 2009
    Messages:
    2,908
    I noticed that you use a lot of gc.getInfoTypeForString("NO_X"), where X is BONUS, IMPROVEMENT etc. However NO_X isn't a valid argument for gc.getInfoTypeForString. Instead you can use BonusTypes.NO_BONUS or simply replace it with -1 which is the value for all the NO_X. I guess it doesn't cause big problems the way it is now but a few things might not be the way you wanted them.
     
  13. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    That's funny. I believe that if you send a bad string it returns -1. So it works accidently. :lol:

    It was such a long time ago. I don't remember why I did it that way.
     
  14. Sephi

    Sephi Chieftain

    Joined:
    Jan 25, 2009
    Messages:
    2,908
    I thought it returns 0 but you are correct, it returns -1, so just a cosmetic issue
     
  15. MasterTonberry

    MasterTonberry Chieftain

    Joined:
    Jul 22, 2007
    Messages:
    93
    QUick question about the Erebus mapscript in FfH2.

    All other maps work fine with that mod, and the Erebus map script does sometimes.....but most of the time the game will just stop responding during the map setup loading screen when using Erebus or ErebusContinent.

    Anyone have any idea why?
     
  16. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    The Erebus script can take a while to create a map, if you are using the version which has Peak Softening from FF and Orbis.

    ErebusContinent has the same issue... But makes such awesome maps that I use it anyway. :lol:
     
  17. MasterTonberry

    MasterTonberry Chieftain

    Joined:
    Jul 22, 2007
    Messages:
    93
    Taking a while is an understatement in my experience. If it actually works as I expect, it takes around 50 seconds to create a map.

    Most of the time it will just stop responding, and I have actually left it sitting in that state for up to half an hour just to test it.

    Basically, if it hasn't created a map within 2 minutes, it isn't going to work. I can not for the life of me work out why it just decides to stop working like that though. Not when every other map I've tried works without fail.
     
  18. MasterTonberry

    MasterTonberry Chieftain

    Joined:
    Jul 22, 2007
    Messages:
    93
    OK, basically if I try to lower the percentage of mountains from default, the game will not start at all.

    I have to leave everything as it is, otherwise the game will hang on the map setup loading screen.
     
  19. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    Which mod are you using? The Erebus map script works definitely in Flavourmod, even with peak softening active. Just tried it.
     
  20. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,942
    Location:
    Seyda Neen, Vvardenfell
    it works fine, it just APPEARS like it freezes. do have patience and it will, indeed, generate a map. ErebusContinent is definitely the best one for FFH.
     

Share This Page