When using World Builder...(Issue)

IamtheRain

Chieftain
Joined
Sep 6, 2009
Messages
2
I'll keep it simple - I've noticed that when making a Solar System with world builder...said system comes with no stars. Any idea what the reason for this is? Is there a fix? And I noticed this problem occur in Final Frontier as well.
 
You can't use worldbuilder to place solar systems. They are done 100% in python (so as far as the engine is concerned they don't do anything). Would require a TON of changes to worldbuilder. Your best bet is to generate a map that looks like what you want and just leave them be (changing any stars/planets manually in the worldbuildersave file if absolutely needed).
 
It would seem to be as simple as expanding this:

Code:
		if (self.featureType):
			featureTypeNum = CvUtil.findInfoTypeNum(gc.getFeatureInfo, gc.getNumFeatureInfos(), self.featureType)
			plot.setFeatureType(featureTypeNum, self.featureVariety)

bit of code in the Apply function of pyWBDesc to call the CvFinalFrontierEvents file's addSystem code, no?

Of course, it would be randomized, but it would be better then what we have now.
 
Would also make it possible to actually use worldbuilder to make maps if it works. I've always wanted to get worldbuilder to a useable state for making scenarios. Is there a way to make it apply script data to a plot when saving? Or to place the nutrition/mining facility in cities placed? That would eliminate the need to do that stuff manually.
 
It's not working as well as I hoped...

This is the code I added to class CvPlotDesc def apply:

Code:
		if (self.featureType):
			featureTypeNum = CvUtil.findInfoTypeNum(gc.getFeatureInfo, gc.getNumFeatureInfos(), self.featureType)
			plot.setFeatureType(featureTypeNum, self.featureVariety)
			[COLOR="Red"]if featureTypeNum == gc.getInfoTypeForString("FEATURE_SOLAR_SYSTEM"):
				print "Solar System Placed by Worldbuilder"
				FinalFrontier = CvEventInterface.getEventManager()
				pSystem = createRandomSystem(pPlot.getX(), pPlot.getY(), -1, 3)
				FinalFrontier.addSystem(pSystem)[/COLOR]

According to the print, it's not even finding any solar systems I placed, even when I place one. How should I be doing this? I really hate it when people use the CvUtil.findInfoTypeNum method and I use the gc.getInfoTypeForString method (or vice versa).. they just confuse me.
 
It's still not working. Revised code:

Code:
		if (self.featureType):
			featureTypeNum = CvUtil.findInfoTypeNum(gc.getFeatureInfo, gc.getNumFeatureInfos(), self.featureType)
			plot.setFeatureType(featureTypeNum, self.featureVariety)
			[COLOR="red"]if (featureTypeNum == CvUtil.findInfoTypeNum(gc.getFeatureInfo, gc.getNumFeatureInfos(), "FEATURE_SOLAR_SYSTEM")):
				print "Solar System Placed by Worldbuilder"
				FinalFrontier = CvEventInterface.getEventManager()
				pSystem = createRandomSystem(plot.getX(), plot.getY(), -1, 3)
				FinalFrontier.addSystem(pSystem)[/COLOR]

No print statement in PythonDbg.log. I also fixed an error- I used pPlot.getX() instead of plot.getX(). That should have been registered if it had read that line. So I tried one more thing:

Code:
		if (self.featureType):
			featureTypeNum = CvUtil.findInfoTypeNum(gc.getFeatureInfo, gc.getNumFeatureInfos(), self.featureType)
			plot.setFeatureType(featureTypeNum, self.featureVariety)
[COLOR="red"]			if self.featureType == 'FEATURE_SOLAR_SYSTEM':
				print "Solar System Placed by Worldbuilder"
				FinalFrontier = CvEventInterface.getEventManager()
				pSystem = createRandomSystem(plot.getX(), plot.getY(), -1, 3)
				FinalFrontier.addSystem(pSystem)[/COLOR]

The read and write functions of CvPlotDesc, already edited by Jon Shafer, work like this- check directly for FEATURE_SOLAR_SYSTEM as self.featureType. However, it didn't work either.
 
