Platy Scrollable Scoreboard for RI patch

Ah you are my franchise :D

:lol:

Thanks I will change for wider scoreboard. Two sugestions: Is possible include the symbol of peace-love for peace treated and the swords for war? Is possible fix the columns so that all the open borders and religion symbols are aligned vertically?

1)import FontUtil.

Then add where is proper:
Code:
if pTeam.isForcePeace(CyGame().getActiveTeam()):
          sText1 += u"%s" %(FontUtil.getChar(FontSymbols.PEACE_CHAR))

for forced peace.

For swords substitute where needed:
Code:
if pTeam.isAtWar(CyGame().getActiveTeam()):
          sText1 += u"%s" %(FontUtil.getChar(FontSymbols.WAR_CHAR))

2)The position depends on the amount of icons. The icons are called there with stext1 and in the order of the script for each player much independently of the below or above icons' position. This is better than using more columns, I think.
You can make one of them appear always to left of players score easily at least - when the player is not vassal - (put it before if pteam.isavassal properly), and those'll seem aligned.

Basically add the open borders and religion lines before if pteam.isavassal properly.

This table is not like the bug panel which will set the icons at specific positions; there's only 5 fixed columns here. I guess you could try adding more small columns for each icon if you really want that alignment (but there's bug for that, here we can manipulate the size of the wider column - the benefit).

Btw, I suggest increasing the size of the icons ( the leaderheads, etc) a little bit as the RI buttons are hard to discern at such tiny size (or maybe my eyes are getting worse). Go to screen.addTableControlGFC and change the 23 to 24 or 25 at least (maybe not much more than that actually).
 
:lol:



1)import FontUtil.

Then add where is proper:
Code:
if pTeam.isForcePeace(CyGame().getActiveTeam()):
          sText1 += u"%s" %(FontUtil.getChar(FontSymbols.PEACE_CHAR))

for forced peace.

For swords substitute where needed:
Code:
if pTeam.isAtWar(CyGame().getActiveTeam()):
          sText1 += u"%s" %(FontUtil.getChar(FontSymbols.WAR_CHAR))

2)The position depends on the amount of icons. The icons are called there with stext1 and in the order of the script for each player much independently of the below or above icons' position. This is better than using more columns, I think.
You can make one of them appear always to left of players score easily at least - when the player is not vassal - (put it before if pteam.isavassal properly), and those'll seem aligned.

Basically add the open borders and religion lines before if pteam.isavassal properly.

This table is not like the bug panel which will set the icons at specific positions; there's only 5 fixed columns here. I guess you could try adding more small columns for each icon if you really want that alignment (but there's bug for that, here we can manipulate the size of the wider column - the benefit).

Btw, I suggest increasing the size of the icons ( the leaderheads, etc) a little bit as the RI buttons are hard to discern at such tiny size (or maybe my eyes are getting worse). Go to screen.addTableControlGFC and change the 23 to 24 or 25 at least (maybe not much more than that actually).

I substitute in here:

Code:
if pTeam.isAtWar(CyGame().getActiveTeam()):
          #sText1 += CyTranslator().getText("[ICON_OCCUPATION]", ())
          sText1 += u"%s" %(FontUtil.getChar(FontSymbols.WAR_CHAR))

But not works. A strange bug. Maybe the read of FontUtil?
 
You have to add import FontUtil at the start of the file.

Here's another file with tweaks that you wanted just in case.
 
This table is not like the bug panel which will set the icons at specific positions; there's only 5 fixed columns here. I guess you could try adding more small columns for each icon if you really want that alignment (but there's bug for that, here we can manipulate the size of the wider column - the benefit).

Btw, I suggest increasing the size of the icons ( the leaderheads, etc) a little bit as the RI buttons are hard to discern at such tiny size (or maybe my eyes are getting worse). Go to screen.addTableControlGFC and change the 23 to 24 or 25 at least (maybe not much more than that actually).

