Naval Mod Creation - Discussion

As far as I can see, the Settler-boat idea could work for the most part under the whole 'domain'-thing but being able to be plotted within the ocean is something of a complication. Possibly limiting the opening of this feature to a tech research is best, as I can see possible bugs if that kind of thing is let through at game start. (Best possible start point for CPU, PC is in the ocean? Trouble...) It's also possible... I'm going to try some test into adding in some kind of sea route function test and let it use the road/railroad as the primary function calls, but be considered a ocean based tile system. Thus allowing the current work boats (Ones that are supposed to NOT go to ocean.) to create 'sea-roads' using the same functional key as a worker would. (Kind of complicated to explain, but you can swap out functions and set them on other units. A good example of this is the Settler button and command. You can swap that to anyone.) If this makeshift function works, then it might be a step closer to possible making the sea-settler work, as the underlying stuff needed for it would be in place then. I believe the main problem I forsee in the sea-settler is something in python that settlers use.... reference : plot... I believe that's the 3x3 city grid when the city is made, so....

I'll let ya know if I make any good progress on the worker/boat alteration fix.
 
SSJSoulStar, after reading more carefully I think that between the two of us one of us is misunderstanding the settler-boat idea. It seems like you're thinking that a boat would create a city on top of a coastal/ocean tile. My take on it was that the boat would create a city on a land tile that's adjacent to a coastal tile...
 
You got what the general idea was, and I see yours now... Basically you want to be able to plant a settler on a plot that's at least 3 blocks away.... Lemme see if there is anything to be done about that.
 
Tenketsu: Your right - that was my original idea however it doesn't seem possible to get a sea unit to "land" on a land tile. Well I can't work it out at the moment.

led me to my second idea that SSJSoulstar was investigating which was if you could build a city at sea (which you currently can't do - add the <found> tag to a ship and it won't let you build on water) i was wondering if you could cjhange the terrain of the tile and then build a city on on it.

Really appreciate you looking into if for me SSJSoulstar. I investigated the route command myself but i don't think it can be that. To add my tunnel i added this to the CIV4BuildInfos.xml

Code:
		<BuildInfo>
			<Type>BUILD_TUNNEL</Type>
			<Description>TXT_KEY_BUILD_TUNNEL</Description>
			<Help/>
			<PrereqTech>NONE</PrereqTech>
			<iTime>0</iTime>
			<bKill>1</bKill>
			<ImprovementType>NONE</ImprovementType>
			<RouteType>ROUTE_RAILROAD</RouteType>
			<EntityEvent>ENTEVENT_RAILROAD</EntityEvent>
			<FeatureStructs/>
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<Button>Art/Interface/Buttons/Builds/Tunnel.dds</Button>
		</BuildInfo>

and then assigned the Workboat the build command for a tunnel. Theoritically this should act just like a railrod and be built outside cultural borders but its not. It can only be built inside cultural borders. What I'm guessing is the <type>BUILD_XXX</type> command is called somewhere else that stipulates what can and can't be built outside cultural borders.

Haven't been able to work on it tonight but will be get back to investigating tomorrow. Thanks for looking into it for me. Preciated
 
AndyTerry said:
Interesting. But, you know, in usual Civ4 game 4000 BC - 2050 AD navy doesn't play an important role.

Erm the whole point of what im trying to do is change it so the navy *does* have an important role to play.
 
The Butler said:
Tenketsu: Your right - that was my original idea however it doesn't seem possible to get a sea unit to "land" on a land tile. Well I can't work it out at the moment.

led me to my second idea that SSJSoulstar was investigating which was if you could build a city at sea (which you currently can't do - add the <found> tag to a ship and it won't let you build on water) i was wondering if you could cjhange the terrain of the tile and then build a city on on it.

Oh, I see. I hadn't picked up on that distinction apparently, eheh...

The Butler said:
Really appreciate you looking into if for me SSJSoulstar. I investigated the route command myself but i don't think it can be that. To add my tunnel i added this to the CIV4BuildInfos.xml
...
Haven't been able to work on it tonight but will be get back to investigating tomorrow. Thanks for looking into it for me. Preciated

Ditto on the appreciation, for both of you guys--if a way to make a colony-boat put a city on land can be found, it'll save me a lot of trouble when I reach that point in my own mod, so... Thanks. :)
 
A test that you CAN do for the sea-road deal is roads. Those can be used outside of cultural borders to make trade routes, but as I recall, railroads can't be used because they are a 'researched technology' and culture issues, which other civs can use... Which is a decent explanation.