Might be time to try putting a print statement after the feature is added to the plot (right before your if statement). If that doesn't show up then it means that code after that point simply isn't being executed. If it does, you could try getting the feature on the plot rather than going after the one in worldbuilder (something like pPlot.getFeatureAtPlot(); not sure if that's the exact name of the function or not but it should be close).
 
It seems that code at that point simply isn't being executed. The print statement isn't showing up. However, if I reverse it to this

Code:
		if (self.featureType):
			featureTypeNum = CvUtil.findInfoTypeNum(gc.getFeatureInfo, gc.getNumFeatureInfos(), self.featureType)
			print "Post setFeatureType code reached"
			if self.featureType == 'FEATURE_SOLAR_SYSTEM':
				print "Solar System Placed by Worldbuilder"
				FinalFrontier = CvEventInterface.getEventManager()
				pSystem = createRandomSystem(plot.getX(), plot.getY(), -1, 3)
				FinalFrontier.addSystem(pSystem)
			plot.setFeatureType(featureTypeNum, self.featureVariety)

nothing happens either. I'm going to open a thread in the SDK and Python forum for this one, I think...
 
I got it working... it turned out I was messing around in the wrong file. I should have been editing CvWorldBuilderScreen.py. Which, I believe, is not in any Final Frontier mod, meaning this little utility/modcomp will have total compatibility.

What other things (in addition to properly adding systems) should Worldbuilder be able to do for Final Frontier? I'm not entirely sure how to make the building thing work, but I'll look into it.

I'm not sure what you mean by script data on a plot...?
 
Great news! Another thing you should do is remove the possibility of adding normal land/ocean in Worldbuilder. It becomes some kind of weird wonderland floating in space.
 
That would be an XML job; the terrains are still defined in CIV4TerrainInfos.xml. However I think removing them might cause issues, otherwise Jon Shafer would probably have done it.

I've been working on the buildings. The set-up I'm trying to get to work is this:

-If you use the add buildings menu (not the Edit City one!) you will add a building to whatever planet is currently selected as the "buildings planet".
-If you go into the Edit City menu to add a building, adding a building to a city adds it to all planets, and likewise removing a building removes it from all planets.

I think it's a better system then hard-coding two buildings into the Worldbuilder files... Final Frontier does this far too many times already for my liking.
 
For the buildings, I basically meant something like running through the addBuildingsToBestPlanet method in CvSolarSystem when a city is created (it runs when a city is founded by normal means) - basically it would save work when creating the cities (though it isn't nearly as needed as the solar system stuff was. Great job on that; I'll include it in 3.0).

The script data is basically how I detect if something is a non-random map of not (Jon Shafer's method wasn't working properly). Scenarios have script data set to "Scenario" on the plot (0,0).

The terrain stuff probably isn't worth looking in to. Someone would have to add it via worldbuilder, and it's very easy to fix if done by mistake. They're probably there to prevent civ from freaking out (as terrains are so fundamental it probably isn't safe to remove them) and as remains of a previous incarnation of Final Frontier based on planets (the mod was originally based on planets until Jon Shafer realized that systems were better for Final Frontier).
 
My current list of changes thus far is:

-When you place a solar system in Worldbuilder, planets and sun type will be randomly generated.
-When you place a building in a city, it will add that building to the planet where buildings are being built.
-When you add a building using the Edit City menu, every planet in the solar system will get that building.
-When you remove a building using the Edit City menu, every planet in the solar system will loose that building.

In addition to adding the addBuildingsToBestPlanet when a city is founded, I'm also going to try and fix the issue where when you remove a solar system, it comes back on the next turn, and make Worldbuilder automatically place Black Hole Gravity Fields and Damage Zones. Then I'll see about making WB add script data to plot 0, 0 when saving (this would be done in CvWBDesc.py).
 
Due to the way Shafer's code works, there will only be one building per system when loaded (as far as I know; it doesn't store what buildings are on what planets). Otherwise I'd advocated reversing the two (I use the edit city button when adding buildings when I make maps).

You can see what's needed for the solar systems staying gone in the Millennium scenario - I think the method that uses it is doHorbus (or something like that; it's when the Romulans enter the war).
 
That's annoying... maybe I'll try to make this work too. I'd have to make it save lists for each planet containing all buildings in the city, and then read them and store them as a list. Then I'd have to adjust the onGameStart function to get this list and add buildings on it to the planet it is for...

After I get the other features working properly, I'll release what I have now, and then work on the buildings.
 
I've released a beta of "Final Frontier Worldbuilder" here in the Utilities forum.

You still can't remove a solar system just by deleting it in Erase Mode, but if you add, say, a Supernova over it, it will not come back the next turn. (This is because there's a bug I'm still trying to solve with the removeObject function).
 
Shiver me timbers, matey, that be some mighty fine work ye did. Me wonders, though, will I be able to move the wormholes in ye Wormhole mod?
 
Shiver me timbers, matey, that be some mighty fine work ye did. Me wonders, though, will I be able to move the wormholes in ye Wormhole mod?

If you mean move a wormhole from one point on the map to another (by wiping it and then readding it), then yes. While there is a "Wormhole Grav Field" feature it remains an unimplemented concept.
 
Back
Top Bottom