You can always adjust the function to affect width of whole table.

The bigger the icons, the less rows you can see without using scrollbar
 
I find it interesting to note how much simpler the platy code is in comparison with bug's (ok, they have more stuff going on, but still).
Its just easier for noobs to tweak it: want an extra icon there? -> BAM -> park 2 lines and that's it, good to go. And manipulate sizes with ease.

Btw, it could be appropriate to call this little work the "Bugged Platy" :p
 
Of course easier. I scrapped the whole bts codes and rewrite everything lol
 
I find it interesting to note how much simpler the platy code is in comparison with bug's (ok, they have more stuff going on, but still).
Its just easier for noobs to tweak it: want an extra icon there? -> BAM -> park 2 lines and that's it, good to go. And manipulate sizes with ease.

Btw, it could be appropriate to call this little work the "Bugged Platy" :p

Yes, and BUG cause some problems that we have not yet got around. For exemple I try merge the Unique Dawn of Man Text, it works with scrips but not with our scenarios.

Take a look: http://forums.civfanatics.com/showthread.php?p=11686101#post11686101
 
Algo de mais específico em relação ao problema? Não tenho a mínima ideia em relação a coisas relacionadas com cenários.

About Unique DOM:
Civ description may change based on language chosen.
I suggest just use the leader type version.

Is possible a version that leader type can distinguish what scenario is it?
Code:
	<TEXT>
		<Tag>TXT_DOM_GENERIC_BRIAN_BORU</Tag>
		<English>The sun rises on the year 4000 BC. (...)</English>
	</TEXT>
	<TEXT>
		<Tag>TXT_DOM_SCENARIO1_BRIAN_BORU</Tag>
		<English>A tangled web of old rivalries (...)</English>
	</TEXT>

@Cruel
Should be able to, just never play around with scenarios before :D
Where are the data kept so I can do some testings :D

Unique DOM Update
Both Civ and Leader versions now vary with map chosen.
If there isn't a specific map version of that leader, the generic leader/civ text is used.
If there isn't a specific leader/civ text, the generic DOM text is used.

The sMAP works with CivBeyondSwordWBSave files too? Or just Scripts?
Code:
		sMap = gc.getMap().getMapScriptName()

Can there be space in the file name?

Should be able to

Showed to me: Bugdata not load. Loading now... (and no interface...)

Well, too bad, can't test with any of the BTS ones since they all came with "_" instead of " "

Try the new one, see if it works.
If map name is "I am happy"
Text file should be TXT_DOM_ALEXANDER_I_am_happy

Humm no... same Bugdata message, and when I try again (without reload the mod) the game and Visual Studio crash also with message win32 exception in Civ4BeyondSword.exe - 6476

Do a simple test.

Code:
				bodyString = sDOM
		[COLOR="Red"]bodyString = sMap[/COLOR]
## Leader Unique DOM Map Specific ##

Add this line in to check what is sMap supposed to be.
Then use that to set up the TXT file.

Thanks. Done and tested with Africa Scenario.

Hey Platy. With this last line the game should work, less the DoM text, right? (shows part of the text needed in TXT). Seems the code don't work very well... if I go to Script(who works well), next exit the game, the DoM is read in Scenario (and crash when starts), but if I go in Scenario first goes to Bugdata error and no UI.


The solution could be something like:

Code:
if not ('.CivBeyondSwordWBSave' in CyMap().getMapScriptName()):
or
Code:
getMapName
From: http://civ4bug.sourceforge.net/PythonAPI/index.html
Others threads with similar problems: http://forums.civfanatics.com/showthread.php?t=356257
http://forums.civfanatics.com/showthread.php?t=362720

Not sure what you mean.
That code was added for you to confirm what is the name of the map in case you are unsure.
You do not need it in actual mod.

The latest one already truncated off the .whatever part behind, leaving just the map script name, as you see in Africa scenario.

Unless your map script has special characters like "." or "!" etc, it will work

