Platy World Builder

Hey platyping
do you need someone who translate your great WorldBuilder into German?
I could do this...
 
You claimed to have "replaced the old method of appending to simpler one" in "all pages," but you did not make such changes to CvWorldBuilderScreen.py. It still relies for searching strings and separating the parts before and after PLATY.


For the most part is was easy for me to switch to the simpler method in that file myself, but I'm a bit confused with how to do so with the Global defines part.


I'm also wondering about how FfH2's GlobalDefinesAlt.xml works with this. That file includes some defines that override those in the standard GlobalDefines.xml, but more defines that are are unique to FfH2 and its modmods.

I added this, and it seems to work, but I don't see a way to tell which of the defines of the same name is from which file and overrides the other. (I suppose the easiest way would be to comment out the line that sorts the defines.
Code:
		## Global Defines ##
		self.m_tabCtrlEdit.addSectionLabel(localText.getText("TXT_KEY_WB_GLOBAL_DEFINE",()),  0)
		lGlobalDefine = []
		GlobalDefineFile = open("Assets/XML/GlobalDefines.xml")
		for line in GlobalDefineFile.readlines():
			if "<DefineName>" in line:
				strGlobal = line[line.find(">") +1 : line.find("</")]
			elif "<iDefineIntVal>" in line:
				lGlobalDefine.append(strGlobal + "_PLATYINT")
			elif "<DefineTextVal>" in line:
				lGlobalDefine.append(strGlobal + "_PLATYSTR")
			elif "<fDefineFloatVal>" in line:
				lGlobalDefine.append(strGlobal + "_PLATYFLOAT")
		GlobalDefineFile.close()


[COLOR="Red"]		GlobalDefineFile = open("Mods/Magister Modmod for FfH2/Assets/XML/GlobalDefinesAlt.xml")
		for line in GlobalDefineFile.readlines():
			if "<DefineName>" in line:
				strGlobal = line[line.find(">") +1 : line.find("</")]
			elif "<iDefineIntVal>" in line:
				lGlobalDefine.append(strGlobal + "_PLATYINT")
			elif "<DefineTextVal>" in line:
				lGlobalDefine.append(strGlobal + "_PLATYSTR")
			elif "<fDefineFloatVal>" in line:
				lGlobalDefine.append(strGlobal + "_PLATYFLOAT")
		GlobalDefineFile.close()[/COLOR]


		lGlobalDefine.sort()
		lGlobalType = []
		strTest = ()
		for i in xrange(len(lGlobalDefine)):
			sGlobal = lGlobalDefine[i]
			strTest += (sGlobal[:sGlobal.find("_PLATY")] ,)
			if sGlobal.find("_PLATYINT") > -1:
				lGlobalType.append("INT")
			elif sGlobal.find("_PLATYSTR") > -1:
				lGlobalType.append("STR")
			else:
				lGlobalType.append("FLOAT")
			lGlobalDefine[i] = sGlobal[:sGlobal.find("_PLATY")]
		self.m_tabCtrlEdit.addSectionDropdown("Global Define", strTest, "CvScreensInterface", "WorldBuilderHandleEditGlobalDefineCB", "EditGlobal Define", 0, self.m_iGlobalDefine)
		if lGlobalType[self.m_iGlobalDefine] == "INT":
			self.m_tabCtrlEdit.addSectionSpinner("GlobalDefineINT", "CvScreensInterface", "WorldBuilderHandleGlobalDefineCB", "I" + lGlobalDefine[self.m_iGlobalDefine], 0, -10000, 10000, 1, gc.getDefineINT(lGlobalDefine[self.m_iGlobalDefine]), 0 , 0)
		elif lGlobalType[self.m_iGlobalDefine] == "STR":
			self.m_tabCtrlEdit.addSectionLabel("",  0)
		#	self.m_tabCtrlEdit.addSectionEditCtrl(gc.getDefineSTRING(lGlobalDefine[self.m_iGlobalDefine]), "CvScreensInterface", "WorldBuilderHandleGlobalDefineCB", "S" + lGlobalDefine[self.m_iGlobalDefine], 0)
		else:
			self.m_tabCtrlEdit.addSectionSpinner("GlobalDefineFLOAT", "CvScreensInterface", "WorldBuilderHandleGlobalDefineCB", "F" + lGlobalDefine[self.m_iGlobalDefine], 0, -10000.00, 10000.00, 0.01, gc.getDefineFLOAT(lGlobalDefine[self.m_iGlobalDefine]), 0 , 0)
## Game Script ##
		self.m_tabCtrlEdit.addSectionLabel(localText.getText("TXT_KEY_WB_SCRIPT_DATA",()),  0)
		self.m_tabCtrlEdit.addSectionEditCtrl(CyGame().getScriptData(), "CvScreensInterface", "WorldBuilderHandleEditScriptCB", "GameEditScript", 0)
##
		if (not self.m_tabCtrlEdit.isNone()):
			self.m_normalPlayerTabCtrl.enable(False)
			self.m_normalMapTabCtrl.enable(False)
			self.m_bCtrlEditUp = True
		return