As for the Sea-Settler, there are still a few key things I need to find in the plotter (Which is the main python file for all the settler information...), but take a look at CIV4DetailManager.xml, as that has most of the plotter info, but there is more info somewhere that is needed. (Mainly the culture expansion ratio, and how the plotter can plot the city...) So many little things, but the big things are yet to be found in xml so far... :/ I'll continue doing the research and see what else I can dig up... Hopefully I'll find what we're all looking for soon. (Mainly for me, battleships attacking land units in a coastal base... Conquering a coastal base... If we can figure out how to do that, then we are half-way to solving alot of naval issues.

**Replies to questions :

Problem 1 with the Railroads on the sea : The entity event should be entevent_build and nothing else, as offshore platforms are the only 'out of land' building, and uses that event to make it. shovels and railroad event won't work in the case because of that... It's only a minor thing though, and doubt that would fix it.

Find/replace/update terrain : There is something similiar to this in the GreenMod 2.1 (I believe?), that allows you to add forests/jungles back in to be replanted... If this is the case, then there might be a way to recall a ocean spot and reclaim it to land. I'll look into it since I got the mod already.
 
SSJSoulstar said:
Find/replace/update terrain : There is something similiar to this in the GreenMod 2.1 (I believe?), that allows you to add forests/jungles back in to be replanted... If this is the case, then there might be a way to recall a ocean spot and reclaim it to land. I'll look into it since I got the mod already.

Yep thats where I found the information. However it uses features not terrain and the features are ice/jungle/forest/oasis/floodplains/fallout. Not exactly sure if that's helpful.

Have any mods got a terraform unit coz im sure i remember reading about it... the code for that would be useful for us.
 
Code:
		elif(iImprovement==lowerelev):
			if(pPlot.getPlotType()==PlotTypes.PLOT_LAND):
				numberofunits = pPlot.getNumUnits()
				while(numberofunits > 0):
					pPlot.getUnit(0).jumpToNearestValidPlot()
					numberofunits = pPlot.getNumUnits()
				pPlot.setPlotType(PlotTypes.PLOT_OCEAN, true, true)
			else:
				pPlot.setPlotType(PlotTypes.PLOT_LAND, true, true)
				if(pPlot.getTerrainType()==gc.getInfoTypeForString("TERRAIN_DESERT") and pPlot.isRiver()):
                                        pPlot.setFeatureType(gc.getInfoTypeForString("FEATURE_FLOOD_PLAINS"), 0)
			pPlot.setImprovementType(-1)

This code here is stollen from rogerbacon terraform mod and can be used to turn a water tile into a land tile.

so can this
Code:
	def eventRemoveWaterBegin(self, argsList):
		popup = PyPopup.PyPopup(7502, EventContextTypes.EVENTCONTEXT_ALL)
		popup.setHeaderString("What water would you like to make land?")
	    	popup.createPullDown()
		for i in range(0 , len(self.list)):
		     	popup.addPullDownString(self.list[i] , i)
		popup.addButton("Ok")
                CyCamera().JustLookAtPlot(self.pPlot)
		popup.launch(False, PopupStates.POPUPSTATE_IMMEDIATE)
		return

	def eventRemoveWaterApply(self, playerID, userData, popupReturn):
		if (popupReturn.getButtonClicked() == 0):
			direction = self.list[popupReturn.getSelectedPullDownValue(0)]
			ix = self.pPlot.getX()
			iy = self.pPlot.getY()
			if((direction == "SouthWest(1)") or (direction == "West(4)") or (direction == "NorthWest(7)")):
				ix = ix - 1
			if((direction == "SouthEast(3)") or (direction == "East(6)") or (direction == "NorthEast(9)")):
				ix = ix + 1
			if((direction == "SouthWest(1)") or (direction == "South(2)") or (direction == "SouthEast(3)")):
				iy = iy - 1
			if((direction == "NorthWest(7)") or (direction == "North(8)") or (direction == "NorthEast(9)")):
				iy = iy + 1
                        self.pPlot = CyMap().plot(ix,iy)
			self.pPlot.setPlotType(PlotTypes.PLOT_LAND, true, true)
			self.pPlot.setTerrainType(gc.getInfoTypeForString("TERRAIN_PLAINS"), true, true)
			self.list = []

which allows you to select an adjacent tile to turn from water into land.

However when you turn a sea tile into a land tile with a sea unit on it, the sea unit disappears.

This leaves me to the conclusion that i can get this sea-settler to work if i can figure a way to either a) completion of the terraform causes the tile to be changed and a settler/city to be built on it. b) when a naval unit moves into a coastal tile you can build city/settler and it displays a list of land locations you can build it on.

This is the angle i'm currently working on - any ideas?
 
Hmm gotta head to work in a bit, but here was what popped in my head :