Hmm that code is supposed to simply display the name of the map script in the DOM text box directly.

Try make a copy of your mod without BUG, and try with python exceptions enabled.
See if there is an error.

I try with python exceptions enabled. No logs... make a copy without BUG, I don't know if I can because the mod is full of changes and others merges like k-mod, and this changes were not made by me. By the way, I'm just an apprentice ...

Is there another way I can explore?

Code:
## Leader Unique DOM Map Specific ##
		sLeader = gc.getLeaderHeadInfo(self.player.getLeaderType()).getType()[7:]
		sMap = str(gc.getMap().getMapScriptName())
		sMap.replace(" ", "_")
		if sMap.find(".") > -1:
			sMap = sMap[:sMap.find(".")]
		sDOM = localText.getText("TXT_DOM_" + sLeader + "_" + str(sMap), ())
		if sDOM.find("TXT_") == -1:
			bodyString = sDOM
		else:
			sDOM = localText.getText("TXT_DOM_" + sLeader, ())
			if sDOM.find("TXT_") == -1:
				bodyString = sDOM
		[B][COLOR="Red"]bodyString = sMap[/COLOR][/B]
## Leader Unique DOM Map Specific ##

Use this test version.
Start the scenario, and see what is displayed in the DOM.
That is the name of the map script after truncating off the .whateverWBsave
See if there are any weird characters or not or just take a screenshot.


Yes, I already test with this code, and did it again (re-merge) to confirm. Nothing is displayed in the DOM. Like the previous exemple, the DOM screen isn't appear, and the game start with error: Bugdata error. Loading now. The UI also not appear.

The screenshot:


Uploaded with ImageShack.us

Chances are, BUG is messing with it.
The other way is don't use the map script specific version.
Define a new Leader Type for the scenario version and use the original Leader specific version

Checked after about BUG date, was a very complicated way that BUG invented to store the information and not have the slightest notion of how to handle since it uses a series of index.

More information:
From another thread:

I have investigated that some more and yes, it is a problem but luckily not as much as I thought at first because it is only used in the problematic manner in very few cases.
That is probably why that bug was not discovered earlier (it already is in this way in RevolutionDCM).

The problem is that there is SdToolKit, which is rewritten in BUG to be based on BugData. That script reads the ScriptData of the game object into a Python data structure on load and only pickles and writes it back right before saving.
Then there is SdToolKitCustom which is based on the original SdToolKit and pickles/depickles on every access. So if you write something in the game object ScriptData with SdToolKitCustom then that gets lost on the next presave event.
Luckily most of the access to SdToolKitCustom is done by Revolution on the player object ScriptData which is not touched by BugData.

I guess I will merge the two SdToolKit APIs and make sure the issue is caught there.

I fixed that back then by merging the two variants of SdToolKit that were present, check revision 3171.

