Start Up Screen

tchristensen

Emperor
Joined
Jul 21, 2010
Messages
1,241
Location
Grand Rapids, Mi
OK this may seem a bit silly, but with my new mod (which is not based on another mod) I am not seeing the start up "Dawn of Man" screen.

I am almost completely clueless about Python, even with the help of a number of people here.

I can look into CvEventManager.py and see references to the "Dawn of Man" popup but wonder why it doesn't appear on new games?

Is there some sort of switch somewhere in a xml to show or hide this? Isn't the popup a standard screen in the game?

Any help would be appreciated.

This is what I see in the .py:
PHP:
	def onGameStart(self, argsList):
		'Called at the start of the game'
		if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):
			for iPlayer in range(gc.getMAX_PLAYERS()):
				player = gc.getPlayer(iPlayer)
				if (player.isAlive() and player.isHuman()):
					popupInfo = CyPopupInfo()
					popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
					popupInfo.setText(u"showDawnOfMan")
					popupInfo.addPopup(iPlayer)
		else:
			CyInterface().setSoundSelectionReady(true)

Note: I think the reason the screen is not showing is because the game starts in the Renaissance Era?

Troy
 
I think this is my trouble since the game starts in 1400 CE and not at -4000 as indicated in the Global defines:

if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):

Is there anyway to correct this?
 
There are four conditions for the pop-up to show:
Code:
gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR")
Code:
not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)
Code:
player.isAlive()
Code:
player.isHuman()
So your mod isn't qualifying of the first one then. You can put any integer value in place of "gc.getDefineINT("START_YEAR")".
 
So your mod isn't qualifying of the first one then. You can put any integer value in place of "gc.getDefineINT("START_YEAR")".

is the number placed in the qoutes "START_YEAR" or does the number replace all of that statement? Is the number in brackets?


like this: if (gc.getGame().getGameTurnYear() == gc.getDefineINT("1400")

I also tried: if (gc.getGame().getGameTurnYear() = 1400

Neither seems to work

NOTE: The game clock, in the upper right shows 1400.
 
I think this is my trouble since the game starts in 1400 CE and not at -4000 as indicated in the Global defines:

And why do you not change the global defines o_O?

like this: if (gc.getGame().getGameTurnYear() == gc.getDefineINT("1400")

I also tried: if (gc.getGame().getGameTurnYear() = 1400

Neither seems to work

NOTE: The game clock, in the upper right shows 1400.

The second one should work...er....wait...it should work with ==, not with =.

And at the end...you could just delete the whole statement in the brackets, but then you'd probably also get the screen after loading a save.
 
And why do you not change the global defines o_O?



The second one should work...er....wait...it should work with ==, not with =.

And at the end...you could just delete the whole statement in the brackets, but then you'd probably also get the screen after loading a save.

For some strange reason if I set the Global Define to 1400, the game starts like 3200 AD. I think it is based on the GameSpeedInfo.XML. I tried a couple of different methods, but it crashed my game. I found if I set the Global to -3885, it starts the game right on 1400 AD.

I will try your thoughts on the other one. I wouldn't even mind if the Dawn message appeared each time the game is loaded, since the message doesn't refer to actually the dawn of man but rather other information.

Still having problems. Doing some research on the web, it looks like there may be other python controlling that startup screen. Someone points out that it does not appear if you start the game at any other time other than an Ancient times. I am unsure why they would have put that in there, but I can't seem to find any reference to it elsewhere.

This is what I have now:
PHP:
	def onGameStart(self, argsList):
		'Called at the start of the game'
		if (gc.getGame().getGameTurnYear() == 1400
			for iPlayer in range(gc.getMAX_PLAYERS()):
				player = gc.getPlayer(iPlayer)
				if (player.isAlive() and player.isHuman()):
					popupInfo = CyPopupInfo()
					popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
					popupInfo.setText(u"showDawnOfMan")
					popupInfo.addPopup(iPlayer)
 
Firstly, enable logging, exceptions and error pop-ups in the .ini file before attempting any Python work. Right now your code is generating an exception because the line you edited is missing the closing parenthesis. (You could as well delete the opening parenthesis though, as it isn't doing anything for you anyway.) The line is also missing the colon.
Code:
        if (gc.getGame().getGameTurnYear() == 1400[COLOR="Red"]):[/COLOR]
And just for the record - you could have put the time and effort you already put into this into learning Python. You would already know much of the basics - like syntax - instead you're still struggling with this one line of code. I'm just saying. You're not doing yourself any favors.
 
Firstly, enable logging, exceptions and error pop-ups in the .ini file before attempting any Python work. Right now your code is generating an exception because the line you edited is missing the closing parenthesis. (You could as well delete the opening parenthesis though, as it isn't doing anything for you anyway.) The line is also missing the colon.
Code:
        if (gc.getGame().getGameTurnYear() == 1400[COLOR="Red"]):[/COLOR]
And just for the record - you could have put the time and effort you already put into this into learning Python. You would already know much of the basics - like syntax - instead you're still struggling with this one line of code. I'm just saying. You're not doing yourself any favors.

Thanks a ton man, I will try it out and tell you what happens. Hey, each of us has his specialties -- you are the Python wizard. I am trying to become the XML king (though I still have a lot of work).

It worked!!! Baldyr is the King of Kings!!!
 
Glad to be of assistance anyways, and glad to hear that you got it working. :king: Don't pay any attention to my whining. :p
 
Glad to be of assistance anyways, and glad to hear that you got it working. :king: Don't pay any attention to my whining. :p

I am sure I will be asking your assistance soon enough.

I have so many terrific ideas for this mod, and I know some of the stuff will not be able to be done with XML. So, I will be asking for assistance as I get the framework of "Ages of Discovery" nailed down

:king:
 
What happened to you learning programming for yourself? :D Because I know that you're smart enough. Its not like its hard. :p

I would be glad to jump on-board as your personal code monkey - if I just had the time. I recently finished up work on one mod and I'm trying to wrap up work on another. I might not be able to do any more project for the foreseeable future though...
 
What happened to you learning programming for yourself? :D Because I know that you're smart enough. Its not like its hard. :p

I would be glad to jump on-board as your personal code monkey - if I just had the time. I recently finished up work on one mod and I'm trying to wrap up work on another. I might not be able to do any more project for the foreseeable future though...

That's OK. If you can help in the future, that would be great but I understand if you are busy. I am pushing 50 hours a week on my day job and have gone back to the university to get my degree and that is another 3 nights a week. So my modding is going to have to take a step back -- perhaps only on the weekends for some time.

It is so great to have a forum such as this where everyone can help each other out.
 
I'll second the last sentence!
 
Back
Top Bottom