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

[SDK mod] Borders over Ocean

Discussion in 'Civ4 - Mod Components' started by RogerBacon, Apr 25, 2006.

  1. RogerBacon

    RogerBacon King

    Joined:
    Nov 16, 2003
    Messages:
    649
    Hello all,

    Since version 1.0 it has bothered me that cultural borders didn't extend over ocean. Well now, thanks to the SDK, they can.

    Download it here

    The code is attached below if you want to compile it yourself. You can see the change on line 9334.

    Enjoy,
    Roger Bacon

     

    Attached Files:

  2. TheLopez

    TheLopez Deity

    Joined:
    Jan 16, 2006
    Messages:
    2,525
    Location:
    Oregon
    Very cool Roger :goodjob:
     
  3. Spocko

    Spocko Warlord

    Joined:
    Dec 18, 2005
    Messages:
    168
    Location:
    Dover, New Hampshire
    Hello again RogerBacon!

    Could you post the dds for the Rising Sun flag? The version I downloaded (from another user) in November was a blank file. Thanks!!!

    Spocko
     
  4. RogerBacon

    RogerBacon King

    Joined:
    Nov 16, 2003
    Messages:
    649
    Here is the flag. I renamed it to .txt because you can't attach .dds files. When you look at the file in a viewer it will appear blank. Actually, the entire image takes teh team color, I believe, and the alpha channel just blocks out the parts that are supposed to be white-- at least for thsi flag.

    Roger Bacon
     

    Attached Files:

  5. Spocko

    Spocko Warlord

    Joined:
    Dec 18, 2005
    Messages:
    168
    Location:
    Dover, New Hampshire
    :goodjob:

    I just pulled it out of your customassets post, and set <bWhiteFlag>0</bWhiteFlag> in CIV4ArtDefines_Civilizations.

    Thanks!
     
  6. IrishDragon

    IrishDragon Legend

    Joined:
    Mar 1, 2006
    Messages:
    443
    handy little mod
     
  7. Oh my, this is very interesting. I might just use it right away, do you know how it'll affect a game in progress?
     
  8. TheLopez

    TheLopez Deity

    Joined:
    Jan 16, 2006
    Messages:
    2,525
    Location:
    Oregon
    I don't think you can add a DLL to a mod and play a game in progress... at least from my experience it causes the game to crash
     
  9. Hehe, I'm gonna try it anyway... "Please assume crash positions." :D

    Btw, I had an idea about these:

    Is it possible to make it so that the culture growth over seas is slower than over land, i.e. some percentage of it? Again, this is with the idea of allowing mod makers to balance out this feature (that is if it's made available through XML). Because me for example, while I do think that borders should extend further over seas than 2-3 squares (which will also make navy more important), I don't think they should grow at the same speed.
     
  10. RogerBacon

    RogerBacon King

    Joined:
    Nov 16, 2003
    Messages:
    649
    It works fine with a game already in progress.

    Roger Bacon
     
  11. TheLopez

    TheLopez Deity

    Joined:
    Jan 16, 2006
    Messages:
    2,525
    Location:
    Oregon
    Really?? That's very wierd because when I updated one of my mods to use talchas Action Button Mod 2.0 my game in progress no longer worked...

    Wierd.
     
  12. RogerBacon

    RogerBacon King

    Joined:
    Nov 16, 2003
    Messages:
    649
    When I first tested this I used a saved game from a week earlier and it worked fine. When I tested my 3-square radius cities I couldn't use saved games. I'm pretty sure that is because that mod had arrays of a fixed size already initialized. For the Borders over Ocean mod it is very simple. I just commented out one line. ;)

    Roger Bacon
     
  13. eerr

    eerr Emperor

    Joined:
    May 27, 2006
    Messages:
    1,077
    currently "cannot enter oceans" doesn't apply to oceans within cultural borders, is there an easy way to change this?
     
  14. GamingGirl333

    GamingGirl333 Chieftain

    Joined:
    Dec 8, 2004
    Messages:
    6
    I tried to download this and the file seems to be missing.
     
  15. Xander-V

    Xander-V Chieftain

    Joined:
    May 1, 2007
    Messages:
    2
    Yeah where did it go? =(
     
  16. RogerBacon

    RogerBacon King

    Joined:
    Nov 16, 2003
    Messages:
    649
    Uploaded it again. Download is working now. I think if no one downloads it for 30 days it gets deleted.

    Roger Bacon
     
  17. aberwak

    aberwak Mapper of the world

    Joined:
    Jun 19, 2007
    Messages:
    70
    Location:
    There's a NEW Mexico?
    I just found this. It sounds like a great mod. Any chance of having it uploaded again? Also, is it BTS-compatible? Thanks for doing this mod.
     
  18. GeoModder

    GeoModder Deity

    Joined:
    Nov 29, 2005
    Messages:
    7,512
    If it's SDK, it sure isn't compatible with BtS since in April 2006 the expansion wasn't out yet. ;)
     
  19. RogerBacon

    RogerBacon King

    Joined:
    Nov 16, 2003
    Messages:
    649
    This was a one-line code change to make this mod work and I'm sure it is the same in the expansion. All I had to do to make borders expand over ocean squares was remove a condition that the square has to be a workable land tile. I changed the condition check to (true) so it would always work.
    Just get the api for the expansion and search for something similar to the code I'll post below. It should be pretty easy to do. I never got the expansion so I can't do it.

    Code:
    void CvCity::doPlotCulture(bool bUpdate)
    {
    	CvPlot* pLoopPlot;
    	int iDX, iDY;
    	int iCultureRange;
    
    	CyCity* pyCity = new CyCity(this);
    	CyArgsList argsList;
    	argsList.add(gDLL->getPythonIFace()->makePythonObject(pyCity));	// pass in city class
    	argsList.add(bUpdate);
    	long lResult=0;
    	gDLL->getPythonIFace()->callFunction(PYGameModule, "doPlotCulture", argsList.makeFunctionArgs(), &lResult);
    	delete pyCity;	// python fxn must not hold on to this pointer 
    	if (lResult == 1)
    	{
    		return;
    	}
    
    	if (getCulture(getOwnerINLINE()) > 0)
    	{
    		if (getCultureLevel() != NO_CULTURELEVEL)
    		{
    			for (iDX = -getCultureLevel(); iDX <= getCultureLevel(); iDX++)
    			{
    				for (iDY = -getCultureLevel(); iDY <= getCultureLevel(); iDY++)
    				{
    					iCultureRange = cultureDistance(iDX, iDY);
    
    					if (iCultureRange <= getCultureLevel())
    					{
    						pLoopPlot = plotXY(getX_INLINE(), getY_INLINE(), iDX, iDY);
    
    						if (pLoopPlot != NULL)
    						{
    							if (true)//pLoopPlot->isPotentialCityWorkForArea(area())) // Borders over Water -RogerBacon
    							{
    								pLoopPlot->changeCulture(getOwnerINLINE(), (((getCultureLevel() - iCultureRange) * 20) + getCommerceRate(COMMERCE_CULTURE) + 1), (bUpdate || !(pLoopPlot->isOwned())));
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    }
    
     
  20. kevinman4404

    kevinman4404 Lightning Warrior

    Joined:
    Mar 31, 2007
    Messages:
    837
    Location:
    Ontario
    Hi Roger Bacon. So if I change the boolean to false, it'll nullify the changes? (I'm actually opting to go back to no ocean borders for my mod, though I've never experienced them cuz I've always been patched)
     

Share This Page