Revision 3171 - C2C
Fixed bug with wrong icon for civs that do not like you.
Added airport icon and added all civ attitude icons to symbol list.
Merged SdToolKitCustom into SdToolKit and based all global/game serialization on BugData.
Fixed some bugs in BugData (did that ever work? Can't exclude though that I read some of it wrong).

/trunk/Assets/CvGameCoreDLL.dll
/trunk/Assets/Python/Screens/CvMainInterface.py
/trunk/Sources/CvEnums.h
/trunk/Assets/res/Fonts/GameFont.tga
/trunk/Assets/res/Fonts/GameFont_75.tga
/trunk/Assets/Python/Revolution/Gameready/StartAsMinors.py
/trunk/Sources/CyEnumsInterface.cpp
/trunk/Assets/Python/Revolution/Gameready/DynamicCivNames.py
/trunk/Assets/Python/Revolution/Development/Tester.py
/trunk/Assets/Python/Revolution/Gameready/AIAutoPlay.py
/trunk/Assets/Python/Revolution/Gameready/BarbarianCiv.py
/trunk/Assets/Python/Revolution/Gameready/Revolt.py
/trunk/Assets/Python/Revolution/Gameready/Revolution.py
/trunk/Assets/Python/Revolution/RevBuildingsUtils.py
/trunk/Assets/Python/Revolution/RevCivicsUtils.py
/trunk/Assets/Python/Revolution/RevData.py
/trunk/Assets/Python/Revolution/RevEvents.py
/trunk/Assets/Python/Revolution/RevTraitsUtils.py
/trunk/Assets/Python/Revolution/RevUtils.py
/trunk/Assets/Python/BUG/BugData.py
/trunk/Assets/Python/Contrib/SdToolKit.py
/trunk/Assets/Python/Screens/CvMainInterfaceATOM.py
/trunk/Assets/Python/SdToolKitCustom.py


I replace some files, made &#8203;&#8203;some changes and came to the conclusion that I know nothing of programming. :D
 
The problem should be the "." in 3.2 name start of scenarios. Platy was talking about weird characters.

I'll check it. Because really, what has bugdata to do with that script?
 
Simple solution is simple.

Actually stuff is working fine. Almost nothing to do.
Make, for example, the crusades scenario name be: 32 RI Crusades.CivBeyondSwordWBSave
Create, for example, a leader tag for the texts like so: <Tag>TXT_DOM_BRIAN_BORU_32 RI Crusades</Tag>

Done. Off you go :)


Platy, noob question: is sMap.replace(" ", "_") supposed to allow us to use in the tag: _32_RI_Crusades if we want to?
 
I'm asking because if I use _32_RI_Crusades instead of _32 RI Crusades with spaces like in the scenario name file it doesn't work.
 
Well, that's another little problem solved.

Do you test the scenario without the "." and with the tag? Because I remember having tried this and failed ... I don't know what to say, redid the tests with the files already merged in mod and it worked. :confused::confused::confused::confused::confused:
 
Well, that's how it goes sometimes. Maybe it was an older scenario bug related to something else on game start. Nothing to do with using "_"?
 
Add (for scoreboard):
Code:
screen.deleteWidget("ScoreBackground")
screen.deleteWidget("ScoreWidthMinus")
screen.deleteWidget("ScoreRowMinus")
screen.deleteWidget("ScoreRowPlus")
screen.deleteWidget("ScoreWidthPlus")

below
Code:
# Setup the GlobeLayer panel
iNumLayers = kGLM.getNumLayers()
if kEngine.isGlobeviewUp() and CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_HIDE_ALL:

~line 5636 CvMainInterface to avoid a minor python exception on globe view.
 
Add (for scoreboard):
Code:
screen.deleteWidget("ScoreBackground")
screen.deleteWidget("ScoreWidthMinus")
screen.deleteWidget("ScoreRowMinus")
screen.deleteWidget("ScoreRowPlus")
screen.deleteWidget("ScoreWidthPlus")

below
Code:
# Setup the GlobeLayer panel
iNumLayers = kGLM.getNumLayers()
if kEngine.isGlobeviewUp() and CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_HIDE_ALL:

~line 5636 CvMainInterface to avoid a minor python exception on globe view.


Is this?
In Line: 6281
Code:
		# Setup the GlobeLayer panel
		iNumLayers = kGLM.getNumLayers()
		if kEngine.isGlobeviewUp() and CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_HIDE_ALL:
                     screen.deleteWidget("ScoreBackground")
                     screen.deleteWidget("ScoreWidthMinus")
                     screen.deleteWidget("ScoreRowMinus")
                     screen.deleteWidget("ScoreRowPlus")
                     screen.deleteWidget("ScoreWidthPlus")
			# set up panel
		     if iCurrentLayerID != -1 and kGLM.getLayer(iCurrentLayerID).getNumOptions() != 0:
				bHasOptions = True		
		     else:
				bHasOptions = False
				screen.hide( "ScoreBackground" )
 
Back
Top Bottom