• Civilization 7 has been announced. For more info please check the forum here .

Platy World Builder

As mentioned, the only thing special in those team abilities section is the usage of those tech screen widgets.

Those widgets are supposed to take in tech ID for iData1, but after experimenting, setting -1 for iData1 works for all of them as well.

Thus you can do 2 experiments to see if those are the ones at fault.

For the first ability Map Centering, use gc.getInfoTypeForString("TECH_CALENDAR") for iData1.
If it does not work, use WidgetTypes.WIDGET_GENERAL, -1, -1 instead and see if the error message goes to the next ability.

If that is the case, then the error lies in those widgets and I can do something to it, because I can't fix something I cannot replicate.

@Isenchine
You got any errors in Team Data Screen like Magister?

@FFH stuff
For unit data screen, it is still not so bad, because there are 2 excessively long columns which can be cut short to make space.
Duplicating or Conversion won't matter even if the FFH data isn't shown in the same screen since what matters is what goes on in the codes during duplicating, rather than the data being displayed.

But for certain screens like City or Player Data, I think you are gonna have a headache finding space to add new stuff, so you might as well add anything new in a new screen.
 
Using WidgetTypes.WIDGET_GENERAL, -1, -1 instead of WidgetTypes.WIDGET_HELP_MAP_CENTER, -1, -1, does make the error message go to the next ability. The first ability shows up fine in the list (where no abilities were displayed before), but clicking on it does not do anything.


Using gc.getInfoTypeForString("TECH_CALENDAR") for iData1 seems to work perfectly. The error moves on to the next ability, and you can click it to change it from red to green.


I am a bit concerned with how this type of solution would work in my personal FfH2/MNAI modmod though. MagisterModmod has multiple techs (Feudalism and Honor) that allow Defensive Pacts and Permanent Alliances. (Base FfH2 has Vassals and Permanent Alliances at Feudalism, and Permanent Alliances at Honor. Since I do not let the Vampire civ research Honor, which also founds the Sun-worshiping religion, I decided to let Feaudalism to that too.) Would it matter which one I used, if some players got the ability from a different tech.?

Also, the Advanced Tactics option of MNAI adds a more limited form of Open Borders called a Right of Passage Agreement (which allows workers and missionary units to pass, but not soldiers) and requires that teams establish and Embassy before they can have the regular Open Borders agreement. The abilities section of the Team Data screen may need to be altered to fit with this.
 
Not an issue.
The key is to assign the tech id of the tech that allows the ability to the widget.
Whether the team has that tech shouldn't be an issue.

The widget general is just a test to see if the problem lies with that widget.

I will do a fix to that later, if it does not work then will switch to widget python.
The only reason to use those widgets is for the default hover text
 
Main File
1) Removed some redundant variables
2) Fix some issues with Plot Highlighting

Team Data File
3) Recoded Team Abilities.
They come with Hover Text if there is at least one tech that provides the ability.
If not, they still work, just no hover text.
4) New Function
Add/Remove All Abilities

@Magister
If you are unsure what to do with new FFH only Team Abilities, just leave it alone and use WIDGET_GENERAL.
Those fanciful WIDGET_HELP_XXX are just for the hover text to explain what the heck those abilities do.
If you still want a hover text while there is no widget to go with it, use WIDGET_PYTHON, 1029, X.
Pretty much examples in the text file for those.
 
@Isenchine
You got any errors in Team Data Screen like Magister?

Yes, same error (v.3.2).

Sorry, but I did not check that Team data screen before (did not find it!)...

EDIT: problem gone with v.3.3.
 
Another thing, about the crap...

If I add 100 turns manually in the game, it adjusts the year accordingly but it does not affect the Estimated end turn or the Maximum turns accordingly. I thought this would reduce them.

Any idea why and how to change it?
 
What you mean by manually?
Edit xml file?

Frankly speaking, I have no idea what estimated end turn is for
 
No, I mean through your World Builder during a game.

Estimated end turn might be for the strategy of the AI. When I looked in WB, it was the same number as for Maximum Turns though.

The Maximum turns was set in the scenario before the start of the game but I could change it through your WB during the game as well and it works fine.

It's just that for me it should be linked to the turns passed but it is not reflected when you alter the number of turns in WB.
 
Max turns refer to maximum number of turns for this game.
Not number of turns left.

EET and MT will be different for Advanced Start Games, because X % turns already passed.
 
You're right, sorry for the confusion but that's what I meant, turns left.

An example:

Settings: Gamespeed of 4,000 turns, Max turns: 3,500, present turn: 2,000 (1,500 left).

Changes made in WB during game:

1) Max turns (& EET) changed to 2,500. Result: turns left 500 (correct).

2) Present turn changed to 2,100 (to advance the years); Max turns (& EET) changed to 2,600. Result: year correct, turns left 600 (not correct according to me).
 
World Builder 3.3 seems to be working fine on its own, but I am still having trouble with merging it into MNAI. The fact that MNAI includes both BUG and Sevopedia complicates things, particularly in CvScreensInterface.py.

None of the world builder changes seem to be showing up in the game. The usual Map Mode and Player Mode windows are still appearing, but staying empty. Entering World Building causes this python error.

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 615, in WorldBuilderNormalPlayerTabModeCB

  File "CvWorldBuilderScreen", line 1424, in normalPlayerTabModeCB

AttributeError: 'module' object has no attribute 'hideWorldBuilderDiplomacyScreen'
ERR: Python function WorldBuilderNormalPlayerTabModeCB failed, module CvScreensInterface
(Line 615 in the merged CvScreensInterface.py is equivalent to like 299 in your version.)

You wouldn't have any hints as to how to fix this, would you?
 
Search for hideWorldBuilderDiplomacyScreen in both files and remove them.
 
