Resources in Final Frontier

Or is the reason nobody is answering something else?
It's a conspiracy! :p

I don't really know why it wouldn't work, perhaps FF handles cities differently, that wouldn't suprise me. I haven't messed with FF that much so you've now passed the point where I can no longer help. Heck, you may be the first to even try to tackle such a project using FF, it's different enough from the base game that most of us won't be able to give you specific answers.
 
It's a conspiracy! :p

I don't really know why it wouldn't work, perhaps FF handles cities differently, that wouldn't suprise me. I haven't messed with FF that much so you've now passed the point where I can no longer help. Heck, you may be the first to even try to tackle such a project using FF, it's different enough from the base game that most of us won't be able to give you specific answers.

Lol, sorry. I was thinking nobody wanted to mess with FF. :lol:

ok, so how do you define a terrain as able to be worked by workers in the regular game? is there a certain XML file that determines how and what it takes to work a terrain plot? If there is maybe I can scope out the differences. So where would I look for that information in the regular game? What XML file defines that?



:nuke: Cheers, Thorgrimm :nuke:
 
In Civ4BonusInfos.xml:

<TechReveal>TECH_INDUSTRIALISM</TechReveal>
<TechCityTrade>TECH_MINING</TechCityTrade>
<TechObsolete>NONE</TechObsolete>

TechReveal is required to be able to see the resource (even your invisible ones), TechCityTrade is required to be able to use it (once you can see it) and TechObsolete makes it useless. You don't need improvements on city tiles so you can ignore them.
 
In Civ4BonusInfos.xml:

<TechReveal>TECH_INDUSTRIALISM</TechReveal>
<TechCityTrade>TECH_MINING</TechCityTrade>
<TechObsolete>NONE</TechObsolete>

TechReveal is required to be able to see the resource (even your invisible ones), TechCityTrade is required to be able to use it (once you can see it) and TechObsolete makes it useless. You don't need improvements on city tiles so you can ignore them.

well, that does not help since all that occurs quite well. it is only the fact that the workers will not construct the extraction facility on the solar system plot. But if you place one there manually the resources are hooked up and usable. So I need to know what XML file tells the workers what terrain they can and cannot work. like Desert terrain in the regular game cannot be worked except for roads. Except for Oil bonuses.

In fact the desert analogy is perfect for the solar system terrain plot. You can road it up, but cannot improve it.



:nuke: Cheers, Thorgrimm :nuke:
 
Here is the water resource that I have changed. Note it works fine, I just can't get the worker units to build the extraction facility on the solar system plot.

Code:
		<BonusInfo>
			<Type>BONUS_WATER</Type>
			<Description>TXT_KEY_BONUS_WATER</Description>
			<Civilopedia>TXT_KEY_BONUS_WATER_PEDIA</Civilopedia>
			<BonusClassType>BONUSCLASS_GENERAL</BonusClassType>
			<ArtDefineTag>ART_DEF_BONUS_ALUMINUM</ArtDefineTag>
			<TechReveal>NONE</TechReveal>
			<TechCityTrade>NONE</TechCityTrade>
			<TechObsolete>NONE</TechObsolete>
			<YieldChanges/>
			<iAITradeModifier>10</iAITradeModifier>
			<iAIObjective>0</iAIObjective>
			<iHealth>3</iHealth>
			<iHappiness>0</iHappiness>
			<iPlacementOrder>2</iPlacementOrder>
			<iConstAppearance>100</iConstAppearance>
			<iMinAreaSize>3</iMinAreaSize>
			<iMinLatitude>0</iMinLatitude>
			<iMaxLatitude>90</iMaxLatitude>
			<Rands>
				<iRandApp1>10</iRandApp1>
				<iRandApp2>10</iRandApp2>
				<iRandApp3>0</iRandApp3>
				<iRandApp4>0</iRandApp4>
			</Rands>
			<iPlayer>100</iPlayer>
			<iTilesPer>9216</iTilesPer>
			<iMinLandPercent>0</iMinLandPercent>
			<iUnique>0</iUnique>
			<iGroupRange>0</iGroupRange>
			<iGroupRand>0</iGroupRand>
			<bArea>0</bArea>
			<bHills>0</bHills>
			<bFlatlands>1</bFlatlands>
			<bNoRiverSide>0</bNoRiverSide>
			<bNormalize>0</bNormalize>
			<TerrainBooleans/>
			<FeatureBooleans>
				<FeatureBoolean>
					<FeatureType>FEATURE_SOLAR_SYSTEM</FeatureType>
					<bFeature>1</bFeature>
				</FeatureBoolean>
			</FeatureBooleans>
			<FeatureTerrainBooleans>
				<FeatureTerrainBoolean>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<bFeatureTerrain>1</bFeatureTerrain>
				</FeatureTerrainBoolean>
			</FeatureTerrainBooleans>
		</BonusInfo>