If terraform = yes then unit_naval = rand(1)_move_unit.... Or something like that. It's similiar to the code found when you invade a country and are sitting within it's cultural borders and you make peace... It will boot all units out of culture range. I'll also take a look at those codes too and see if there is a way to do it.

I'll check back in tomorrow.
 
For a scifi mod I'm looking at turning oceans into something entirely different, so this is interesting to me.

Not having yet dug into Python, I'm not sure I see why a "railroad" can't be built on the ocean, but I'll try to figure this out for myself at home.

Would this work in conjunction with terraforming: either upgrade Coasts or create a new water tile "water route" that works a lot like coasts. Certain boats could then terra (er, aqua?) form ocean into either coats or "water route" tiles.

Using just XML (I think) you could then have naval vessels travel X times faster on such terrain, and I think you could also make it possible to trade via these lanes. (In fact, if you changed the tech Astronomy so that these special lanes rather than oceans allow trade, you essentially have your blockade concept enacted by allowing nations to block routes through sitting on the lane, presumably severing the connection).

Whether you do this through ocean roads or tiles, it would add realism if the lanes "decay" without periodic upkeep (e.g. to fight piracy and whatnot). However, I could also see how this would be really annoying, unless there was some function you could assign to automate the patrolling (and upkeep) of these lanes to a unit.
 
OK, just reread one of the earlier posts. If the original problem here is that turning on ocean roads would lead to roads being built everywhere (like in Civ3), then the decay idea might work. The decay should ideally be tied to the last time a military unit passed over that tile.

Alternatively or additionally, you could make it cost gold to build an ocean lane, to disincentivize players from spamming them. Or you could make it very time-consuming. Or both.

Something like the decay idea would be to periodically spam barbarian pirate ships that rampage around destroying any lanes they come across. Give them the ability to blitz and they should tidy work of it.
 
For some reason I keep rereading this thread and seeing different things. ADHD taking hold???

For a settler-boat, perhaps look into the Python code for handling upgrades? From what I understand when you upgrade a unit the game actually destroys the old unit and replaces it with a new one. That's essentially what you are doing with the boat, only changing the location of the new unit (which the code you posted would handle).
 
Padmewan said:
For some reason I keep rereading this thread and seeing different things. ADHD taking hold???

For a settler-boat, perhaps look into the Python code for handling upgrades? From what I understand when you upgrade a unit the game actually destroys the old unit and replaces it with a new one. That's essentially what you are doing with the boat, only changing the location of the new unit (which the code you posted would handle).

That is a good idea... although I still don't know the python that would do upon improvement completion upgrade unit to x and move to tile y... although I think that is doable - just got to find someone and something that knows how to do it.

As for the railroad at sea I've created that calling it tunnel whereby an expensive type of workboat can create railroads at sea. However railroads can only be built inside your own cultural borders which is not all that useful. Still haven't worked out how to turn this off. Thats the next hurdle.
 
Try adjusting the cultural expansion sets. Remember that the cultural expansions have 5 set timers when the borders expand, so checking that code along with maybe adding in more culture expansion... I believe there is a xml that handles most of this legwork. I'm currently learning python so I can better understand the coding side of things and eventually get cracking on the settler problem. From what I've learned so far, there is a oddly high chance I can make the settler's (Original ones... odd.) recognize the ocean, not sea, as a settler spot and build a city on that piece. It would then sacrifice the boat and settler used and create the tile into a land tile surrounded by water on all sides.

Hopefully this is close to what everyone is wanting as that's what I meddling with and learning atm.
 
The Butler said:
As for the railroad at sea I've created that calling it tunnel whereby an expensive type of workboat can create railroads at sea. However railroads can only be built inside your own cultural borders which is not all that useful. Still haven't worked out how to turn this off. Thats the next hurdle.

This is not the default behavior on land, is it? I'm pretty sure you can build RR outside your borders... but now that I think about it, I can't specifically remember doing it.

How about starting with sea-roads to begin with and see if that works? Tripling the number of moves a ship can make is more useful than a flat 10 tiles! (And all of this is tweakable at any rate).
 
have you just tried "unloaading" a city and destroying the ship?
 
Another Naval Mod idea...

Why not have alternating naval and non-naval turns. Part of the reason naval moves lose their importance is that a navy can drop off units the same turn it travels, and then head for home. The size of your naval source over another fleet doesn't matter very much if it never meets the opposition.

However, if turns, or alternating turns, featured a purely naval movement phase in one turn, then non-naval moves in the next, protecting that invasion force or transport convoy would become much more important.

There must be someway to restrict movement in a domain on alternating turns using python. Air domain could, perhaps, be allowed in any turn.

I come at this idea from the perspective of a War Gamer (board games), and it is common for those types of games to have different phases for land/sea/air.
 
Back
Top Bottom