Platy's Peculiar Pleasant Posh Python

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?
 
Just add it to the schema then use it. See how it is done for terrains.
 
Platy,

It is a well known fact that you are an outstanding python developer in the civ community. So this idea may interest you: A custom Map Sizing Menu.

Is it possible to make a menu that utilizes a GUI interface to customize the map size to the exact number of plots for both height and width? When creating a custom game and you select map size, then the custom Map Sizing Menu would pop up and allow the adjustment of the two numerical values. I'd recommend setting the maximum map size to be 512 x 512 and the minimum map size to be 24 x 24.

I think such a menu would be far superior to how we select map sizes now (See example images from an old classic game). All of us on these forums know that projects get worked on during the developer's free time. So there is no rush. Would this type of project interest you?

OV
 

Attachments

  • Map Sizing.jpg
    Map Sizing.jpg
    27.5 KB · Views: 192
  • Map Sizing2.jpg
    Map Sizing2.jpg
    26.6 KB · Views: 171
Thanks for your compliments. However, the custom game selection screen is not python coded, probably hidden somewhere in the exe.
 
Thanks for your compliments. However, the custom game selection screen is not python coded, probably hidden somewhere in the exe.

Maybe so, but the default settings can be overridden via python. Check out SmartMap, which is a custom map maker that is written in Python. It adds several new dropdown boxes to the custom settings. If you can create the custom menu, then I will make the python changes in SmartMap to utilize the numerical values displayed in the new custom menu.
 

Attachments

  • SmartMapSettings.jpg
    SmartMapSettings.jpg
    180 KB · Views: 168
Maybe so, but the default settings can be overridden via python. Check out SmartMap, which is a custom map maker that is written in Python. It adds several new dropdown boxes to the custom settings. If you can create the custom menu, then I will make the python changes in SmartMap to utilize the numerical values displayed in the new custom menu.

You can add custom options to any mapscript and dropdowns will be generated on the Custom Game screen automatically, no overriding needed. You cannot add different UI controls though because, as Platy says, this is all handled in the exe. It would be safer to do what you're wanting via dropdowns anyway, as map dimensions have to be divisible by 4.
 
You can add custom options to any mapscript and dropdowns will be generated on the Custom Game screen automatically, no overriding needed. You cannot add different UI controls though because, as Platy says, this is all handled in the exe. It would be safer to do what you're wanting via dropdowns anyway, as map dimensions have to be divisible by 4.

So trying to change a drop down box to a text box or even attempting to add a button control is not possible due to issues internal to the exe file? We like to push the limits of the game, but this is a road block before ever getting started. I might as well just stick with SmartMap.
 
It would be safer to do what you're wanting via dropdowns anyway, as map dimensions have to be divisible by 4.

Xyth, could you please explain how you arrive to this conclusion? Is it because of the grids?

I have several maps with dimensions not divisible by 4 and they seem to work fine.
 
Xyth, could you please explain how you arrive to this conclusion? Is it because of the grids?

I have several maps with dimensions not divisible by 4 and they seem to work fine.

Saved maps can be any dimension, but generated maps use grid values (which are multiplied by 4 to get the actual dimensions).
 
Top Bottom