:nuke: Cheers, Thorgrimm :nuke:
 
I think the problem you are having is due to the fact that Solar System is a 'Coast/Ocean' feature and that the default Extraction Facility improvement is setup to be used on 'land' only.

Since improvements can't (by default) be set to be Build on both 'water' and 'land' (even though they can be forced to exist on both), I would suggest trying to make a second Extraction Facility.

Quick HowTo:

CIV4ImprovementInfos.xml (Terrain folder)
- copy existing <ImprovementInfo> <Type>IMPROVEMENT_EXTRACTION_FACILITY ... </ImprovementInfo>
- rename copy IMPROVEMENT_EXTRACTION_FACILITY2
- change <bWater> to 1

CIV4BuildInfos.xml (Units folder)
- copy existing <BuildInfo> <Type>BUILD_EXTRACTION_FACILITY ... </BuildInfo>
- rename copy BUILD_EXTRACTION_FACILITY2
- change <ImprovementType> to BUILD_EXTRACTION_FACILITY2

CIV4UnitInfos.xml (Units folder)
- locate <Type>UNIT_CONSTRUCT_SHIP
- copy existing <Build> <BuildType>BUILD_EXTRACTION_FACILITY ... </Build>
- rename copy BUILD_EXTRACTION_FACILITY2

Enjoy (hopefully ;) )
 
Now I have to get the extractor to work on a star system's square. :)

Late getting back to this.
I wonder why you need a working extractor improvement on a star system square. If you settle the star system, isn't the resource automatically linked to it? In civ4 terms it should be equivalent on founding a new city on a resource.

Another thing you could do is (if you use them) let starbases be capable of "extracting" resources. Don't know if this is possible though. Haven't looked into that.

Something else I wondered about: would it be possible to let asteroids orbit stars? It could depict a main asteroid belt (or more) around stars...
 
I think the problem you are having is due to the fact that Solar System is a 'Coast/Ocean' feature and that the default Extraction Facility improvement is setup to be used on 'land' only.

Since improvements can't (by default) be set to be Build on both 'water' and 'land' (even though they can be forced to exist on both), I would suggest trying to make a second Extraction Facility.

Quick HowTo:

CIV4ImprovementInfos.xml (Terrain folder)
- copy existing <ImprovementInfo> <Type>IMPROVEMENT_EXTRACTION_FACILITY ... </ImprovementInfo>
- rename copy IMPROVEMENT_EXTRACTION_FACILITY2
- change <bWater> to 1

CIV4BuildInfos.xml (Units folder)
- copy existing <BuildInfo> <Type>BUILD_EXTRACTION_FACILITY ... </BuildInfo>
- rename copy BUILD_EXTRACTION_FACILITY2
- change <ImprovementType> to BUILD_EXTRACTION_FACILITY2

CIV4UnitInfos.xml (Units folder)
- locate <Type>UNIT_CONSTRUCT_SHIP
- copy existing <Build> <BuildType>BUILD_EXTRACTION_FACILITY ... </Build>
- rename copy BUILD_EXTRACTION_FACILITY2

Enjoy (hopefully ;) )

@ CyberChrist, Thanks for that! I will try that ASAP.

@GeoModder, The way FF has it set up only the Extraction Facility allows hooking into the resource. In the test I ran I gave myself a colony ship and ran it to the star system and founded the colony. You could see the resource available in the system, but not hooked into it. Yet in the system where I manually placed the EF the resource was hooked into and available.

As for the SB's being able to extract resources thats a good idea, but I have no idea how it would be implemented.

As for the asteriods, I am sure it is possible, but it would take python work to the map scripts and possibly redefining any possible benefit such as resources added to the system.



:nuke: Cheers, Thorgrimm :nuke:
 
After making the changes CyberChrist suggested I got an error saying:

Tag: IMPROVEMENT_EXTRACTION_FACILITY2 in Info Class was incorrect
Current XML files is: xml/units/CIV4BuildInfos.XML

But looking at it I have no idea why this error is occuring. Any ideas why?:confused:



:nuke: Cheers, Thorgrimm :nuke:
 
