Platyping's Python

And now that is another thing to my to-do list.... to update all projects and upload them again...
 
Released one Project first for testing
Spoiler :
Civ4ScreenShot0002-9.jpg


Changes:
1) Added python effects text to be displayed under "Effects" rather than included in pedia
2) Modularised
 
Yay!!!! yeah I did think about that whole not showing xml stuff but the way I did it was I wrote into the help the bonus' of the project (so my Internet displayed productionspeed[newline]grants technology)

As 100% of the interface is handled in python, somewhere there will be python code for the techscreen building screen etc. I did look for it but I didn't find it... If when I have time I do find it I will post the code here so that the effects display everywhere
 
Hmm after studying the_J's TechTree - New icons and effects codes

The answer lies in CvGameUtils

I managed to get the help tag to be displayed, but it is after everything else... which looks freaking ugly...

What I done is this
Code:
def getWidgetHelp(self, argsList):
	eWidgetType, iData1, iData2, bOption = argsList
## Art of War Start ##		
	if iData1 == gc.getInfoTypeForString("PROJECT_ART_OF_WAR"):
		return "\n" + CyTranslator().getText("TXT_KEY_PROJECT_ART_OF_WAR_HELP", ())
## Art of War End ##
	return u""

Now it is time to explore how to get it displayed before the XML effects...
 
I'm sure that you will find it somewhere :p but well done on finding that much!

I might have to put that in for my mod :p
 
actually... for your own mod isn't it easier to just add a HELP tag to project.xml lol
Shouldn't be a problem to you, and save all these troubles
I doing it here only to keep these SDK-free

If I cannot get it to be displayed correct way, then I rather do without it since displaying it after the cost is just... too ugly :D
 
Dunno how to hook up that help tag lol :p

btw I have a question, the in onPlotRevealed callback there is an iTeam arguement. how can I get a CyPlayer out of it? so far I have got this:

gc.getTeam(iTeam).getLeaderID() which returns PlayerType. but how do I get the PlayerType into a CyPlayer instance?

edit: nevermind, I was being stupid :lol: gc.getPlayer(*previous code*)
 
Hmm after studying the_J's TechTree - New icons and effects codes

The answer lies in CvGameUtils

I managed to get the help tag to be displayed, but it is after everything else... which looks freaking ugly...

What I done is this
Code:
def getWidgetHelp(self, argsList):
	eWidgetType, iData1, iData2, bOption = argsList
## Art of War Start ##		
	if iData1 == gc.getInfoTypeForString("PROJECT_ART_OF_WAR"):
		return "\n" + CyTranslator().getText("TXT_KEY_PROJECT_ART_OF_WAR_HELP", ())
## Art of War End ##
	return u""

Now it is time to explore how to get it displayed before the XML effects...

mmhh...interesting :thumbsup:.
 
@The_J
I am king of plagarism :D so long as there is a working code, I can "steal" and adjust :D

@jamie
using getLeaderID() will only give you the leader.
Thus, in a "multi player per team" game, you end up giving the benefits always to the team leader.
What I did in my padrao wonder was make a loop through all players, and identify those who are in the same team.
And from there, check whose turn is active to grant the benefits
 
I guess so, but I was basically trying to get the player that discovered it without any looping (otherwise I can just cycle through all the players and see which has revealed that plot), I was counting on there only being one team :p

I might just swap to a cycle.
 
I guess so, but I was basically trying to get the player that discovered it without any looping (otherwise I can just cycle through all the players and see which has revealed that plot), I was counting on there only being one team :p

I might just swap to a cycle.

When a player in a team reveals a plot, the plot is revealed to the whole team anyway. So even if you cycle through all the players and see which has revealed that plot, you can't tell who is the real guy who moved the unit and see it
 
lPlayers = [gc.getPlayer(i) for i in range(Game.countCivPlayersEverAlive()) if pPlot.isRevealed(gc.getPlayer(i).getTeam(), False)]

that is my setup

the team leader gets the discovery message and then everyplayer in the team gets the bonuses
 
Hmm, something weird when I modularise the projects
XML benefits such as Double Speed with xxx is still linked to the correct project, but the "Requires someone to create XXX project" goes to a wrong project pedia...

Any idea?
Attached is Dead Hand project which requires Manhattan to build.
I tried giving it other XML benefits such as nuke interception, allows nukes etc. All show properly except that freaking red line
 
Cant find it in wiki so never bother lol

Did something for big banana though:rolleyes:
Any chance of making the artwork yellow rather than blackish?
 
That banana was really p*ssing me off, idk why it seems so simple, but haha i would of assumed out of anyone you would like it the best since it seems good with python if anyting :D

Can;t find it on wiki?! I guess its hard to find when its only 4 pages long :p
http://en.wikipedia.org/wiki/Chrysler_building
Maybe thats my fault though since in my thread I accidently called in Chrysler Tower, although I didnt make that mistake in the DL
 
Back
Top Bottom