That is the first thing I tried. Neither Notepad++'s nor PyScripter's Find in Files functions can find a single instance of hideWorldBuilderDiplomacyScreen in any file of the modmod.

Edit: I just decided to search the whole Mods folder, and found hideWorldBuilderDiplomacyScreen is found in several mods other than WorldBuilder 3.3, MNAI, or MagisterModmod. These include base Fall from Heaven 2 and BUG 4.4.

It is also found in the unmodded BtS.


The message "CvWorldBuilderScreen", line 1424, in normalPlayerTabModeCB makes no sense if it comes from your CvWorldBuilderScreen.py file, but it makes perfect sense the game is reverting to the default BtS version. It seems that the CvWorldBuilderScreen.py found in C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\MNAI v 2.51 - Copy\Assets\python\Screens\PlatyBuilder is not overriding the version found in C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Assets\Python\Screens.

I am thinking that BUG's error checking mechanisms may make the game more particular about the location of files.

After moving CvWorldBuilderScreen.py, everything seems to be working just fine.


Now I'm just trying to figure out how to switch your attitude art to the icons used in BUG, and then start trying to implement the FfH2/MNAI specific functions.
 
@Isenchine
Bleh, the reason why changing Current Game Turn doesn't change Max Turns is because there is another hidden value, Elapsed Game Turns.
Changing CGT however, does not change EGT so even if you change CGT to the last turn, game is not gonna end anytime soon, since it is based on EGT.

Since there isn't a command to change EGT, so now MT is changed when CGT is changed.
Now you know why I hate this crap.

@Magister
The reason why I do not want to use those BUG attitude icons, is because if you want to use icons, you have to edit the GameFont files, which is messy when you want to add resources, religions etc
Whereas if you use buttons, you only have to add in some DDS files and change the ArtDefines.

Of course, if your mod has been using BUG, then naturally there is no additional work required to add those icons, but for mods without BUG, it becomes tedious to merge in those GameFont files.

Version 3.4
1) Game Turn changes (WBGameDataScreen)
2) Renamed Main File to CvPlatyBuilderScreen (CvPlatyBuilderScreen, CvEventManager, CvScreensInterface)
I know I can just move it out into the main Screens Folder, but I rather kill off the old one totally :D
 
Thank you for looking into this and for finding that "elapsed game turns" hidden value.

After careful consideration :scan:, I decided that you took the right decision (not really a surprise)! Changing automatically the Max Turns makes it that the end year/month in a scenario will be kept as foreseen in the beginning and I think that's the most important thing.
 
In my MNAI merge (I still have not started implimenting new fnctions), I keel getting this error in PythonErr.log when I go to the city details screen.

Code:
Traceback (most recent call last):

  File "CvGameInterface", line 285, in getWidgetHelp

  File "CvGameUtils", line 753, in getWidgetHelp

RuntimeError: unidentifiable C++ exception

I don't notice actual problems in the game though.

(Well I do notice that nothing is showing up under guaranteed eligibility, because vote sources in FfH2 are tied to civics and extra votes to units, not to buildings.)

I was thinking it was related to my commenting out some Corporations code, but looking back again I think the problem is in the line return CyGameTextMgr().getSpecialistHelp(iData2, False)
 
Certain functions need the hover text to function.
Hover text come from the widget.
If you are sure that line refers to the specialist, it means idata2 is out of the range of gc.getnumspecialistinfo

You referring to city data or city data ii?
Because guaranteed eligibility and specialists are on different pages
 
It appears to be an issue with City Data 1.

The label for that screen actually says "City Data (???,???)" for some reason.

The Team Data screen label says "Team Data (???)" but there does not seem to be a python error related to that.

The python error does not occur when I check Barbarian cities.

Edit:
I notice that CvGameUtils.py and CvCityDataScreen.py use 7879 to refer to Specialists, but CvCityEditScreen.py uses that same number to refer to Projects.


In my classical era start text game, the non-barbarian players are able to use the Pact of the Nilhorn ritual. This project has no mouse over, which I think is the source of the problem. When I give myself more techs, I can see that other rituals have mouseovers for specialists.


I just went back to unmodded WorldBuilder 3.4, and gave myself all of the techs before entering the City Data Screen. I then found that Projects in your modcomp have Specialist mouseovers too. I am still not getting any python errors, but I think that is only because there are fewer projects than specialists in base BtS but more rituals than specialists in FfH2.


(I am fairly sure that the guaranteed eligibility issue is completely unrelated. The point is that your code only checks for buildings, because that it how it is determined in BtS, but FfH2 works differently.)

Edit: Those question marks were caused by MNAI still having an outdated file called Platy World Builder.xml, into which I had put all the world builder stuff from before you consolidated them into WorldBuilder_CIV4GameText.xml
 
Version 3.5

1) Text File and Various Screens
Removed certain TXT_KEY and use default ones that come with Civ IV


2) WBCityEditScreen
Project Production Widget Changes
+/- Buttons no longer appear when switching production to Process

3) CvGameUtils
Added Hover Text for Projects
Added Hover Text for Process

4) WBProjectScreen
Since there is a hover text for projects, no longer using pedia jump widget

@Guaranteed Votes
Actually, there wasn't a need to go through those buildings.
The only reason was to get a freaking button to display, else it looks bland with just the name of the vote source.
 
CvGameUtils - def getWidgetHelp

WB:
Code:
			elif iData1 == 6785:
				return CyGameTextMgr().getProjectHelp(iData2, False, CyCity())

Platypedia:
Code:
			elif iData1 == 6785:
				return gc.getProjectInfo(iData2).getDescription()

How to merge this?

Why not present both World Builder and Platypedia in one component? (additional work: yes I know :lol:)

Thank you.
 
Top Bottom