DRAT!!!!:mad: I found the error, it was because I made a wrong entry. Fixed it and no errors occurred. BUT, the construction ship still does not build the new EF in the Solar System plot. Even though it shows up in the civilopedia and says can only be built on water. :(

Any ideas why?




:nuke: Cheers, Thorgrimm :nuke:
 
Just did a test on a hunch and it paid off. It seems the new EF is not needed. On a hunch I connected my starting colony and one I planted later. Sure enough both resources showed up in the system box and giving their benefits. Even though when you mouse over the resource in the colony screen it says you have none of that type available. :lol:

Now for another question. Does TheLopez's resource building conversion mod work with BTS and version 3.13? Using that if I am able would go a long way to helping with Deuterium and Anti-Matter production.

Now only if Duke176 would finish his tut on adding Oil. :lol:



:nuke: Cheers, Thorgrimm :nuke:
 
You got my puzzled here. Were you trying to build an EF on top of a City/Colony before?!

If so then it would explain why you couldn't build the EF, if not then how does connecting 2 Cities/Colonies resolve the issue of building EFs on non-colonized Solar Systems?
 
A few other things that might cause problems if not set up correctly.

<PreReqTech> (BuildInfos)
Players must have this tech in order for Workers to be able to build the Improvement at all - just having a worker is not necessarily enough.

<TechCityTrade> (BonusInfos)
Players must have this tech in order to allow resource to be made available to colonies at all - connecting by route alone is not enough.

<BonusTypeStruct> (ImprovementInfos)
You need to set up one of these for each resource - and for each improvement type - you want workable by a certain improvement type.
 
You got my puzzled here. Were you trying to build an EF on top of a City/Colony before?!

If so then it would explain why you couldn't build the EF, if not then how does connecting 2 Cities/Colonies resolve the issue of building EFs on non-colonized Solar Systems?

Lol, yeah it was on colonized systems. I just ran a test on a uncolonized system and the new EF worked like a charm. I did say I was a newb to civ 4 modding. :lol: What threw me was that in the colonized systems the resource box shows the resource in the system but says you have none of that type. So I had assumed you needed a EF along with the colony to get the resource. :blush: :crazyeye:

Your suggestion of the new facility works as long as it is inside your borders which means either a colony or Starbase. I also think the border thing is why I never even thought about trying a uncolonized system since you needed either of those items to get the borders. And since colonization is the best route, in a way I have a mitigating circumstance for my newbishness. ;) :D



:nuke: Cheers, Thorgrimm :nuke:
 
It should be possible to use Python to force the SDK to allow building the EF outside borders as well - assuming it wasn't changed to ignore/skip Python demands/calls (some modders do that for reasons beyond my capacity to fathom).
 
It should be possible to use Python to force the SDK to allow building the EF outside borders as well - assuming it wasn't changed to ignore/skip Python demands/calls (some modders do that for reasons beyond my capacity to fathom).

Yeah that would be great. Since that could simulate Mining 'colonies' most star nations throw out by the dozens. :D As for actually implementing that, well, that is beyond my abilities. Heck I would not even know where to begin. :lol:



:nuke: Cheers, Thorgrimm :nuke:
 
The following should allow Extraction Facility to be build on Solar Systems outside borders (in theory).

In the file CvGameUtils.py (Assets\Python) locate and change this section ...
Spoiler :
Code:
			# Grav Field
			if (pPlot.getFeatureType() == iFeatureGravField):
				return 0
		
		# Starbase restriction
		iBuildStarbase = CvUtil.findInfoTypeNum(gc.getBuildInfo,gc.getNumBuildInfos(),'BUILD_STARBASE')
to include the code marked in bold (paste/copy it) so it looks like this:
Spoiler :
Code:
			# Grav Field
			if (pPlot.getFeatureType() == iFeatureGravField):
				return 0

[b]			# allow Extraction Facility on Solar Systems
			iFeatureIDSolarSystem = CvUtil.findInfoTypeNum(gc.getFeatureInfo,gc.getNumFeatureInfos(),'FEATURE_SOLAR_SYSTEM')
			if (pPlot.getFeatureType() == iFeatureIDSolarSystem):
				iBuildExtractionFacility2 = CvUtil.findInfoTypeNum(gc.getFeatureInfo,gc.getNumFeatureInfos(),'BUILD_EXTRACTION_FACILITY2')
				if (iBuild == iBuildExtractionFacility2)
					return 1[/b]

		# Starbase restriction
		iBuildStarbase = CvUtil.findInfoTypeNum(gc.getBuildInfo,gc.getNumBuildInfos(),'BUILD_STARBASE')

However, it will take more code to make it supply the resource from outside borders since that is determined by who owns the tile.
 
Outstanding my friend! I will add that ASAP and test. :goodjob:
 
Well, that did not work. When I tested it the planets and the colony interface items disappeared. :(

EDIT: Just removed the new code and everything went back to normal. So I added it again to see if the problem was reporducable, and yup same thing. Planets and colony interface items disappear.

Oh and there were no error messages displayed.



:nuke: Cheers, Thorgrimm :nuke:
 
Oops, seems I forgot a : at the end of one of the IF lines - my bad.

This is how the line should look:
Code:
			if (iBuild == iBuildExtractionFacility2)[b]:[/b]
 
Back
Top Bottom