Also, many of the new defines in GlobalDefinesAlt.xml are strings, which it does not seem possible to edit. When I tried to un-comment the line self.m_tabCtrlEdit.addSectionEditCtrl(gc.getDefineSTRING(lGlobalDefine[self.m_iGlobalDefine]), "CvScreensInterface", "WorldBuilderHandleGlobalDefineCB", "S" + lGlobalDefine[self.m_iGlobalDefine], 0) to see if that would let me edit them, it causes python errors.
 
Hmm forgot that file itself, but I do intend to scrap the whole global define section if I bother to look into it.
The reason is that although you can modify global defines via python, the modifications are only applicable during that game.
When you exit the mod and reload the mod, all global defines revert back to existing XML values.
In other words, it is not really useful.

Also, it doesn't matter that mods have a GlobalDefinesAlt file.
If you look into the codes, what is saved is the global define NAME and not its value.
So if your GlobalDefinesAlt changes the value of a default global define, what will be displayed will still be the modified value.
The only thing is if your GlobalDefinesAlt has new global defines that are not in the default XML file, then you have to go through it as well to add the new ones.

I did mention before that I could not get strings to work.
I even tried using a simple code in CvEventManager to print gc.getDefineSTRING("XXX") and there is no effect.
 
Sure, that will be great :D
First I want to update your WorldBuilder in my mod and fix the merging problems with BUG. Then I'm going to translate it ;)

Has someone merged it with BUG flawlessly and could send me the merged files please? That would be really helpful. thanks.

antriot
 
Generally, it has no conflict with BUG.
C2C has used it, Xyth has used it for his HR mod too.
 
maybe I'm just too silly :D
Ok I'll take a look at the HR mod. Thanks for your help.
 
Ok then, I merged it but I have still 2 problems/bugs.
The first picture is the diplomacy screen. Its too big and I cannot make it smaller.

I get an error if I open the tech screen and if I choose one tchnology. Thats the second picture. In the HR mod this bug doesnt appear but I can't find the difference between my merged files and the files of HR. Can someone say me what I've done wrong?
 

Attachments

  • Civ4ScreenShot0333.JPG
    Civ4ScreenShot0333.JPG
    299.9 KB · Views: 68
  • Civ4ScreenShot0332.JPG
    Civ4ScreenShot0332.JPG
    247.7 KB · Views: 62
Might be due to incompatible version. The most recent version of HR (1.20) was released before Platyping updated his world builder to 2.0. I merged 2.0 into my development version of HR a few weeks ago though; I'll check if there's been any further updates, merge them if so, and post the changed files for you if you like.
 
Here's the files you need to merge the latest version of version of Platy Worldbuilder (taken from the Ultrapack, I don't know how up to date the stand alone version is) with BUG. I've also included an alternative version of the Diplomacy panel that uses BUG's attitude symbols and colours instead of Platyping's custom ones (with this you can skip adding/merging the art files and all the xml files except for the texts one). Finally, use the included WidgetUtil.py (goes in Assests/Python/BUG) instead of the getWidgetHelp() section of CvGameUtils.py - BUG completely overrides that function so you need to add any similar widget help changes to the function of the same name in WidgetUtil.py instead.
 

Attachments

Updates

1) Removed Global Defines as mentioned above.

2) Removed Tech Sharing from Team Edit Screen, because the wordings are just too confusing...

3) Rewrite all the appending codes in CvWorldBuilder file.

4) Added Nukes Exploded to Game Info Edit Screen, because it looks too empty after removal of Global Defines.

5) New Function:
Allows user to add units more than 1 at a time.
You get new functions when I am fed up with the existing system :D
Can choose to add up to 100 at 1 go. (90 chosen for screenshot)
Click once and 90 lions are added at 1 go.
Only when you add via the right panel rather than the button style.
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    141.6 KB · Views: 62
  • Civ4ScreenShot0001.JPG
    Civ4ScreenShot0001.JPG
    133.4 KB · Views: 73
Updated Spanish and Italian Texts for some of them, provided by Dancing Hoskuld from C2C mod
 
I am using this with RevolutionDCM (BUG-Core) so I am not sure if this bug is in your code Platy, but I can't add espionage points in the diplomacy screen. Strangely, the '+ X'EspionagePoints to All' command does work. This is the only way to add espionage points in the WB now for me.

EDIT: Even stranger, I cannot use the espionage points with the '+ X'EspionagePoints to All' command. After adding 1000 points I could still do nothing with my spy, but after infiltrating with a WB-Great Spy unit I could do everything again. They do show up in the espionage screen though, these points, but they are just for the interface and not for use.
 
None of them will work without respective widgets.
Widgets are screwed by BUG unless you do it in their format
 
Ok, I need your advice again :rolleyes:

this time I am working on something new and I need a few new interface popups... I was wondering how you do them? can you give me some guidance?

I need one which shows a list of plots which might vary in size, (they are plots with cottages on let's say) and a button at the bottom for a plot picker. Also at the top it needs to show the city's :food:/turn

The second screen needs to have the :food:/turn of the plot (just assume plot yield for now) and below it some text and beneath that:

[-] value [+]

where the brackets indicate a button and the value in the middle is some integer...

how would I go about doing this, and making them show up when I click another button on the screen?
 
Eh trackers pack or mercernary is best example?
Click a button and a screen pop up
 
:rolleyes: ehh I thought about that myself... I was hoping to get more applied knowledge but oh well :p
 
Back
Top Bottom