Platy's Peculiar Pleasant Posh Python

It is meant to be max. If the screen is tall enough, the calculated value will take priority and spread it wide enough to fill the whole page. If there are too many techs, the calculated value will be too small so the defined value will take effect, setting a min spacing so that they won't be too cramped.

Using min has no meaning here.
 
It is meant to be max. If the screen is tall enough, the calculated value will take priority and spread it wide enough to fill the whole page. If there are too many techs, the calculated value will be too small so the defined value will take effect, setting a min spacing so that they won't be too cramped.

Using min has no meaning here.

As I said, I tried 0 and it did not work. When I changed it to min it did work as I wanted, is all.
 
It depends on how you wanted it to work. The intention is to spread them out evenly to fill the page if possible, else set a min spacing.

Say, Height of box = 50, Height of page = 500, defined value = 10

For 2 boxes,
SpacingA = min (10, 400) = 10 (2 boxes squeezed on top)
SpacingB = max (10, 400) = 400 (box A on top, box B at bottom)

For 4 boxes,
SpacingA = min (10, 300/3) = 10
SpacingB = max (10, 300/3) = 100

For 100 boxes,
SpacingA = min (10, -ve) = -ve
SpacingB = max (10, -ve) = 10 (Sets a min spacing when it is impossible to place all in one page)

Using min has no meaning here. I redefined the calculations though to be more accurate.
 
It depends on how you wanted it to work. The intention is to spread them out evenly to fill the page if possible, else set a min spacing.

It was always splitting them over two vertical pages even though they would fit easily on one page with the 10 value. Which suggests a problem with the calculation of the optimum spacing, I suppose.

Edit: what I got with Y_BOX_SPACING = 10 can be seen in pics 3 and 4 in this post - the techs are split vertically over two screens. Wheb I changed the max to min I got what is in pic 5 with the vertical spacing between the plots being 10 and the techs all on one screen.

This means that the calculation was not coming up with a small number like you suggest in your post
 
One thing is because even if spacing = 0, the boxes won't stack together because of the way panels are designed.

For default 768 resolution, even for grid y = 18, spacing 10 is already too big, not to say yours is grid y 20.
 
Hi, I tried to merge the faith modcomp and it resulted in a strange result: the modifications I made are taken into account, but the bar itself never moves. It seems to not record the gains even if they are taken into account in the interface.
To be sure I tried some changes: I changed the base faith point to 100 and it filled a fifth of the bar. I also gave 50 points to shrines and the interface changed accordingly, indicating +50.




Twice I have seen that the bar moved sightly the first time I gained faith points so to be sure I changed the value of shrines to 501 in order to complete the first level immediatly. It did triggered the event but never changed to the next level so it repeated every turn (here with tengri mongols)


Spoiler :
attachment.php





I suppose that there is a problem with the update of the script.

Important precisions, it worked when I played it alone and I use the (rightly named?) Bug mod.
The strange thing is that there are no error message. It's almost as he said to me: "nothing to see here, carry on."
 

Attachments

  • Civ4ScreenShot0119.JPG
    Civ4ScreenShot0119.JPG
    335.7 KB · Views: 141
  • Civ4ScreenShot0126.JPG
    Civ4ScreenShot0126.JPG
    301.1 KB · Views: 318
If it works alone, then naturally something in your mod is messing with it after merging.
Most likely you have some other components using script data.
 
That is indeed the case. It seems that a file SdToolKitCustom.py is collecting data from revolutionDCM to count the revolt risk. I deleted it temporarily and it broke the revolution mod while alloying the storage of the faith points. Now the real question...Is there a way to make both working at the same time?
 
You can if you have good experience in python merging to let script data store multiple values and let both components read only what they need from the total stored script.

In short, not easy but doable.
 
It think the most simple way would be to use SDTK to store platy's data (it's designed to avoid script data conflicts, after all).
liwy: if you have python experience, you can look at the SDTK documentation and usage in the Revolution code; else, I could hack that together for you, although you'd have to test it yourself.
 
That's a nice proposal. I know a bit of python but honestly I learned it by practice trying to mod civ so I code mostly by imitation and innovations. In case of problems I could ask one of my brother for help but I know he won't do anything unless I have accurate questions (that's understandable). In addition, you are speaking of the SDTK, that' the SDK, right?
 
In your Manufactured Resources mod you have
Code:
	def onBeginPlayerTurn(self, argsList):
		'Called at the beginning of a players turn'
		iGameTurn, iPlayer = argsList
## Manufactured Resources ##
		ManufacturedResource.ManufacturedResource().addResource(iGameTurn, iPlayer)
## Manufactured Resources ##
and similar for when a unit is created. This means that the __init__ function is run for each player every turn and every time a unit is created. I know because I put a trace print in there to make sure I was doing things correctly.

Would it not be better and faster to create one instance at the start and then reuse it through out?
Code:
## Manufactured Resources ##
import ManufacturedResource
## Manufactured Resources ##

mr = ManufacturedResource.ManufacturedResource()

and
Code:
	def onBeginPlayerTurn(self, argsList):
		'Called at the beginning of a players turn'
		iGameTurn, iPlayer = argsList
## Manufactured Resources ##
		mr.addResource(iGameTurn, iPlayer)
## Manufactured Resources ##
 
I think the problem I am having with the tech tree is that I don't play in the same resolution as my screen. Most screens use a different method of getting the resolution and that is based of the game resolution not the screen resolution. I have not had a chance to check this out fully but it would explain the differences I am having with the experience of other C2C players who play full screen.
 
@Keldath
Fixed and reuploaded

@DH
Don't really understand the problem, screenshot please.
 
@DH
Don't really understand the problem, screenshot please.

Screenshots are as before. I play at resolution 1024x768 my screen resolution is 1920x1080. This means that your default code splits the techs over two vertical screens with a large vertical space between the techs.

If I play at 1920x1080 not only do the techs appear on the one screen as they should they have a reasonable vertical spacing.
 
As you said, most screens are based on the game resolution, not the actual monitor resolution.
This screen is no exception. When you play at 1024 while your actual is 1920, all calculations are based on 1024.

Thus, I don't see what is the issue?
 
Back
Top Bottom